![background image](http://html1.mh-extra.com/html/omron/sysmac-cj-series/sysmac-cj-series_operation-manual_743585182.webp)
All BASIC commands
Section 4-2
170
4-2-128 HW_PSWITCH
/i
Example
PRINT#5,HEX(IN(8,16))
See also
N/A
Type
Axis command
Syntax
HW_PSWITCH(mode, direction, opstate, table_start, table_end)
Description
The
HW_PSWITCH
command turns on digital output 8 for the axis
when the predefined axis measured position is reached, and turns the
output off when another measured position is reached. Positions are
defined as sequence in the TABLE memory in range from
table_start
,
to
table_end
, and on execution of the
HW_PSWITCH
command are
stored in FIFO queue.
This command is applicable only to Flexible axis axes with
ATYPE
val-
ues 43, 44 and 45.
The command can be used with either 1 or 5 parameters. Only 1 param-
eter is needed to disable the switch or clear FIFO queue. All five param-
eters are needed to enable switch.
After loading FIFO and going through the sequence of positions in it, if
the same sequence has to be executed again, FIFO must be cleared
before executing
HW_PSWITCH
command with the same parameters.
Arguments
•
mode
0 = disable switch; 1 = on and load FIFO; 2 = clear FIFO.
•
direction
0 = decreasing; 1 = increasing.
•
opstate
Output state to set in the first position in the FIFO; ON or OFF.
•
table_start
Starting TABLE address of the sequence.
•
table_end
Ending TABLE address of the sequence.
Example
HW_PSWITCH(1, 1, ON, 21, 50)
This command will load FIFO with 30 positions, stored in TABLE mem-
ory starting from
TABLE(21)
in increasing direction. When the position
stored in
TABLE(21)
is reached, output 8 will be set ON and then alter-
natively OFF and ON on reaching following positions in the sequence,
until the position stored in
TABLE(50)
reached.
Example
HW_PSWITCH(0)
This command will disable switch if it was enabled previously, but will
not clear the FIFO queue.
Example
HW_PSWITCH(2)
This command will clear FIFO queue if loaded previously.
See also
AXIS
Содержание SYSMAC CJ Series
Страница 2: ......
Страница 70: ...Specifications Section 2 4 58...
Страница 84: ...FINS commands Section 3 4 72...
Страница 148: ...All BASIC commands Section 4 2 136 AXIS 1 AXIS 0...
Страница 277: ...Section 265 SECTION 5 Examples This chapter gives 2 categories of examples and tips How to s Practical examples...
Страница 370: ...Section 358...