Hello!
I am working on a project in which 3 different builds can be selected from an HMI. During our last test, but not every time, the robot would repeat the last build regardless of which build was selected. i suspect there might be an issue in the PLC program, but I want to make sure that there's nothing in my code that could be causing it to repeat intermittently.
This is the main program, with each of the three builds having functionally identical subprograms.
1: !HMI Selects Build ;
2: LBL[1] ;
3: IF (DI[19:HOME ROBOT]=ON) THEN ;
4: CALL SAFE_HOME ;
5: ENDIF ;
6: ;
7: IF (UO[8:TP enabled]=OFF) THEN ;
8: OVERRIDE=50% ;
9: ENDIF ;
10: ;
11: IF DI[21:BUILD ROBOT]=ON,CALL ROBOT_BUILD ;
12: IF DI[22:BUILD FIREFIGHTER]=ON,CALL FF_BUILD ;
13: IF DI[23:BUILD WELDER]=ON,CALL WELD_BUILD ;
14: JMP LBL[1] ;
/POS
/END
Display More
1: LBL[999] ;
2: IF DI[24:PICK LEGS]=ON,JMP LBL[1] ;
3: IF DI[25:PICK BODY]=ON,JMP LBL[2] ;
4: IF DI[26:PICK HEAD]=ON,JMP LBL[3] ;
5: JMP LBL[999] ;
6: ;
7: !Calls Leg Pick Program ;
8: LBL[1] ;
9: ;
10: CALL ROBOT_LEGS ;
11: ;
12: IF (DI[27:LEGS PRESENT]=OFF AND R[1]=0) THEN ;
13: R[1]=R[1]+1 ;
14: JMP LBL[1] ;
15: ENDIF ;
16: R[1]=0 ;
17: ;
18: JMP LBL[999] ;
19: ;
20: !Calls Body Pick Program ;
21: LBL[2] ;
22: ;
23: CALL ROBOT_BODY ;
24: ;
25: IF (DI[28:BODY PRESENT]=OFF AND R[1]=0) THEN ;
26: R[1]=R[1]+1 ;
27: JMP LBL[2] ;
28: ENDIF ;
29: R[1]=0 ;
30: ;
31: JMP LBL[999] ;
32: ;
33: !Calls Head Pick Program ;
34: LBL[3] ;
35: ;
36: CALL ROBOT_HEAD ;
37: ;
38: IF (DI[29:HEAD PRESENT]=OFF AND R[1]=0) THEN ;
39: R[1]=R[1]+1 ;
40: JMP LBL[3] ;
41: ENDIF ;
42: R[1]=0 ;
43: ;
44: IF (DI[29:HEAD PRESENT]) THEN ;
45: R[10:ROBOTS MADE]=R[10:ROBOTS MADE]+1 ;
46: JMP LBL[99] ;
47: ENDIF ;
48: ;
49: JMP LBL[999] ;
50: ;
51: LBL[99] ;
52: !Robot @ Home ;
53: CALL SAFE_HOME ;
/POS
/END
Display More
The second program is basically the same as the other "_build" programs, just with different registers and calls. Each part has a "retry" function - lines 25-29, for example - that has the robot try again if it misses the pick or place, then go home if it fails again. That's the only other thing I can think of that might be causing a problem, but as I said above, its not every time.
Any insights are appreciated.
Thanks!