Mitsubishi QD51 Programming Manual page 574

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
Decimal
65535
to
32768
32767
to
0
-1
to
-32768
Program Example
10 ' This program writes data to the specified bit
20 DIM A%(0)
30 FOR I=1 TO 15 STEP 2
40 WTSET I,0,A%(0)
50 NEXT I
60 FOR I=1 TO 15 STEP 2
70 WTSET I,0,A%(0)
80 NEXT I
90 FOR I=0 TO 15
100 A=RDSET(I,A%(0))
110 PRINT A;
120 NEXT I
RUN
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
OK
11 - 404
The range of integers that can be expressed by 16 bits is from -32768 to 32767, which are
expressed in hexadecimal as follows.
If decimal values from -32768 to -1 are specified, it is assumed that values from
32768 to 65535 are specified.
Hexadecimal
FFFF
1111
H
to
8000
1000
H
7FFF
0111
H
to
0000
0000
H
FFFF
1111
H
to
8000
1000
H
REMARK
See the RDSET instruction.
Binary
1111
1111
1111
to
0000
0000
0000
1111
1111
1111
to
0000
0000
0000
1111
1111
1111
to
0000
0000
0000
:
' Defines an array
:
' Writes 1 in every second bit
:
' Writes 0 in every second bit
:
' Reads the data
:
' Displays the result
MELSEC-Q
These are
the same.
11 - 404

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents