Mitsubishi QD51 Programming Manual page 482

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 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%(1)
170 NEXT I
180 TBL%(0)=255
190 TBL%(1)=14
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 TBL1%(2)=VAL("&H"+L$)
260 TBL1%(3)=VAL("&H"+H$)
270 TBL1%(4)=128
280 PCWT TBL1%( ),A%( )
290 NEXT J
300 CLOSE
310 TBL2%(0)=255
320 TBL2%(1)=15
330 PCWT TBL2%( ),B%( )
340 END
11 - 312
:
'Defines arrays
:
'Opens the file
:
'Specifies the station number to
communicate with to the local station
:
'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 the station number to
communicate with to the local station
:
'Specifies to analyze the parameter data
:
'Executes the analysis
MELSEC-Q
11 - 312

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents