# Limit and 40223 execution error

**URL:** <https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951>\
**Category:** RobotStudio\
**Created:** [January 26, 2021, 9:24am UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951 "2021-01-26T09:24:35Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dedex](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Dedex](https://tech-community.robotics.abb.com/u/Dedex)\
**Post date:** [January 26, 2021, 9:24am UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/1 "2021-01-26T09:24:35Z")

</div>

Hi im useing irb 1200 robot.  
And also using abb Cognex Camera.  
When i start the robot in automatic mod. Camera gives me this error.  
Sometimes working fine with some .job files.  
Sometimes not working other .job files.

Thank you for reading and answering.

 ![image.jpg](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/2/2e6ac2675b14f3f0ef16beb7a5f7463a01a8ae08.jpeg)  
 ![image.jpg](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/7/756ab4d4958facc763bfc2044ecb0221acc21f04.jpeg)  
 ![image.jpg](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/6/6da7b34f77d983f5ddb7642a0e2518ffb33c9091.jpeg)

---

<div class="post-metadata">

**Author:** ![xerim](https://avatars.discourse-cdn.com/v4/letter/x/2bfe46/32.png) [@xerim](https://tech-community.robotics.abb.com/u/xerim)\
**Post date:** [January 26, 2021, 1:06pm UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/2 "2021-01-26T13:06:53Z")

</div>

What else is in your event log when error 40223 occurs?

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [January 26, 2021, 6:00pm UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/3 "2021-01-26T18:00:09Z")

</div>

You need to find in the code of Kamera\_Kontrol\_PLC where it is getting the error, the error handler which is attempting the RETRY instruction, and why it is failing. Presumably because whatever you are trying to capture with the camera or calculate is failing.

---

<div class="post-metadata">

**Author:** ![Dedex](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Dedex](https://tech-community.robotics.abb.com/u/Dedex)\
**Post date:** [January 26, 2021, 10:27pm UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/4 "2021-01-26T22:27:55Z")

</div>

> [@xerim](#):
>
> What else is in your event log when error 40223 occurs?

just normal event logs. nothing different

---

<div class="post-metadata">

**Author:** ![Dedex](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Dedex](https://tech-community.robotics.abb.com/u/Dedex)\
**Post date:** [January 26, 2021, 10:29pm UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/5 "2021-01-26T22:29:25Z")

</div>

> [@lemster68](#):
>
> You need to find in the code of Kamera\_Kontrol\_PLC where it is getting the error, the error handler which is attempting the RETRY instruction, and why it is failing. Presumably because whatever you are trying to capture with the camera or calculate is failing.

i tried every thing. But i did not find nothing. If you want i can copy the Kamera code here.

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [January 27, 2021, 1:04pm UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/6 "2021-01-27T13:04:05Z")

</div>

I suppose, as long as it is not some huge bunch of code.

---

<div class="post-metadata">

**Author:** ![barrettsmithbb](https://avatars.discourse-cdn.com/v4/letter/b/dc4da7/32.png) [@barrettsmithbb](https://tech-community.robotics.abb.com/u/barrettsmithbb)\
**Post date:** [January 30, 2021, 3:00am UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/7 "2021-01-30T03:00:08Z")

</div>

The controller is telling you that there is no error handler for that specific problem.

I typically do the following to try and root cause:

If you know where in the code it is failing you can add:

```auto
ERROR
     TEST ERRNO
     CASE ERR_MAXTIME (Or other errors): 
        ...
     DEFAULT:
        !//If you don't know the error RAISE will give more information to the user when it fails.
        RAISE;
     ENDTEST

```

---

<div class="post-metadata">

**Author:** ![Dedex](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Dedex](https://tech-community.robotics.abb.com/u/Dedex)\
**Post date:** [February 10, 2021, 6:49pm UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/8 "2021-02-10T18:49:15Z")

</div>

Here is the my code block for Kamera\_kontrol\_plc. İssiue still continues.I cant find any solution.

 ![image.jpg](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/1X/a018937503170c9ec690ba0629b41e48a7bff0e1.jpeg)  
 ![image.jpg](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/1X/34d13031fa38d0cf9240ff0ed3b2e1a85662623a.jpeg)  
 ![image.jpg](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/7/7d0f0078c6e451812d9d1fa78b245505bcb5639d.jpeg)  
 ![image.jpg](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/1X/7a3d67f476834fb764fa33e42192ad6b415562b9.jpeg)  
 ![image.jpg](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/0/05f15c006fca9c09d6eef4995374838bffd02e07.jpeg)

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [February 10, 2021, 7:04pm UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/9 "2021-02-10T19:04:51Z")

</div>

Change the error handler from IF to TEST CASE with a DEFAULT.  
TEST ERRNO  
CASE ERR\_CAM\_MAXTIME  
RETRY;  
DEFAULT:  
Stop;  
!Find the value in errnum datatypes of ERRNO, match it with the predefined errors.  
ENDTEST

I am pretty sure that the IF DI\_25\_PLC\_Resim\_Cec=0 THEN statement never gets evaluated because RETRY takes execution back to where the error instruction originated. You can also use instruction ResetRetryCount but you may get caught in that loop forever. What you really need to do is find out what the root cause is for not getting good camera result. You could also add a numeric variable to increment every time it enters that error handler so that you can get some idea of how many times it is doing so. BTW, you could have copied that code and pasted it in here without taking pictures.

---

<div class="post-metadata">

**Author:** ![Dedex](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Dedex](https://tech-community.robotics.abb.com/u/Dedex)\
**Post date:** [February 17, 2021, 7:02pm UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/10 "2021-02-17T19:02:52Z")

</div>

i take system fail again.Do you guys other idea?

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [February 17, 2021, 8:09pm UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/11 "2021-02-17T20:09:39Z")

</div>

What have you changed (or not changed) that has put the robot into system failure?

---

<div class="post-metadata">

**Author:** ![Dedex](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Dedex](https://tech-community.robotics.abb.com/u/Dedex)\
**Post date:** [February 20, 2021, 12:48pm UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/12 "2021-02-20T12:48:05Z")

</div>

i am change the rapid like this.

Change the error handler from IF to TEST CASE with a DEFAULT.  
TEST ERRNO  
CASE ERR\_CAM\_MAXTIME  
RETRY;  
DEFAULT:  
Stop;  
!Find the value in errnum datatypes of ERRNO, match it with the predefined errors.  
ENDTEST

than later i change the IF DI\_25\_PLC\_Resim\_Cek=0.  
Fail again.

BTW i checked the cognex camera lights and everything looks good. When i want to connect integrated vision i cant do that. I restrated the robot and than later i connect the camera. 4-5 hours later i want to check the camera again and camera had stopped. Than later i restared the robot again. than later same thing again.

In-sıght explorer version 5.07.00 Camera firmware version 4.10.02

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [February 22, 2021, 1:15pm UTC](https://tech-community.robotics.abb.com/t/limit-and-40223-execution-error/9951/13 "2021-02-22T13:15:40Z")

</div>

Declare a numeric variable, increment it each time it goes into the error handler so you can check on how many times it errors. You can still try ResetRetryCount but maybe you want to also stop it at a certain limit so that you do not get caught in an infinite loop. In this case, RAISE an error notifying you or the user to investigate what is going on to cause the camera to fail.
