Display MoreYou are likelly missing the DO update betwheen PLC cycle scans and I/O updates, every BGlogic loop runs at a minimum of 8ms tick rate, it depends on the controller type, only way to ensure you are executing the bglogic at a minimum of 8ms is to set it to priority hight, if it's on normal it can vary.
And even that way, it seems I/O update time on the robot side is done every 20ms or so (at least with siemens cards), so if a signal changes OFF/ON/OFF on that interval you will not notice on the PLC side.
This is a problem I have right now with a communication I need to do in real time, I've not found a way to transfer I/O changes faster than that even implementing cyclic interrupts on the plc side, the communication is slower than what I need.
Please, provide an example of your normal TP program and also the BGLogic one, in order to help you we need to know how are you handling the movements and I/O changes.
Thanks for the involvement.
Below is a part of PNS program.
11:LBL[1] ;
12: ;
13: R[20:TEST]=100 ;
14: OVERRIDE=R[7:Old_OVR] ;
15: R[20:TEST]=0 ;
16: CALL CONFIRMORDER ;
17: //OVERRIDE=20% ;
18: R[20:TEST]=1 ;
19: SELECT R[1:Work No]=5,CALL RECOVERY_HOME ;
20: =10,CALL PICK_LH_PALLATE ;
21: =20,CALL PICK_RH_PALLET ;
22: =30,CALL WELD_1 ;
23: =40,CALL WELD_2 ;
24: =50,CALL WELD_3 ;
25: =60,CALL WELD_4 ;
26: =70,CALL WELD_5 ;
27: =80,CALL WELD_6 ;
28: =90,CALL WELD_7 ;
29: =100,CALL WELD_8 ;
30: =130,CALL DROP_PARK_STATION ;
31: =140,CALL PICK_PARK_STATION ;
32: =110,CALL DROP_LH_PALLATE ;
33: =120,CALL DROP_RH_PALLATE ;
34: ELSE,JMP LBL[110] ;
35: ;
36: JMP LBL[1] ;
37: ;
38: LBL[110] ;
39: MESSAGE[Wrong Work Nn] ;
40: JMP LBL[1] ;
Now when R[1]=30; WELD_1 program is executed. Below is a part of WELD_1 program.
61:J PR[30:PreWeld1] 85% CNT100 ;
62: R[5:Recover Data]=15 ;
63: ;
64:L PR[31:Weld1] 500mm/sec FINE ;
65: R[5:Recover Data]=16 ;
66: //L P[2] 100mm/sec FINE ;
67: ;
68: //DO[104:OFF:WELD1]=ON ;
69: CALL CONFIRM_POS(67) ;
In CONFIRM_POS program, DO is set. Number of the DO is AR (67 in this case). So DO[67] is set. Now the cursor goes to CONFIRMORDER program as soon as it completes WELD_1. Below is the CONFIRMORDER program.
1: LBL[2] ;
2: ;
3: DO[31:OFF:Action Finish]=ON ;
4: ;
5: WAIT DI[19:OFF:Spare 1]=ON ;
6: ;
7: DO[31:OFF:Action Finish]=OFF ;
8: ;
9: GO[1:5:WORK NO ACK]=0 ;
10: ;
11: DO[26:OFF:Read Prg No]=OFF ;
12: ;
13: DO[28:OFF:Read Work No]=OFF ;
14: ;
15: DO[27:OFF:Wait Work No]=ON ;
16: ;
17: WAIT DI[27:OFF:Work No Valid]=ON ;
18: ;
19: R[1:Work No]=GI[1:0:Work No] ;
20: ;
21: GO[1:5:WORK NO ACK]=R[1:Work No] ;
22: ;
23: DO[28:OFF:Read Work No]=ON ;
24: ;
25: IF R[1:Work No]=0 OR DI[28:OFF:Work No OK]=OFF OR R[1:Work No]=R[4:Last Work No],JMP LBL[2] ;
26: ;
27: DO[27:OFF:Wait Work No]=OFF ;
28: ;
29: DO[28:OFF:Read Work No]=OFF ;
In BG logic program, following is the code.
DO[100:OFF:Robot In Motion]=($MOR_GRP[1].$ROB_MOVE) ;
IF (DO[100:OFF:Robot In Motion]=ON) THEN ;
DO[67:OFF:Weld1]=OFF ;
ENDIF ;
I have also checked by using flags but same result. This works in Manual mode but in Auto mode, when the cursor goes to CONFIRMORDER, output goes off.