FB PSPS is a widely used user process detection condition application core application: 1. Detect variable change FB PSPS = ....... 2. Trajectory operating conditions wait for FB_STOP () 3. Trajectory step waits for FB_CHECK () Example analysis: FOLD PTP VB=100% VE=100% ACC=100% RobWzg=2 Base=0 SPSTrig=0[1/100s] P ;%{P}%MKUKATPVW, %CMOVE8, %VPTP, %P 1:1, 2: VB=,3:100, 4:%, 5: VE=, 6:100, 7:%, 8: ACC=, 9:100, 10:%, 11: RobWzg=, 12:2, 13: Base=, 14:0, 15: SPSTrig=, 16:0, 17:[1/100s], 18: P, 19:3, 20:-1, 21:3 FOLD 1: FB PSPS = M2 & M30 & M32 & M34 & M35 & M37 & E74 & E77 ; %{SE}%MKUKATPVW %CVW_SPS %VFBPSPS %P 2: FB PSPS = M2 & M30 & M32 & M34 & M35 & M37 & E74 & E77,3: FBPSPS ;ENDFOLD ;FOLD {H} VW_MPARA_ACT=P3_D Act_P1 = P3 Act_P2 = P3 VW(#MPARA,TRUE) SPS_FERTIG=FALSE TRIGGERWHENDISTANCE=1 DELAY=0 DO SPS_TRIG(10003)PRIO=-1 PTP P3 C_PTP C_VEL $ADVANCE=1 - 1 block ahead of execution ;ENDFOLD ;ENDFOLD FOLD PTP VB=100% VE=100% ACC=100% RobWzg=2 Base=0 SPSTrig=0[1/100s] P ;%{P}%MKUKATPVW, %CMOVE8, %VPTP, %P 1:1, 2: VB=,3:100, 4:%, 5: VE=, 6:100, 7:%, 8: ACC=, 9:100, 10:%, 11: RobWzg=, 12:2, 13: Base=, 14:0, 15: SPSTrig=, 16:0, 17:[1/100s], 18: P, 19:4, 20:-1, 21:4 FOLD 1: FB PSPS = M2 & M30 & M32 & M34 & M35 & M37 & E74 & E77 ;%{SE}%MKUKATPVW %CVW_SPS%VFBPSPS %P 2:FB PSPS = M2 & M30 & M32 & M34 & M35 & M37& E74 & E77,3: FBPSPS ;ENDFOLD ;FOLD {H} VW_MPARA_ACT=P4_D Act_P1 = P4 Act_P2 = P4 VW(#MPARA,TRUE) SPS_FERTIG=FALSE TRIGGERWHENDISTANCE=1 DELAY=0 DO SPS_TRIG(10004)PRIO=-1 PTP P4 C_PTP C_VEL $ADVANCE=1 That is, the SPS_TRIG (10004) program is executed when P4 is reached during the movement from P3 to P4. The FB_CHECK() program mainly waits at the fixed point after changing the value of $CYCFLAG[254]. VALCYCFL30=$CYCFLAG[254] $CYCFLAG[254]=($CYCFLAG[2] AND$CYCFLAG[30] AND $CYCFLAG[32] AND $CYCFLAG[34] AND $CYCFLAG[35] AND$CYCFLAG[37] AND $IN[74] AND $ IN[77]) AND $CYCFLAG[255] OR ($TIMER[61]<0) VW (#FB_CHECK, TRUE) is executed after reaching the trace bit ;ENDFOLD DEF FB_CHECK () IF $CYCFLAG[254] AND ($TIMER[61]<0) THEN has M254 temporarily suspend exercise after exercise BRAKE IF $PRO_MODE<>#BSTEP THEN program mode is not a single step WAITFOR ($TIMER[61]>0) ENDIF ENDIF $LOOP_CONT=TRUE is used to activate the simulated precondition value 1, confirming that the simulation has ended. WAITFOR $CYCFLAG[254] OR ( NOT ($LOOP_CONT) AND ($MODE_OP<>#EX)) - Wait for M254 or perform a simulation, not when the external is automatic. $LOOP_CONT=TRUE Analog Command Shutdown END The procedure for stopping the control while moving from point to point is the interrupt instruction FB_STOP: INTERRUPTDECL 10 WHEN $CYCFLAG[254]==FALSE DO VW(#FB_STOP,TRUE) DEF FB_STOP () Executes during robot execution trajectory INT INT_N BOOL EXIT_OK BOOL IN_APO_1 IN_APO_1= NOT (($MOVE_STATE==#PTP_AP02) OR ($MOVE_STATE==#LIN_AP02) OR ($MOVE_STATE==#CIRC_AP02)) $MOVE_STATE The current movement status point to point, straight line, arc IN_APO_1 Check if the current movement status is incorrect IF((IN_APO_1) OR (NOT SEARCH_ACTIV))THEN $VW_FB_HOLD=TRUE ENDIF IF $PRO_MOVE THEN - The program is in the running state - BRAKE -- exercise stopped -- ENDIF --- Used for analog control -- FB_STATE.APO_2= NOTIN_APO_1 FB_STATE.N=FB_STATE.N+1 FB_STATE.HOLD=$VW_FB_HOLD FB_SAVE_MSG () saves the last simulated message FB_LOOP_MSG () writes linkage information for simulation use $LOOP_CONT=TRUE ----- request can simulate ---- EXIT_OK=FALSE REPEAT until loop instruction ----- Analog Control --- WHILE NOT ($CYCFLAG[254] OR ( NOT ($LOOP_CONT) AND ($MODE_OP<>#EX))) - Analog button pressed when there is no M254 chain condition or when it is not externally automatic IF($LOOP_MSG[1]==" ") AND ($LOOP_MSG[2]==" ") AND ($LOOP_MSG[3]==" ")THEN FB_LOOP_MSG () ------------ Prompt wait information for simulation - Write prompt in simulation information WAITSEC 0.1 IF($LOOP_MSG[1]==" ") AND ($LOOP_MSG[2]==" ") AND ($LOOP_MSG[3]==" ") THEN ------------ IF Not prompting for writing information prompts "Waiting to close FB password number" $LOOP_MSG[]="KeyWord_WarteFBAus " ENDIF ENDIF IF $PRO_MOVE THEN ------ program running BRAKE ------------Pause to move IF NOT $ON_PATH THEN --------- Not on track PTP $AXIS_ACT to the robot's current axis position ENDIF ENDIF IF $PRO_MODE1==#BSTEP THEN-----If program mode is changed to single step ;RETURN control instruction ENDIF WAITSEC 0.001 ENDWHILE When instruction loop IF NOT $LOOP_CONT THEN Activate analog command if simulation activates $LOOP_CONT=FALSE $CYCFLAG[254]=TRUE M254 is forced to set FOR INT_N=1 TO 8 Use loop statements IF NOT $IN[VW_VERR[INT_N].IN] THEN If the input E4081, which is always 1, is not 1, then it is set to a value of 1. VW_VERR[INT_N].IN=$IOSYS_IN_TRUE $IOSYS_IN_TRUE will set the number of variables to be set VW_VERR[INT_N].NAME[]="SIMU " ----- Prompt Simulation ENDIF ENDFOR WRITE_VERR_COND (FALSE) ----- close the chain control condition M255 so that it can be changed EXIT_OK=TRUE ------Can exit $LOOP_CONT=TRUE --- End of Simulation -- ELSE - No words to simulate you $TIMER[62]=-150 After 150 updates the information to see if there is a change in the chain conditions $TIMER_STOP[62]=FALSE WHILE NOT ( NOT $CYCFLAG[254] OR ($TIMER[62]>0)) ENDWHILE IF $TIMER[62]>0 THEN $TIMER_STOP[62]=TRUE EXIT_OK=TRUE ELSE ENDIF ENDIF WAITSEC 0.001 UNTIL EXIT_OK end loop $LOOP_CONT=TRUE FB_LOAD_MSG () Clears the information for simulation when the linked condition is met WAITSEC 0.024 $VW_FB_HOLD=FALSE END Basic knowledge: TRIGGER WHEN DISTANCE= Position DELAY=Time DO Instruction Trigger position: Specifies at which point the command is triggered. Possible values: ï® 0: The instruction is triggered at the beginning of the action statement. ï® 1: The instruction is triggered at the target point. If the target point is a trajectory approximation, the instruction will be The trajectory is triggered at the midpoint of the arc. Time: This determines the delay time for the selected location ï® positive and negative values ​​can be applied 时间 Time is expressed in milliseconds (ms) ï® 10,000,000 ms and below can be applied without any problem 最 When the time value is too large or too late, the oldest or earliest will be switched at the switching limit. Nantong Boxin Electronic Technology Co., Ltd. , https://www.ntbosen.com