8-58 Trio BASIC Commands
Input / Output Commands
Trio Motion Technology
Example:
PRINT#10,"SPEED=";SPEED[6,1];
PSWITCH
Type:
Command
Syntax:
PSWITCH(sw,en,[,axis,opno,opst,setpos,rspos])
Description:
The
PSWITCH
command allows an output to be fired when a predefined position is
reached, and to go OFF when a second position is reached. There are 16 (8 on
MC202) position switches each of which can be assigned to any axis, and can be
assigned ON/OFF positions and OUTPUT numbers.
Multiple PSWITCH’s can be assigned to a single output. The result on the output will
be the OR of the position switches and the standard BASIC OP setting.
The command must be used with all 7 parameters to enable a switch, just the first
2 parameters are required to disable a switch.
Parameters:
7 RS-232 port A - channel 7
8 RS-232 port A - channel 8 - reserved for use by Motion Perfect
9 RS-232 port A - channel 9 - reserved for use by Motion Perfect
10..24 send text string to fibre optic network node 1..15
n: Output device:-
sw:
The switch number in the range 0..15
en:
Switch enable -
1 or ON to enable software
PSWITCH
0 or OFF to disable
PSWITCH
3 to enable hardware
PSWITCH
(hardware PSWITCH can only be used with a P242 daughter board
axis:
Axis number which is to provide the position input in the range
0..number of axes on the controller. For a hardware
PSWITCH
it should
be set to the axis slot number.
opno:
Selects the physical output to set, should be in range 8..31. For a hard-
ware
PSWITCH
it should be set to 0..3.