I am trying to run following three programs simultaneously I have highlighted the lines which are used for handshaking between the programs. The background programs stops all three programs as soon as it tries to execute line 24 on the background of the Master robot.
Do you guys have any suggestions on where I could be going wrong?
Program 1: (This robot is following the master robot and this program is for its vision)
09:!SETS REG TO ZERO
10:PR[1:VISION 1]=PR[2:ZERO]
11: JMP LBL[55]
13:!FIRST PICTURE PROCESS
17:LBL [11]
18:DO[18:GET OFFSET]=PULSE, 0.5sec
19:WAIT DI[18:GET OFFSET DONE]=ON // This is where it waits for RUN_GETOFSET command to turn DI[18]=ON
:TIMEOUT, LBL[11]
20:VISION GET_OFFSET
:'Robot7.ZM937511' VR[1] JMP LBL
:[99]
21:PR[1]=VR[1].OFFSET
22:L P[2] 1200mm/sec FINE
:Tool_Offset, PR[1:VISION1]
23:LBL[14]
24: WAIT .10(sec)
25:LBL[55]
27:!SECOND PICTURE PROCESS
29:PR[1:VISION 1]=PR[2:ZERO]
30:LBL[13]
31:DO[18:GET OFFSET]=PULSE, 0.5sec
32:WAIT DI[18:GET OFFSET DONE]=ON
:TIMEOUT, LBL[13]
33:VISION GET_OFFSET
:'ROBOT7.ZM937511' VR[1] JMP LBL [99]
34:PR[1]=VR[1].OFFSET
35:L P[3] 1200mm/sec FINE
:Tool_Offset, PR[1:VISION 1]
36:JMP LBL[10]
37:LBL [99]
38:Prompt Box YN(1,30)
39:IF R[30:Home Open]=0, JMP LBL[30]
40:LBL[10]
[END]
Program 2 (Background program on Master robot)
20:WAIT 0.20sec
21:IF R[14:GETOFSET RUNNING]=1
: JMP LBL[30]
22:IF DI[18:GET OFFSET]=OFF,
:JMP LBL[30]
23:R[14]=1
24:RUN GETOFSET // Prog 2 stops on this line 24 When D0[18] gets triggered on program 1, this line should execute, and R=14 is used to avoid run GETOFSET prog twice
25:LBL[30]
Prog 3 GETOFSET on Master robot
1: !This macro takes the value of Master robot (Robot7) R[15] and jumps to label of same value to run
vision for slave robot(Robot 8).
9: SELECT R[15:Rbt 7 Vsn No.]=100, JMP LBL[100] //R[15] value is edited before executing new vision, for this program it is 110
10: = 101, JMP LBL[101]
:
:
:
=301, JMP LBL[301]
69: LBL[110]
70: Vision RUN_FIND ‘ZM937511’
71: DO[18:Get Offset]=PULSE,0.1sec
72: JMP LBL[1]
73: LBL[111]
:
:
:
212: LBL[1: Main Jmp for all]
213:R[14: Getofset Running]=0
[End]
The error I am getting is INTP-267 (Background, 24) RUN stmt failed; Prog-048 Shift released while running. Probably it is trying to run a program which is already running but I am not sure which one that could be, as for GETOFSET sub program R[14] never turns back to zero, so it is not even going in the subprogram.
I would appreciate any help in any direction.
Thank you,