11 - 198 11 - 198
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
(2) Program example of a format 2 control table
100 ' A program example that loads the microcomputer program and saves it on a memory card
110 ' (Capacity of the microcomputer program: 8 k bytes)
120 OPEN"0:PROG9.DAT"FOR OUTPUT AS #1
:
'Opens the sequential file
130 DIM TBL%(7),A%(127)
:
'Defines arrays
140 TBL%(0)=256
:
'Specifies a format 2 control table
150 TBL%(1)=1
:
'Specify network number 1
160 TBL%(2)=1
:
'Specify station number 1
170 TBL%(4)=9
:
'Specifies to load the microcomputer
program
180 TBL%(5)=1
:
'Specifies to load the main microcomputer
program
190 TBL%(7)=128
:
'Specifies the number of bytes to be read
200 FOR J=&HO TO &H1F80 STEP 128
210 TBL%(6)=J
:
'Specifies the starting address of the
program
220 PCRD TBL%( ),A%( )
:
'Executes the load operation
230 FOR I=0 TO 127
240 PRINT #1,A%(I)
:
'Writes to the sequential file
250 NEXT I
260 NEXT J
270 CLOSE #1
:
'Closes the file
280 END