Example program for Automatic External mode without PLC
&ACCESS RVO &REL 19 &PARAM EDITMASK = * &PARAM TEMPLATE = C:\KRC\Roboter\Template\ExpertSubmit DEF auto_ext( ) LOOP IF $MODE_OP==#EX THEN IF E_START THEN ; mit dem Flag E_Start wird die Zustandsmaschine gestartet EXT_RUN() ELSE EXT_STOP() ENDIF ENDIF ; Handverfahren IF $MODE_OP==#T1 THEN ROB_STOP_RELEASE() ENDIF E_START_ALT = E_START ; FLANKE erkennen IF E_RESET AND ($MODE_OP==#EX) THEN EXT_RESET() ENDIF ENDLOOP END
DEF EXT_RUN() bool ret ROB_STOP_RELEASE() A_MOVE_ENABLE=TRUE IF $PRO_STATE1==#P_ACTIVE THEN ; Programm läuft ereits RETURN ENDIF IF $USER_SAF AND $ALARM_STOP AND ($MODE_OP==#EX) THEN IF NOT $PERI_RDY AND NOT A_DRIVES_ON THEN ; ANTRIEBE EINSCHALTEN PULSE(A_DRIVES_ON,TRUE,0.2) ELSE IF $STOPMESS AND NOT A_CONF_MESS THEN ; FEHLER QUITTIEREN PULSE(A_CONF_MESS,TRUE,0.2) ELSE IF NOT $PRO_ACT AND NOT A_EXT_START AND NOT $STOPMESS THEN ; EXTERN START PULSE(A_EXT_START,TRUE,0.2) ENDIF ENDIF ENDIF IF $STOPMESS AND NOT A_CONF_MESS THEN ; FEHLER QUITTIEREN PULSE(A_CONF_MESS,TRUE,0.1) ENDIF ENDIF END
DEF EXT_STOP() bool ret ret = Rob_stop(#RAMP_DOWN) ; PLC_ROB_STOP() END
DEF EXT_RESET()
DECL STATE_T STAT DECL MODUS_T MODE IF ($PRO_STATE1 <> #P_RESET) AND ($PRO_STATE1 <>#P_FREE) THEN CWRITE($CMD,STAT,MODE,"reset 1") ENDIF
Necessary cookies are required to help a website usable by enabling core functions and access to secure areas of the website. The website cannot be function properly without these cookies and they are enabled by default and cannot be disabled.
Analytics cookies help website to understand how visitors interact through the website. These cookies help to improve user experiences by collecting and reporting information.
Marketing cookies are used to track visitors across websites to display relevant advertisements for the individual user and thereby more valuable for publishers and third party advertisers.
&ACCESS RVO
&REL 19
&PARAM EDITMASK = *
&PARAM TEMPLATE = C:\KRC\Roboter\Template\ExpertSubmit
DEF auto_ext( )
LOOP
IF $MODE_OP==#EX THEN
IF E_START THEN ; mit dem Flag E_Start wird die Zustandsmaschine gestartet
EXT_RUN()
ELSE
EXT_STOP()
ENDIF
ENDIF
; Handverfahren
IF $MODE_OP==#T1 THEN
ROB_STOP_RELEASE()
ENDIF
E_START_ALT = E_START ; FLANKE erkennen
IF E_RESET AND ($MODE_OP==#EX) THEN
EXT_RESET()
ENDIF
ENDLOOP
END
DEF EXT_RUN()
bool ret
ROB_STOP_RELEASE()
A_MOVE_ENABLE=TRUE
IF $PRO_STATE1==#P_ACTIVE THEN ; Programm läuft ereits
RETURN
ENDIF
IF $USER_SAF AND $ALARM_STOP AND ($MODE_OP==#EX) THEN
IF NOT $PERI_RDY AND NOT A_DRIVES_ON THEN ; ANTRIEBE EINSCHALTEN
PULSE(A_DRIVES_ON,TRUE,0.2)
ELSE
IF $STOPMESS AND NOT A_CONF_MESS THEN ; FEHLER QUITTIEREN
PULSE(A_CONF_MESS,TRUE,0.2)
ELSE
IF NOT $PRO_ACT AND NOT A_EXT_START AND NOT $STOPMESS THEN ; EXTERN START
PULSE(A_EXT_START,TRUE,0.2)
ENDIF
ENDIF
ENDIF
IF $STOPMESS AND NOT A_CONF_MESS THEN ; FEHLER QUITTIEREN
PULSE(A_CONF_MESS,TRUE,0.1)
ENDIF
ENDIF
END
DEF EXT_STOP()
bool ret
ret = Rob_stop(#RAMP_DOWN) ; PLC_ROB_STOP()
END
DEF EXT_RESET()
DECL STATE_T STAT
DECL MODUS_T MODE
IF ($PRO_STATE1 <> #P_RESET) AND ($PRO_STATE1 <>#P_FREE) THEN
CWRITE($CMD,STAT,MODE,"reset 1")
ENDIF
END