BASIC commands
PROGRAMMING MANUAL
126
Revi
si
on 3.0
3.2.214 PSWITCH
/i
Bit
Value
Description
0
0
Failed configuration of I/O data exchange
1
I/O data exchange configured successfully
1
0
I/O data not available
1
I/O data available
2
0
Data exchange active in OPERATE mode
1
Data exchange active in CLEAR mode
Type
I/O command
Syntax
PSWITCH(switch, enable [ , axis, output_number, output_state,
set_position, reset_position ])
Description
The
PSWITCH
command turns on an output when a predefined position is
reached, and turns off the output when a second position is reached. The
positions are specified as the measured absolute positions.
There are 16 position switches each of which can be assigned to any axis.
Each switch is assigned its own on and off positions and output number.
The command can be used with 2 or all 7 arguments. With only 2 arguments a
given switch can be disabled.
PSWITCH
s are calculated on each servo cycle and the output result applied
to the hardware. The response time is therefore 1 servo cycle period approxi-
mately.
Note: An output may remain on if it was on when the
PSWITCH
was turned
off. The
OP
command can be used to turn off an output as follows:
PSWITCH(2,OFF) OP(14,OFF) ' Turn OFF pswitch controlling OP 14
Note: The physical switches that are used with
PSWITCH
are not fast hard-
ware switches, so switching is done by software, which can introduce some
small delays in operation. Fast hardware switching can be used only with axes
connected via the TJ1-FL02. Use the
HW_PSWITCH
command.
Arguments
•
switch
The switch number. Range: [0,15].
•
enable
The switch enable. Range: [on, off].
•
axis
The number of the axis providing the position input.
•
output_number
The physical output to set. Range: [8,31].
•
output_state
The state to output. Range: [on, off].
•
set_position
The absolute position in user units at which output is set.
•
reset_position
The absolute position in user units at which output is reset.
I52E-EN-03.book Seite 126 Freitag, 29. Juni 2007 11:55 11