Mitsubishi QD51 Programming Manual page 410

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
Program Example
(1) Program example for a format 1 control table
100 'A program example that reads the device memory of the Q/QnA series PLC CPU
110 DIM TBL%(20),A%(10)
120 TBL%(0)=255
130 TBL%(1)=516
140 TBL%(2)=&H101
150 TBL%(3)=&H1
160 TBL%(4)=0
170 TBL%(5)=168
180 D!=0
190 GOSUB 400
200 TBL%(6)=L%
210 TBL%(7)=H%
220 TBL%(8)=0
230 TBL%(9)=0
240 TBL%(10)=144
250 D!=0
260 GOSUB 400
270 TBL%(11)=L%
280 TBL%(12)=H%
290 TBL%(13)=0
300 TBL%(14)=0
310 TBL%(15)=168
320 D!=8000
330 GOSUB 400
340 TBL%(16)=L%
350 TBL%(17)=H%
360 TBL%(18)=0
370 TBL%(19)=0
380 PCRD TBL%(),A%()
390 END
11 - 240
:
'Defines the arrays
:
'Specifies the station number to
communicate with to the local station
:
'Specifies to read random devices of the
Q/QnA series PLC CPU
:
'Reads one bit device point or one word
device point
:
'Reads one double-word device point
:
'Fixed value
:
'Specifies data registers (D)
:
'Specifies device number 0
:
'Stores the lower digit of the device number
:
'Stores the higher digit of the device
number
:
'Specifies word units as processing unit
:
'Fixed value
:
'Specifies internal relays (M)
:
'Specifies device number 0
:
'Stores the lower digit of the device number
:
'Stores the higher digit of the device
number
:
'Specifies bit units as processing unit
:
'Fixed value
:
'Specifies data registers (D)
:
"Specifies device number 8000
:
'Stores the lower digit of the device number
:
'Stores the higher digit of the device
number
:
'Specifies double-word units as processing
unit
:
'Fixed value
:
'Executes the read operation
MELSEC-Q
11 - 240

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents