11 - 242 11 - 242
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
(2) Program example for a format 2 control table
100 'A program example that reads the device memory of the Q/QnA series PLC CPU
110 DIM TBL%(20),A%(10)
:
'Defines the arrays
120 TBL%(0)=256
:
'Specifies a format 2 control table
130 TBL%(1)=1
:
'Specifies network number 1
140 TBL%(2)=1
:
'Specifies station number 1
150 TBL%(4)=516
:
'Specifies to read random devices of the
Q/QnA series PLC CPU
160 TBL%(5)=&H101
:
'Reads one bit device point or one word
device point
170 TBL%(6)=&H1
:
'Reads one double-word device point
180 TBL%(7)=0
:
'Fixed value
190 TBL%(8)=168
:
'Specifies data registers (D)
200 D!=0
:
'Specifies device number 0
210 GOSUB 420
220 TBL%(9)=L%
:
'Stores the lower digit of the device number
230 TBL%(10)=H%
:
'Stores the higher digit of the device
number
240 TBL%(11)=0
:
'Specifies word units as processing unit
250 TBL%(12)=0
:
'Fixed value
260 TBL%(13)=144
:
'Specifies internal relays (M)
270 D!=0
:
'Specifies device number 0
280 GOSUB 420
290 TBL%(14)=L%
:
'Stores the lower digit of the device number
300 TBL%(15)=H%
:
'Stores the higher digit of the device
number
310 TBL%(16)=0
:
'Specifies bit units as processing unit
320 TBL%(17)=0
:
'Fixed value
330 TBL%(18)=168
:
'Specifies data registers (D)
340 D!=8000
:
"Specifies device number 8000
350 GOSUB 420
360 TBL%(19)=L%
:
'Stores the lower digit of the device number
370 TBL%(20)=H%
:
'Stores the higher digit of the device
number
380 TBL%(21)=0
:
'Specifies double-word units as processing
unit
390 TBL%(22)=0
:
'Fixed value
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...