66
F i n d I / O S w i t c h S a m p l e
This sample program will have a section that defines the parameters for the I/O
and motion outside of the program. To use this program, three switches must be
placed between I/O lines 21, 22, 23 and I/O GND. This program will set up
three inputs: GO, STOP and a HOME switch. When executed by the GO
switch the motor will seek the HOME input. When the HOME switch is
pressed it will set the position counter to 0. The program will the run the mo-
tion profile.
'********PARAMETERS*******
MUNIT=51200/1000
'set munits to 1000 steps/rev
IOS 21=9,0,0
'set i/o 21 as GO input, active low
IOS 22=10,0,0
'set i/o 22 as STOP input, active low
IOS 24=12,0,0
'set i/o 24 as HOME input, active low
VM=20
'set the maximum velocity to 20 munits/sec
VI=1
'set the initial velocity to 1 munit/sec
'*******PROGRAM *********
PGM 1
'start program at line 1
LBL PROG
'label the program PROG_1
FIOS
'find home switch
HOLD 2
'suspend program until motion completes
POS=0
'set position register to 0
MOVA 1000
'index absolute 1000 steps
HOLD 2
'suspend program until motion completes
DELAY 2000
'wait 2 seconds
MOVA 0
'index to absolute position 0
HOLD 2
'suspend program until motion completes
DELAY 2000
'wait 2 seconds
END
PGM
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from