Manual – IPOSplus®
307
23
Bit commands
Assembler – Commands
23.4 Bit commands
23.4.1 Bit commands BSET/BCLR/BMOV/BMOVN
BSET/BIT SET
The BSET command sets a bit within a variable to 1. The bit places in the variable have
the numbers 0 ... 31. The least significant bit has the number 0.
For example, if a bit is set in the system variable H481 STD.OUT IP, a binary output can
be set directly. You must set the output to IPOS OUTPUT in parameters P62x in SHELL
beforehand.
BCLR/BIT CLEAR
The BCLEAR command sets a bit within a variable to 0. The bit places in the variable
have the numbers 0 ... 31. The least significant bit has the number 0.
For example, if a bit is cleared in the system variable H481 STD.OUT IP, it resets a bi-
nary output directly. You must set the output to IPOS OUTPUT in parameters P62x in
SHELL beforehand.
BMOV/BIT MOVE
The BMOV command copies a bit from one variable in a bit in another variable. The bit
places of a variable have the numbers 0 ... 31. The least significant bit has the number 0.
Command structure
Mxxx BSET HX1.X2 = 1
Mxxx: Label (optional)
X1: Target variable
X2: Bit position in a target variable
BSET HXX.YY = 1
In variable HXX, bit YY is set to 1.
Example
SHELL: P621 = IPOS OUTPUT
BSET H481.2 = 1
After the BSET command has been performed, the 3rd bit is set in variable
H481 and output DO02.
Note
If the output is reserved for a different function (for example, P621 =
MOTOR STANDSTILL), the bit is set in H481, but not the binary output.
Command structure
Mxxx BCLEAR HX1.X2 = 1
Mxxx: Label (optional)
X1: Target variable
X2: Bit position in a target variable
BCLEAR HXX.YY = 0
In variable HXX, bit YY is set to 0.
Example
SHELL: P621 = IPOS OUTPUT
BCLEAR H481.2 = 0
After the BCLEAR command has been performed, the 3rd bit is cleared in
variable H481 and output DO02.
Note
If the output is reserved for a different function (for example, P621 =
MOTOR STANDSTILL), the bit is cleared in H481, but not the binary out-
put.
Command structure
Mxxx BMOV HX1.X2 =
HX3.X4
Mxxx: Label (optional)
X1: Target variable
X2: Bit position in a target variable
X3: Source variable
X4: Bit position in a source variable
BMOV HXX.YY = HZZ.AA
In variable HXX, the bit YY is set to the value of bit AA of the variable HZZ.
Example 1
BMOV H2.4 = H7.5
The command copies bit 5 of variable H7 into bit 4 of variable H2.
Example 2
SET H200 = 0BMOV H200.0 = H473.20JMP H200 == 1 M01
The program jumps to the label M01 when the drive is referenced (H473
STAT. WORD).
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n