11 - 7 11 - 7
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
B@
Variable
Bit@
• Reads and writes bit information of the expansion relay (EM), general-purpose input (X),
and general-purpose output (Y).
B@ ( <device> , <device number> )
device
• • • •
Specify the device to read and write.
Syntax
device number
• • • •
Specify the device number to read and write.
A%=B@ (EM, 100)
• • • •
Reads the bit information of the expansion relay
EM100 to A%.
A%=B@ (Y, &H1B)
• • • •
Reads the bit information of the general-purpose
output Y001B to A%.
B@ (EM, 200) =A%
• • • •
Write the bit information to the expansion relay
EM200.
Examples
B@ (X, &HA) = A%
• • • •
Write the bit information to the general-purpose input
X000A.
Description
• The B@ variable reads and writes the bit information of the device.
• Specify one of the following devices for <device>:
Expansion relay • • • • EM
General-purpose input • • • • X
General-purpose output • • • • Y
• Specify the following device number for <device number>:
EM • • • • 0 to 1023
X, Y • • • • &H0 to &H1F
• The read data is 1 when ON and 0 when OFF.
• For the write data, bit 0 of the specified value or of the value that is stored in the specified
variable is valid.
b15
b8b7
b0
to
to
The corresponding device
is turned ON when "1."
The corresponding device
is turned OFF when "0."
• Set the data by an integer constant or an integer variable when writing.
• Only write operation can be used when general-purpose input X is specified.
• Only read operation can be used when general-purpose output Y is specified.
REMARK
See the W@ function.