Resume program at certain layer after fault

So we use the ur10e to pack cones for us. The robot picks up cones then places them on a tray. It then picks again and then goes up in stack height about 23mm then places the cones at a different layer. Basically a pick and place that indexes up 23mm for 17loops then starts over. The way we run these therebis potential to crash and fault the robot. My question is "how would i go about having the program ask me what layer or what loop im in to resume from that layer? As of now it’ll clear the tray and start over at one. l regardless of spot in the program. I see the option that says “Start program from beginning” and “resume at line 26: cone pick” but that option doesnt ever work for some reason. And ideas would be great. Thank you guys

There are several ways to achieve this, but if you’re using a loop to loop 17 times, then the simplest should be to make an Assignment in the BeforeStart of your program.
The assignment must be Operator based (popup for operator to input value), and the assignment must edit the loop counter variable.

This will allow you to input which layer, the robot must start from each time the program is resumed.

If this is not how your program is set up, it would be a good idea to attach your program here, so we can have a look at it.

1 Like

The way our program is set up it resets my loop value to 1 everytime after i set it to whatever layer i want to start on. Ill post the program. Our program is kind of a shit show honestly.

Program
Init Variables
BeforeStart
Set ScnZn_1_3_Mute1=On
Set ScnZn_1_3_Mute2=On
Set ScanZn_2_Mute1=On
Set ScanZn_2_Mute2=On
Set PackConv_Start=On
Set Red_Light=Off
Set Green_Light=On
Wait: 0.5
Set ROW_1=Off
Set ROW_2=Off
Set ROW_3=Off
Set ROW_4=Off
Set ROW_5=Off
Set ROW_6=Off
Set ROW_7=Off
Set ROW_8=Off
Set ROW_9=Off
Set ROW_10=Off
Set ROW_11=Off
Set ROW_12=Off
Set Vacuum_1=Off
Set Vacuum_2=Off
Set Vacuum_Blow_1=Off
Set Vacuum_Blow_2=Off
‘Set Diecut_Blow_1=Off’
‘Set Diecut_Blow_2=Off’
Set CoolTwr_Intrlk=Off
Layer≔1
MoveJ
UL_Home
Robot Program
Loop 17 times
MoveJ
Call SubP_Cooling_To
Set ScnZn_1_3_Mute1=Off
Set ScnZn_1_3_Mute2=Off
If SafeScan1_Fault≟ False
Popup: Safety Scanner 1 Fault
If Side_Push≟ False
stopj(3)
Wait: 0.01
Wait Side_Push≟ True
Stack
ConStck_StrtPos
Direction
DirFrom_Pos
DirTo_Pos
PlaceSequence
Set ScanZn_2_Mute1=On
Set ScanZn_2_Mute2=On
ConDrop_StrPos
Set Payload: Payload
Set ROW_1=Off
Set ROW_2=Off
Set ROW_3=Off
Set ROW_4=Off
Set ROW_5=Off
Set ROW_6=Off
Set ROW_7=Off
Set ROW_8=Off
Set ROW_9=Off
Set ROW_10=Off
Set ROW_11=Off
Set ROW_12=Off
ConDrop_ExitPos
Wait: 0.15
Set ScanZn_2_Mute1=Off
Set ScanZn_2_Mute2=Off
Set ScnZn_1_3_Mute1=On
Set ScnZn_1_3_Mute2=On
Die_cut_perch
Call SubP_AnalogDiec
If analog_in[0]<6.5/1000
Popup: Diecut Magazine Empty FILL UP WHAT ARE YOU WAITING FOR?
Call SubP_Diecut_Des
DieCut_DesPerch
Set ScanZn_2_Mute2=On
Set ScanZn_2_Mute1=On
Set ScnZn_1_3_Mute1=Off
Set ScnZn_1_3_Mute2=Off
Call SubP_Diecut_Dro
Set Layer=Layer+1
MoveJ
Home
Layer≔1
If ConTray_EmptyPE≟ True and ConTray_FullPE≟ False
Set PackConv_Start=On
Else
If ConTray_FullPE≟ True
Popup: Exit Full
Wait ConTray_FullPE=LO
Set PackConv_Start=On
ElseIf ConTray_EmptyPE≟ False
Popup: Infeed Empty
If ConTray_BuildPE≟ True
Set PackConv_Start=On
Thread_3
If SafeScan1_Fault≟ False
Popup: Safety Scanner 1 Fault
If SafeScan2_Fault≟ False
Popup: Safety Scanner 2 Fault
If SafeScan3_Fault≟ False
Popup: Safety Scanner 3 Fault
If analog_in[0]<7/1000
Set Red_Light=Off
Set Green_Light=Off
Set Yellow_Light=On
Popup: Die Cut Magazine Is Low
Wait: 0.75
Set Yellow_Light=Off
Set Green_Light=On
Wait: 0.75
ElseIf analog_in[0]>3.9/1000
Set Green_Light=On
Set Red_Light=Off
Set Yellow_Light=Off
Wait: 0.01
sync()
SubP_AnalogDiec
‘These are the height of the stack(EU) when full and empty In MM’
HighActual≔.303
LowActual≔0
‘These are the analog feedback values(Raw) that match the high and low stack height’
HighAnalog≔20/1000
LowAnalog≔4.0/1000
AnalogValue≔analog_in[0]
StackHeight≔(analog_in[0]-LowAnalog)* ((HighActual-LowActual)/(HighAnalog-LowAnalog)) + LowActual
HeightOffset≔p[0,0,StackHeight,0,0,0]
Wait: 0.01
Event PackConv_Start≟ True
Set Blade_Stop=On
Set Side_Push=Off
Wait ConTray_BuildPE=LO
Wait: 0.15
Set Blade_Stop=Off
Wait ConTray_BuildPE=HI
Wait: 0.1
Set Side_Push=On
Wait: 1.5
Set PackConv_Start=Off
Wait: 2.0
Event PackConv_Start≟ False
Set Blade_Stop=Off
Set Side_Push=On
SubP_Diecut_Dro
Stack
DicutStak_StrtP
Direction
DieCutStk_FromP
DieCutStk_ToP
PlaceSequence
DieCut_DropPos
Set Vacuum_1=Off
Set Vacuum_2=Off
Set Vacuum_Blow_1=HI:Pulse 0.5
Set Vacuum_Blow_2=HI:Pulse 0.5
Set ScnZn_1_3_Mute2=On
Set ScnZn_1_3_Mute1=On
Set ScanZn_2_Mute1=Off
Set ScanZn_2_Mute2=Off
Wait: 0.35
DiCut_DrpExtPos
SubP_Diecut_Des
MoveL
Set Vacuum_1=On
Set Vacuum_2=On
If Layer_Shift_UP≟ False
PicPosition≔pose_add(HeightOffset,Bottom_of_Diecu)
PicPosition
Wait: 0.05
DieCut_Fluff≔pose_add(PicPosition, p[0,0,0.055,0,0,0])
DieCut_Fluff
Wait: 0.2
Else
‘This is the zero position to calculate pick height’
Bottom_of_Diecu
SubP_Cooling_To
MoveJ
UL_Home
MoveL
Set ScnZn_1_3_Mute1=On
Set ScnZn_1_3_Mute2=On
Set ScanZn_2_Mute1=On
Set ScanZn_2_Mute2=On
CoolTwr_Perch
Wait CoolTwr_ConPres=LO
Wait CoolTwr_ConPres=HI
Wait CoolTwr_Stopped=HI
Set CoolTwr_Intrlk=On
Cone_Pick
Set Payload: Payload_Cones
Set ROW_1=On
Set ROW_2=On
Set ROW_3=On
Set ROW_4=On
Set ROW_5=On
Set ROW_6=On
Set ROW_7=On
Set ROW_8=On
Set ROW_9=On
Set ROW_10=On
Set ROW_11=On
Set ROW_12=On
Wait: 0.05
PerchBfr_EdgTwr
Set CoolTwr_Intrlk=Off
Set ScanZn_2_Mute2=Off
Set ScanZn_2_Mute1=Off
Edge_Of_Tower

