Mitsubishi QD51 Programming Manual page 32

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

2 THE BASICS OF AD51H-BASIC
2 - 15
• Data, when being read, is represented by the value 1 when ON and 0 when OFF.
• Only bit 0 of the value stored in the specified value or specified variable is valid for
data being written.
to
b15
b8 b7
Therefore, data must be stored as integer constants or integer variables during write
operations.
• It is only possible to write when general-purpose inputs X are specified. Also, it is
possible only to read when general-purpose outputs Y are specified.
Example
A=B@(EM, 100)
A%=B@(Y, &H1B)
B@(EM, 200) = A%
B@ (X, &HA) = A%
(2) Reading and writing from/to word devices
W@(ED, expression)
• Specify a device number in the expression.
• If the data is not an integer constant or an integer variable when the write
operation is performed, the value is changed to an integer type and written.
Example
A=W@(ED,50)
A%=W@(ED,50)
W@(ED,80)=1234
W@(ED,80)=A
• When reading a 32-bit data value, it should be read into an array variable of
integer type, converted to 32-bit data using CIDB and CISN instructions, and
then used.
Example
100 DIM A% (1)
110 A%(0)=W@(ED,100)
120 A%(1)=W@(ED,101)
130 B#=CIDB(A%(0))
to
b0
The corresponding device will
turn ON when this is "1".
The corresponding device will
turn OFF when this is "0".
• • • • •
Specify a value between 0 and 1023 for the
expression.
• • • • •
The data stored in ED50 will be read and
assigned to single-precision variable A.
• • • • •
The data stored in ED50 will be read and
assigned to integer variable A%.
• • • • •
1234 is written to ED80.
• • • • •
The contents of a single-precision real
number A will be written to ED80.
• • • • •
• • • • •
MELSEC-Q
Read the 32-bit data stored in
ED100 and ED101 to A%(0) and
A%(1) as 16-bit data respectively.
The data in A%(0) and A%(1) are
converted to 32-bit data, and then
assigned to B#.
2 - 15

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents