# ERROR Handler not catching overload error: 50055 Joint Load too high

**URL:** <https://tech-community.robotics.abb.com/t/error-handler-not-catching-overload-error-50055-joint-load-too-high/10703>\
**Category:** RAPID Programming\
**Created:** [April 25, 2022, 6:39am UTC](https://tech-community.robotics.abb.com/t/error-handler-not-catching-overload-error-50055-joint-load-too-high/10703 "2022-04-25T06:39:21Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Forge\_Engineering](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/forge_engineering/32/4455_2.png) [@Forge\_Engineering](https://tech-community.robotics.abb.com/u/Forge_Engineering)\
**Post date:** [May 31, 2022, 6:20am UTC](https://tech-community.robotics.abb.com/t/error-handler-not-catching-overload-error-50055-joint-load-too-high/10703/21 "2022-05-31T06:20:28Z")

</div>

Hi Dave,

I think the function ReadErrData does what you are looking for.  
It can be used in a Trap routine to get the Error Domain (errdomain datatype) that gives you the prefix, which is 5, for motion errors.  
It is explained with basic examples in the Rapid Instructions Help available through RobotStudio.

Good Luck,

Harry

---

<div class="post-metadata">

**Author:** ![SomeTekk](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/sometekk/32/151_2.png) [@SomeTekk](https://tech-community.robotics.abb.com/u/SomeTekk)\
**Post date:** [May 31, 2022, 12:08pm UTC](https://tech-community.robotics.abb.com/t/error-handler-not-catching-overload-error-50055-joint-load-too-high/10703/22 "2022-05-31T12:08:01Z")

</div>

Here’s background task I use for catching errors (parts of dealing with regain distances are dis-included because in this facility the regain distances are VERY small ≈1mm). A log is written to on an external PC that I have NOT included the parameters for:

VAR intnum intMotErr\_interrupt;  
VAR intnum intHWareErr\_interrupt;  
VAR intnum intRegain\_interrupt;  
VAR errdomain err\_domain;  
VAR num err\_number;  
VAR errtype err\_type;  
VAR trapdata err\_data;  
VAR string strCtrlId;  
VAR string string1;  
VAR string string2;  
VAR string stEorW;

VAR iodev textfile;  
VAR iodev io\_DeviceName;  
VAR string tempstring;

PERS num nProgNum:=88;

PROC main()

IDelete intMotErr\_interrupt;  
IDelete intHWareErr\_interrupt;  
IDelete intRegain\_interrupt;  
WHILE TRUE DO  
IDelete intMotErr\_interrupt;  
IDelete intHWareErr\_interrupt;  
IDelete intRegain\_interrupt;  
CONNECT intMotErr\_interrupt WITH trErrLog;  
IError MOTION\_ERR,err\_type,intMotErr\_interrupt;  
CONNECT intHWareErr\_interrupt WITH trErrLog;  
IError HARDWARE\_ERR,err\_type,intHWareErr\_interrupt;  
CONNECT intRegain\_interrupt WITH trRegain;  
ISignalDO do\_Eax\_RegainErr1,1,intRegain\_interrupt;  
WaitTime 0.01;  
ENDWHILE  
ENDPROC

TRAP trErrLog  
strCtrlId:=GetSysInfo(\CtrlId);

GetTrapData err\_data;  
ReadErrData err\_data,err\_domain,err\_number,err\_type;  
IF err\_number\<10 THEN  
string1:=ValToStr(err\_number);  
string2:=“000”+string1;  
ELSEIF err\_number\>=10 AND err\_number\<=99 THEN  
string1:=ValToStr(err\_number);  
string2:=“00”+string1;  
ELSEIF err\_number\>=100 AND err\_number\<=999 THEN  
string1:=ValToStr(err\_number);  
string2:=“0”+string1;  
ELSEIF err\_number\>999 THEN  
string2:=ValToStr(err\_number);  
ENDIF  
Open “ExternalPC:”\File:=“ErrLogging.txt”,io\_DeviceName\Append;  
Write io\_DeviceName,strCtrlId;  
Write io\_DeviceName,CDate()\NoNewLine;  
Write io\_DeviceName," "+CTime();  
Write io\_DeviceName,stEmpty;  
tempstring:=ValToStr(err\_domain);

IF err\_type=2 THEN  
stEorW:=“Warning”;  
ELSEIF err\_type=3 THEN

stEorW:=“ERROR”;  
ELSE  
stEorW:=“\A0”;  
ENDIF  
Write io\_DeviceName,stEorW+" number = “\NoNewLine;  
Write io\_DeviceName,tempstring+string2;  
Write io\_DeviceName,stEmpty;  
Write io\_DeviceName,”\*\*\*\*\*\*\*\*\*\*\*\*";  
Write io\_DeviceName,stEmpty;  
Close io\_DeviceName;  
ERROR  
IF ERRNO=ERR\_FILEACC OR ERRNO=ERR\_FILNOTFND OR ERRNO=ERR\_FILEOPEN THEN  
SkipWarn;  
TRYNEXT;  
ENDIF  
ENDTRAP

Sample Output:

* * *

6640-103713  
2022-05-05 09:35:11

ERROR number = 50056

* * *

---

<div class="post-metadata">

**Author:** ![DaveCleveland](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@DaveCleveland](https://tech-community.robotics.abb.com/u/DaveCleveland)\
**Post date:** [May 31, 2022, 3:32pm UTC](https://tech-community.robotics.abb.com/t/error-handler-not-catching-overload-error-50055-joint-load-too-high/10703/23 "2022-05-31T15:32:36Z")

</div>

Thank you Harry. That’s what I needed. I had it in my head that err\_domain was the error type (state, warn, err).

And thank you SomeTekk for the example. Logging is on my list of things to get done. I’m curious why you use IDelete when you enter the routine and again inside the loop.

---

<div class="post-metadata">

**Author:** ![SomeTekk](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/sometekk/32/151_2.png) [@SomeTekk](https://tech-community.robotics.abb.com/u/SomeTekk)\
**Post date:** [May 31, 2022, 4:32pm UTC](https://tech-community.robotics.abb.com/t/error-handler-not-catching-overload-error-50055-joint-load-too-high/10703/24 "2022-05-31T16:32:06Z")

</div>

IDelete is in both those places in case, probably irrationally, a colleague changes the Task Type.

[Previous page](https://tech-community.robotics.abb.com/t/error-handler-not-catching-overload-error-50055-joint-load-too-high/10703.md?page=1)
