Operation & Software Manual
216
Direct Drives & Systems
Chapter D: Programming
ETEL Doc. - Operation & Software Manual # DSC2P 903 / Ver. F / 3/6/05
14.1.2 Wait on bits: WBS and WBC commands
WBS
(
W
ait
B
it
S
et) and
WBC
(
W
ait
B
it
C
lear) commands test one or several bits of X, K or M registers and go
on with the sequence execution if the bits are set to 1 (WBS) or to 0 (WBC). It is reminded that bits are
numbered from the right to the left from 0 to 31.
The field <P2> must contain the
mask
that selects the bits to be tested in the register included in the field <P1>.
This mask is obtained by transforming in binary the value contained in <P2>. The bits with 1 are those tested
by WBS and WBC.
Here is an example with <P1> corresponding to monitoring M50 (value of the digital inputs). If <P2>=2 then
only bit 1 is tested. If <P2>=513 bit 0 and bit 9 are tested. If <P2>=773 bits 1, 3, 8 and 9 are tested:
Remark:
Refer to §13.4 to know the digital inputs available for each controller.
Example:
WBS and WBC instructions are particularly useful to test the state of one or several digital inputs. For example,
in order to continue the execution of a sequence only if the digital input DIN2 is activated, the following
command will be used :
WBS.1=M50.1,2
;The sequence goes on only when DIN2 is set to 1. It is reminded that every bit of
monitoring M50 represents one of the controller’s digital inputs.
WBS.1=DIN.1,2
;Same effect as above but the alias DIN is used instead of monitoring M50.
Testing various inputs simultaneously by choosing the adequate mask is also possible. For example, the
following command has to be used to continue the sequence when DIN1
and
DIN2 are set to 1:
WBS.1=M50.1,3
;The sequence only goes on when the digital inputs DIN1
and
DIN2 are set to 1.
14.1.3 Wait on values: WPL, WSL, WPG and WSG commands
When the controller meets the
WPL
command (
W
ait
P
arameter
L
ower than), it waits for the register specified
in <P1> to be lower than the value given in <P2> to continue the sequence execution. The
WSL
command
(
W
ait
S
igned
L
ower than) works like the WPL command but in this case the parameters <P1> and <P2> can
be signed.
The
WPG
command (
W
ait
P
arameter
G
reater than) works the same way but the register must be greater than
the value included in <P2> to continue the sequence execution. The
WSG
command (
W
ait
S
igned
G
reater
than) works like the WPG command but in this case the parameters <P1> and <P2> can be signed.
Remark:
This function is not only dedicated to the movements but also to all K, M or X registers. If the
values specified in <P2> are never reached by the chosen register, the pause has an infinite
duration. If the condition is already met when the command is executed, the sequence goes on
immediately.
Command
<P1>
<P2>
Comment
WBS.<axis> = <P1>, <P2>
Register to test
Mask over the bits
Waits for the bits selected in the mask to be set to 1.
WBC.<axis> = <P1>, <P2>
Register to test
Mask over the bits
Waits for the bits selected in the mask to be cleared to 0.
<P2>
values
DIN10
DIN9
-
DIN7
DIN6
DIN5
DIN4
DIN3
DIN2
DIN1
Bit# 9
Bit# 8
-
Bit# 6
Bit# 5
Bit# 4
Bit# 3
Bit# 2
Bit# 1
Bit# 0
2
2
0
0
-
0
0
0
0
0
1
0
513
200
1
0
-
0
0
0
0
0
0
1
773
305
1
1
-
0
0
0
0
1
0
1
Decimal
Hexa.
Binary
Содержание DSC Series
Страница 2: ...THIS PAGE IS INTENTIONALLY LEFT BLANK ...