Mitsubishi QD51 Programming Manual page 389

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 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)=255
150 TBL%(1)=14
160 TBL%(4)=128
170 FOR J=&H0 TO &H3F80 STEP 128
180 D!=J
190 H!=INT (D!/65536!)
200 L!=D!-H!*65536!
210 H$=RIGHT$("0000"+HEX$(H!), 4)
220 L$=RIGHT$("0000" +HEX$(H!), 4)
230 TBL%(2)=VAL("&H"+L$)
240 TBL%(3)=VAL("&H"+L$)
250 PRINT H$,L$
260 PCRD TBL%( ),A%( )
270 FOR I=0 TO 127
280 PRINT #1,A%(I)
290 NEXT I
300 NEXT J
310 CLOSE #1
320 END
11 - 219
:
' Opens the sequential file
:
' Defines arrays
:
' Specifies the station number to
communicate with to the local station
:
' 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 - 219

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents