BASIC commands
PROGRAMMING MANUAL
164
R
e
vi
si
o
n
1
.0
/i
3.2.234 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
Arguments
•
unit_number
Specifies the unit number of the TJ1-PRT in the Trajexia system.
•
VR_start_outputs
The starting address in VR memory of the controller where the output
data from the PROFIBUS-DP master is located.
•
no_outputs
The number of output words from the PROFIBUS-DP master in VR
memory.
•
VR_start_inputs
The starting address in VR memory of the controller where the input data
for the PROFIBUS-DP master is located.
•
no_inputs
The number of input words to the PROFIBUS-DP master in VR memory.
Example
PROFIBUS (0,2,1,10,16,150,31)
In this example, the TJ1-PRT is configured to exchange data with PROFI-
BUS-DP master with 16 output words (received from the master) located at
VR(10) to VR(25), and 31 input words (sent to the master) located at VR(150)
to VR(180).
See also
N/A
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 has 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 disa-
bled. In such cases the
OP
command can be used to turn off an output as fol-
lows:
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.