11 - 291 11 - 291
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
(2) Program example for a format 2 control table
100 ' A program example that writes the sequence program stored in a memory card to the PLC CPU
110 (Capacity of the main sequence program: 8 k steps)
120 DIM TBL%(10),A%(100)
:
'Defines arrays
130 OPEN "0:PROG8.DAT" FOR INPUT AS #1
:
'Opens the file
140 FOR J=&H0 TO, &H1FC0 STEP 64
150 FOR I=0 TO 63
160 INPUT #1,A%(I)
:
'Reads from the file
170 NEXT I
180 TBL%(0)=256
:
'Specifies a format 2 control table
190 TBL%(1)=1
:
'Specifies network number 1
200 TBL%(2)=1
:
'Specifies station number 1
210 TBL%(4)=8
:
'Specifies to write the sequence program
220 TBL%(5)=1
:
'Specifies to write to the main sequence
program area
230 TBL%(6)=J
:
'Specifies the head step number to be
written
240 TBL%(7)=64
:
'Specifies the number of steps to be written
250 PCWT TBL%( ),A%( )
:
'Executes the write operation
260 NEXT J
270 CLOSE
:
'Closes the file
280 END