I am using Karel’s built in routine CALL_PROGLIN to start a tp program. The tp program takes some time as it has a number of steps. If the tp program fails due to Unreachable point, the Karel program is still stuck at CALL_PROG instead of throwing an error. How can I make the Karel program throw error?
Karel Program to run a TP program with error handling
-
krgaurav22 -
August 14, 2023 at 4:32 AM -
Thread is Unresolved
-
-
Fubini
August 14, 2023 at 5:19 AM Approved the thread. -
Hi krgaurav22,
Unfortunately, I can not reproduce your problem.
I just tried this in RG, and as I expected, the called TP prog also "throws" an error.
-
I am using this https://github.com/torayeff/fanuc…pdk_cmd.kl#L399 and calling it from my python code. I don’t get any error. Teaching pendant shows the error but not the code.
-
Teaching pendant shows the error but not the code.
What do expect?
You are only calling the tp program.
To get error's you have to monitor(e.g. second task) the robot, and receive (all) the errors.
- Checkout the '$ALM_IF' variable structure while running your tp prog.
- Check the 'fanucpy' documentation if something is already implemented...
best regards
-
I am using a socket connection to call this Karel routine for executing the tp program. So, when the tp program fails, I want the karel routine to throw an error so that the socket connection can be closed. Currently, the socket connection stays stuck in the karel routine and is not disconnected.
-
Hi krgaurav22,
I think you should abstract the code more:
- one Karel prog for communication with python prog(socket messaging is always blocking...)
- this program only does communication and forwards commands to another prog
- a second karel prog which can process commands etc. and then starts (indirect) other programs if necessary, sets string registers and reacts on errors in the system and sends them back to the first prog, and this again to the python prog
- a TP program as "main prog"($TP_DEFPROG) which starts e.g. motion programs via SR.
: CALL SR[1]; -- SR[1] is set by karel prog
best