2 - 14 2 - 14
MELSEC-Q
2 THE BASICS OF AD51H-BASIC
2.8.3 Special variables (How to use B@ and W@)
• These variables are used to read/write from/to each device of the communication
module from within BASIC programs.
• There are the following 4 types of special variables.
B@ (EM, expression)
• • • • •
Read/write from/to the extension relays EM.
W@ (ED, expression)
• • • • •
Read/write from/to the registers ED.
B@ (X, expression)
• • • • •
Write to general-purpose inputs X.
W@ (Y, expression)
• • • • •
Read from general-purpose outputs Y.
Refer to the user’s manual for each communication module for details on the extension
relays EM, extension registers ED, general-purpose inputs X, and general-purpose
outputs Y.
Note that it is possible to read and write to/from the special EM and special ED
extension devices.
(1) Reading from and writing to bit devices
B@(EM, expression)
• • • • •
Specify a value between 0 and 1023 for
the expression.
B@(X, expression)
• • • • •
Specify a value between 0 and 1F
H
for the
expression. Since this must be specified in
hexadecimal, place ‘&H’ in front of the
numeric value.
B@(Y, expression)
• Specify a device number in the expression.
When general-purpose inputs X or outputs Y are specified, values between 0
and1F
H
are used regardless of the input/output numbers of the entire system.
The input/output
numbers as seen
from the PLC CPU
A
X
41
(32 points)
AD
51
H
(48 points)
A
X
41
(32 points)
A
Y
41
(32 points)
A
Y
41
(32 points)
A
Y
41
(32 points)
D0 to EF
?
?
General-purpose
inputs/outputs
X, Y
Value specified
in the expression
0 to 1F
A
X
41
(32 points)
40
to 4F
50 to 6F
•
•
•
•
•
•
0 to 1F
20 to 3F
40 to 6F
70 to 8F
90 to AF
B0 to CF
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...