Mitsubishi QD51 Programming Manual page 390

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
(2) Program example for a format 2 control table
100 'A program example that reads parameters from the PLC CPU and saves them on a memory card
110 '(Four network modules are connected. All the modules are control stations. Network parameter
capacity: 16 k bytes)
120 OPEN "0:PROG14.DAT" FOR OUTPUT AS #1
130 DIM TBL%(10),A%(150)
140 TBL%(0)=256
150 TBL%(1)=1
160 TBL%(2)=1
170 TBL%(4)=14
180 TBL%(7)128
190 FOR J=&H0 TO &H3F80 STEP 128
200 D!=J
210 H!=INT (D!/65536!)
220 L!=D!-H!*65536!
230 H$=RIGHT$("0000"+HEX$(H!), 4)
240 L$=RIGHT$("0000"+HEX$(L!), 4)
250 TBL%(5)=VAL("&H"+L$)
260 TBL%(6)=VAL("&H"+L$)
270 PRINT H$,L$
280 PCRD TBL%( ),A%( )
290 FOR I=0 TO 127
300 PRINT #1,A%(I)
300 NEXT I
310 NEXT J
320 CLOSE #1
330 END
11 - 220
:
'Opens the sequential file
:
'Defines arrays
:
'Specifies a format 2 control table
:
'Specifies network number 1
:
'Specifies station number 1
:
'Specifies to read parameters
:
'Specifies the number of bytes to be read
:
'Specifies the starting address
:
'Upper byte of the starting address
:
'Lower byte of the starting address
:
'Stores the lower byte in the control table
:
'Stores the upper byte in the control table
:
'Executes the read operation
:
'Writes to the file
:
'Closes the file
MELSEC-Q
11 - 220

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents