Mitsubishi QD51 Programming Manual page 483

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 writes the parameters stored in a memory card to the PLC CPU
110 ' (Four network modules are connected. All the modules are control stations. Network parameter
capacity: 16 k bytes)
120 DIM TBL1%(10),A%(150),TBL2%(10),B%(10)
130 OPEN "0:PROG14.DAT" FOR INPUT AS #1
140 FOR J=&H0 TO &H3F80 STEP 128
150 FOR I=0 TO 127
160 INPUT #1,A%(I)
170 NEXT I
180 TBL1%(0)=256
190 TBL1%(1)=1
200 TBL1%(2)=1
210 TBL1%(4)=14
220 D!=J
230 H!=INT(D!/65536!)
240 L!=D!-H!*65536!
250 H$=RIGHT$("0000"+HEX$(H!),4)
260 L$=RIGHT$("0000"+HEX$(L!),4)
270 TBL1%(5)=VAL("&H"+L$)
280 TBL1%(6)=VAL("&H"+H$)
290 TBL1%(7)=128
300 PCWT TBL1%( ),A%( )
310 NEXT J
320 CLOSE
330 TBL2%(0)=256
340 TBL2%(1)=1
350 TBL2%(2)=1
360 TBL2%(4)=15
370 PCWT TBL2%( ),B%( )
380 END
11 - 313
:
'Defines arrays
:
'Opens the file
:
'Specifies a format 2 control table
:
'Specifies network number 1
:
'Specifies station number 1
:
'Specifies to write parameters
:
'Specifies the starting address of the
parameter data to be written
:
'Higher byte of the starting address of the
parameter data
:
'Lower byte of the starting address of the
parameter data
:
Stores the lower byte in the control table
:
'Stores the higher byte in the control table
:
'Specifies the number of bytes to be written
:
'Executes the write operation
:
'Closes the file
:
'Specifies a format 2 control table
:
'Specifies network number 1
:
'Specifies station number 1
:
'Specifies to analyze the parameter data
:
'Executes the analysis
MELSEC-Q
11 - 313

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents