Hello,
I registered on this forum because I am beginner in Robot Studio and RAPID language and I have a question.
I need to get a number of current robot error from IRC5 controller (like emergency stopped, axis error etc.) and write this value to integer type variable. Then I have to send this value to PLC via PROFINET.
My questions are:
1) How can i read, that robot is in Error state - which variable from IRC5 controller give us this information?
2) How to read actual error number (Events List code) in every step of program ?
I wanted to get "Position outside reach (50436)" error. The X-axis value of Target_30 is that Robot can't reach this point. I tried to do this in simulation mode with "ERROR" instruction but It didn't work. After "ERROR" instruction I write ERRNO to num type variable "ErrorNb" and then SETDO if this value is higher than 0. Below I put my code from RAPID.
MODULE Module1
VAR num ErrorNb; !value to write ERRNO
PROC Path_10()
MoveL Target_10,v1000,z100,AW_Gun\WObj:=wobj0;
MoveL Target_20,v1000,z100,AW_Gun\WObj:=wobj0;
MoveL Target_30,v100,z200,AW_Gun\WObj:=wobj0;
ENDPROC
PROC main()
Patch_10;
ERROR
ErrorNb := ERRNO;
IF ErrorNb > 0 THEN
SETDO do_Error,HIGH;
ENDIF
ENDPROC
ENDMODULE