Can you upload the .urp and .installation instead? Much easier to look into. :slight_smile:
It can be saved to a USB simply by inserting the USB drive into the Teach Pendant and saving the program as.

Here is URP file. It doesn’t let me attach the installation file.

Haas_W_48Cnt.urp (7.9 KB)

Your program isn’t using the Layer variable to determine layer height. I’m not sure what that Layer variable is for. :slight_smile:
The Loop uses the Loop_1 variable, as you can tell, if you highlight the Loop function.

As I suggested in my first message, you can edit the start layer height by changing the loop counter variable (Loop_1). Could look something like this:
image

First a variable to ask the operator a Yes or No to change the layer. If yes, then another Operator-based variable that changes Loop_1 to a number between 1 and 17.

Yes that is what I tried before. For some reason the loop_1 gets reset back to 0 after inputting the number. I see the actual variable change to the number i specified but goes to 0 right after

Ok so just figured out how to keep Loop_1 variable. Problem now is that height doesnt adjust according to the layer I input. It still goes down to the first drop at the very bottom. There is other stuff i have to change to acount for that now.

That’s my bad. Of course there is. :slight_smile:
The stacking (Seek) counts up for each placed part. I haven’t actually looked into that template before, but it seems like it’s using a variable named Interpolate_1 (in my test program). You can see it raises itself by the height of your part for each loop.
So you’ll have to set this variable to the correct height, when you set the Loop variable. Such as:
image

You might have to use Interpolate_2 instead of Interpolate_1. Best is to run your program to check, which is used.
0.0195 is your part height set in the Stacking command in meters instead of mm.
You might also have to add or subtract one part height for it to work. You’ll have to give it a run and see.

Ok I see. I never knew what the interpolate variable was. I added that but i still cant figure out the loop counter. Keeps resetting. The way had it not reset didnt actually count the loop after. I think im having to change way more things. Interpolate2 is the stack for the diecut so that needs to change also. This thing is kicking my butt haha