Mitsubishi QD51 Programming Manual page 374

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 extension comment data from the PLC CPU and saves it on a
memory card
110 ' (Extension comment capacity: 3 k bytes)
120 OPEN"0:PROG11.DAT"FOR OUTPUT AS #1
130 DIM TBL%(10),A%(150)
140 TBL%(0)=255
150 TBL%(1)=11
160 TBL%(3)=128
170 FOR J=&HO TO &HB80 STEP 128
180 TBL%(2)=J
190 PCRD TBL%( ),A%( )
200 FOR I=0 TO 127
210 PRINT #1,A%(I)
220 NEXT I
230 NEXT J
240 CLOSE #1
250 END
(2) Program example for a format 2 control table
100 ' A program example that reads the extension comment data from the PLC CPU and saves it on a
memory card
110 ' (Extension comment capacity: 3 k bytes)
120 OPEN"0:PROG11.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)=11
180 TBL%(6)=128
190 FOR J=&HO TO &HB80 STEP 128
200 TBL%(5)=J
210 PCRD TBL%( ),A%( )
220 FOR I=0 TO 127
230 PRINT #1,A%(I)
240 NEXT I
250 NEXT J
260 CLOSE #1
270 END
11 - 204
:
'Opens the sequential file
:
'Defines arrays
:
'Specifies the station number to
communicate with to the local station
:
'Specifies to read extension comment data
:
'Specifies the number of bytes to be read
:
'Specifies the starting address of the
extension comment data to be read
:
'Executes the read operation
:
'Writes to the file
:
'Closes the file
:
'Opens the sequential file
:
'Defines arrays
:
'Specifies a format 2 control table
:
'Specifies network number 1
:
'Specifies station number 1
:
'Specifies to read extension comment data
:
'Specifies the number of bytes to be read
:
'Specifies the starting address of the
extension comment data to be read
:
'Executes the read operation
:
'Writes to the file
:
'Closes the file
MELSEC-Q
11 - 204

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents