11 - 277 11 - 277
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
(2) Program example for a format 2 control table
100 ' A program example that monitors extension file registers registered to be monitored by the
PCWT instruction
110 DIM TBL1%(10),A%(20),TBL2%(10),B%(20)
:
'Defines arrays
120 TBL1%(0)=256
:
'Specifies a format 2 control table
130 TBL1%(1)=1
:
'Specifies network number 1
140 TBL1%(2)=1
:
'Specifies station number 1
150 TBL1%(4)=5
:
'Specifies to register extension file registers
to be monitored
160 TBL1%(5)=2
:
'Specifies the number of points to be
monitored
170 A%(0)=1:A%(1)=0
:
'Specifies block number 1 and device
number 0
180 A%(2)=1:A%(3)=1
:
'Specifies block number 1 and device
number 1
190 PCWT TBL1%( ),A%( )
:
'Executes the monitor registration
200 TBL2%(0)=256
:
'Specifies a format 2 control table
210 TBL2%(1)=1
:
'Specifies network number 1
220 TBL2%(2)=1
:
'Specifies station number 1
230 TBL2%(4)=5
:
'Specifies to register extension file registers
to be monitored
240 PCRD TBL2%( ),B%( )
:
'Executes the monitoring
250 PRINT"B%(0)=" :B%(0)
:
'Displays the result
260 PRINT"B%(1)=" :B%(1)
270 END