Hello everyone,
I'm currently programming a FANUC robot with R-30iB Plus controller and I would like to ask for your advice on how to get around the following situation:
note: The following examples are not the real programs under development, this are just simple test programs to represent and explain the situation.
As an example, I have a main program moving indefinitely between two point (i.e. A: Home Position and B: Pick Position).
I also start a condition monitoring at the beginning to check for a sensor -> The idea is, if the sensor signal is lost (i.e. part dropped), do something...
MAIN_TEST
01: !MAIN TEST
02:
03: MONITOR COND_MON
04:
05: LBL[1]
06:L P[1:@HOME] 100mm/sec FINE
07:L P[2:@PICK] 100mm/sec FINE
08: JMP LBL[1]
Condition monitoring program is very simple, just check for sensor signal OFF, if so, call program to take actions.
COND_MON
Here's where I need some help... What I want to do is to stop (no abort) the current robot motion as soon as the sensor signal is lost:
I first send the error code to an external EtherNET HMI so It can display the correct error screen with it's corresponding error correction options, then I wait for the operator to select the desired option (i.e. Drop Part, Ignore, Retest, etc).
note: I know a similar decision logic can be done via "Menu Utility" but it needs to be done this way (External HMI via EtherNET), not from the TP screen.
During this time, the robot motion must remain stopped but the logic running, waiting for the operator selection plus executing the upcoming corrective actions.
I started to look for different options to stop the motion and found that setting "$MCR_GRP[1].$HOLD" TRUE interrupts/holds the motion immediately and clearing "$MCR_GRP[1].$HOLD" FALSE resumes the motion.
ACTION_PROG
01: !ACTION PROGRAM TEST
02: GO[1:FAULT CODE]=10
03:
03: !HOLD MOTION SOMEHOW...
04: $MCR_GRP[1].$HOLD=1
05:
05:
06: !WAIT FOR OPERATOR SELECTION
07: WAIT (DI[65:"F1"] OR DI[66:"F2"])
08:
09: IF (DI[65:"F1"]) THEN
10: !ACTION IF "F1" SELECTED...
11: ENDIF
12:
13: IF (DI[66:"F2"]) THEN
14: !ACTION IF "F2" SELECTED...
15: ENDIF
15:
16:
03: !RELEASE MOTION SOMEHOW...
04: $MCR_GRP[1].$HOLD=0
03:
05:
05: LBL[99]
05: GO[1:FAULT CODE]=0
03: MONITOR COND_MON
Display More
The problem is that after the $HOLD variable is set back to FALSE, it correctly resumes the previously interrupted motion (finishes the point) but it does not continue with the next line in the main program and stays there...
So for example, if the sensor signals goes OFF while executing "L P[1:@HOME] 100mm/sec FINE" instruction, it will hold motion as soon as "$MCR_GRP[1].$HOLD" is set TRUE and it will resume motion and finish the point (reach @HOME) after "$MCR_GRP[1].$HOLD" is set back to FALSE, but it will not continue with the following line "L P[2:@PICK] 100mm/sec FINE" or loop.
As you can see on the following image, the program flow already returned to Main program (after sensor went off and corrective actions were taken) and the robot reached @HOME ("$MCR_GRP[1].$HOLD=0") but it stays on line 6 forever, even when the TP says that the program is running and all the status seem to be OK...
I just picked $HOLD variable as it does (kind of) what I try to archive, but the real questions would be:
1. I'm I missing something to make the program run again after $HOLD variable was set back to FALSE and held motion finished? (current approach).
2. Is there any other way (any other variable, any other signal) that I can use to also hold/stop/interlock the robot motion until I give release back?
note: I tried using UI[6] *HOLD signal to stop motion as soon as PLC receives GO[1:FAULT CODE] but that would trigger "HOLD signal from UOP Lost" alarm on the TP, requiring me to reset and hit start again, not desired... I just need to hold current motion, present situation on HMI, operator press an option, and motion continues, no reset, no start, just continue...
3. Is there a way to just hold motion with UI[6] *HOLD signal without an actual alarm being displayed?
I was also thinking on running this "WAIT FOR OPERATOR SELECTION" logic separately via RUN or BGLOGIC with "Ignore pause = TRUE" option so it could run even after a PAUSE instruction gets triggered from ACTION_PROG (stopping motion too) but I would now need a way to resume the program VIA SOFTWARE without an actual start button hit..
4. Is there a way (a variable or something) to resume programs execution after a PAUSE instruction was used that I can write to?
5. Or based on what I'm trying to archive, do you have any other recommendation to get around this situation?
Thanks a lot in advance for your reply!
Regards!
Hugo.