![background image](http://html1.mh-extra.com/html/omron/sysmac-cj-series/sysmac-cj-series_operation-manual_743585336.webp)
Practical examples
Section 5-2
324
GOSUB start_app
status_word=3 'Application running
ENDIF
IF stop_bit=1 AND status_word=3 THEN
PRINT "Stop by command"
GOSUB stop_all
status_word=1
ENDIF
ENDIF
'Evaluates rising edge in RUN, STOP & RESET bits
GOSUB sequence
'Checks for alarms in the system and monitors the
'system status
GOSUB alarm_sequence
'Upgrade values for showing in the HMI & PLC
GOSUB monitoring
'Reports and reset warnings in servodrive
GOSUB warning_seq
GOTO loop
'--------------------------------------------------------
sequence:
'Define here your signals to STOP/START/RESET
'This example uses the following signals:
'Rising edge of bit 0 of VR(signal_state) as RUN signal
'Rising edge of bit 1 of VR(signal_state) as STOP signal
'Rising edge of bit 2 of VR(signal_state) as RESET signal
'RUN
run_ant=run_act
run_act=READ_BIT(0,signal_state)
run_bit=run_act AND NOT run_ant
'STOP
stop_ant=stop_act
stop_act=READ_BIT(1,signal_state)
stop_bit=stop_act AND NOT stop_ant
'RESET
res_ant=res_act
res_act=READ_BIT(2,signal_state)
res_bit=res_act AND NOT res_ant
RETURN
'--------------------------------------------------------
Содержание SYSMAC CJ Series
Страница 2: ......
Страница 70: ...Specifications Section 2 4 58...
Страница 84: ...FINS commands Section 3 4 72...
Страница 148: ...All BASIC commands Section 4 2 136 AXIS 1 AXIS 0...
Страница 277: ...Section 265 SECTION 5 Examples This chapter gives 2 categories of examples and tips How to s Practical examples...
Страница 370: ...Section 358...