Mitsubishi QD51 Programming Manual page 363

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 sequence program in the PLC CPU and saves it on a memory
card
110 ' (Capacity of the main sequence program: 8 k steps)
120 DIM TBL%(10),A%(100)
130 OPEN"0:PROG8.DAT"FOR OUTPUT AS #1
140 TBL%(0)=255
150 TBL%(1)=8
160 TBL%(2)=1
170 TBL%(4)=64
180 FOR J=&HO TO &H1F80 STEP 64
190 TBL%(3)=J
200 PCRD TBL%( ),A%( )
210 FOR I=0 TO 63
220 PRINT #1,A%(I)
230 NEXT I
240 NEXT J
250 CLOSE #1
260 END
(2) Program example for a format 2 control table
100 ' A program example that reads the sequence program in the PLC CPU and saves it on a memory
card
110 ' (Capacity of the main sequence program: 8 k steps)
120 DIM TBL%(10),A%(100)
130 OPEN"0:PROG8.DAT"FOR OUTPUT AS #1
140 TBL%(0)=256
150 TBL%(1)=1
160 TBL%(2)=1
150 TBL%(4)=8
160 TBL%(5)=1
170 TBL%(7)=64
180 FOR J=&HO TO &H1F80 STEP 64
190 TBL%(6)=J
200 PCRD TBL%( ),A%( )
210 FOR I=0 TO 63
220 PRINT #1,A%(I)
230 NEXT I
240 NEXT J
250 CLOSE
260 END
11 - 193
:
'Defines arrays
:
'Opens the sequential file
:
'Specifies the station number to
communicate with to the local station
:
'Specifies to read the sequence program
:
'Specifies to read the main program
:
'Specifies the number of steps to read
:
'Specifies the starting step of the program
:
'Executes the read operation
:
'Writes to the sequential file
:
'Closes the file
:
'Defines arrays
:
'Opens the sequential file
:
'Specifies a format 2 control table
:
'Specifies network number 1
:
'Specifies station number 1
:
'Specifies to read the sequence program
:
'Specifies to read the main program
:
'Specifies the number of steps to read
:
'Specifies the starting step of the program
:
'Executes the read operation
:
'Writes to the sequential file
:
'Closes the file
MELSEC-Q
11 - 193

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents