11 INSTRUCTIONS AND FUNCTIONS
(2) Program example for a format 2 control table
100 ' A program example that writes data to device memory of the PLC CPU
110 DIM TBL%(10),A%(20)
120 TBL%(0)=256
130 TBL%(1)=1
140 TBL%(2)=1
130 TBL%(4)=1
140 TBL%(5)=2
150 TBL%(6)=3
160 TBL%(7)=0
170 TBL%(8)=1
180 A%(0)=&H5
190 PCWT TBL%( ),A%( )
200 END
11 - 261
:
'Defines arrays
:
'Specifies a format 2 control table
:
'Specifies network number 1
:
'Specifies station number 1
:
'Specifies to write to device memory
:
'Specifies word units
:
'Specifies internal relays M
:
'Specifies the device number
:
'Specifies the number of words points to be
written
:
'Turns M1 and M3 ON and all others OFF
:
'Executes the write operation
MELSEC-Q
11 - 261