Omron SYSMAC CJ Operation Manual page 352

Sysmac cj-series programmable controller motion control unit
Hide thumbs Also See for SYSMAC CJ:
Table of Contents

Advertisement

Practical examples
340
'================================================
'Working with marks, if any mark is missing, feed the
'theoretical distance. But if the mark is missing for
'a number of consecutive bags, stop the operation.
'A digital output is activated a certain time to cut
'the bag.
'================================================
'Variable initialisation
start_signal=7
max_fail=3
program_alarm=0
failed=0
feeder_axis=2
BASE(feeder_axis)
'Position counter (MPOS,DPOS) goes from 0 to 999999
'and 0 again
UNITS=27
SPEED=100
ACCEL=1000
DECEL=1000
REP_DIST=1000000
REP_OPTION=1
SERVO=ON
WDOG=ON
'Main program
loop:
'Define current position as zero
DEFPOS(0)
'Wait for rising edge in Digital Input
'"start_signal"
WAIT UNTIL IN(start_signal)=0
WAIT UNTIL IN(start_signal)=1
'Move bag length
MOVEABS(bag_distance)
WAIT UNTIL MTYPE=2 'To verify that the MOVEABS is
'being executed
'If we work with Mark, activate the trigger
'MARK=FALSE when triggered and TRUE when not triggered
IF work_with_mark AND MARK THEN
REGIST(1)
WAIT UNTIL MARK=0
ENDIF
'Wait until movement finished or mark detected
WAIT UNTIL MTYPE=0 OR (MARK AND work_with_mark)
'Working with mark
IF work_with_mark THEN
IF MARK THEN 'If the mark has been detected, the
'position is corrected
MOVEMODIFY(bag_distance-expected_pos+REG_POS)
Section 5-2

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cj1w-mch72

Table of Contents