11 - 398 11 - 398
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
W@
Variable
Word@
• Reads or writes word information in extension registers (ED).
Syntax
W@(<device>,<device number>)
device
• • • •
Specify the device to be read or written.
device number
• • • •
Specify the number of the device to be read or
written.
Examples
A=W@(ED,50)
• • • •
Reads the data in the extension register ED50 and
assigns it to the single-precision variable A.
A%=W@(ED,50)
• • • •
Reads the data in the extension register ED50 and
assigns it to the integer variable A%.
W@=(ED,80)=1234
• • • •
Writes 1234 to the extension register ED80.
W@=(ED,80)=A
• • • •
Writes the data of the single-precision variable A to
the extension register ED80.
Description
• The W@ variable reads or writes word information of devices.
• Specify the following device type for <device>.
Extension registers • • • ED
• Specify a device number in the following range for <device number>.
ED • • • from 0 to 1023
• If the data to be written is not an integer constant or integer variable, the type is converted
into integer and the resulting value is written.
• In order to read in units of 32 bits, assign data to an integer array variable, convert it into
32-bit data using the CIDB and CISN instructions, and then read the resulting value.
Example
100 DIM A%(1)
100 A%(0)=W@(ED,100)
• • • •
120 A%(1)=W@(ED,101)
• • • •
Reads the 32 bits of data stored into
ED100 and ED101 to A%(0) and
A%(1), respectively, as two 16-bit
data values.
130 B#=CIDB(A%(0))
• • • •
Converts the data in A%(0) and
A%(1) to 32-bit data and assigns it
to B#.