Mitsubishi QD51 Programming Manual page 479

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
Program Example
(1) Program example for a format 1 control table
100 ' A program example that writes data to buffer memory 0 of the special function module (A62DA)
110 ' (Starting address of A62DA: &H0A)
120 DIM TBL%(5),A%(0)
130 TBL%(0)=255
140 TBL%(1)=12
150 TBL%(2)=&HA
160 D!=&HA0
170 H!=INT(D!/65536!)
180 H$=RIGHT$("0000"+HEX$(H!),4)
190 L$=RIGHT$("0000+HEX$(L!),4)
200 TBL%(3)=VAL("&H"+L$)
210 TBL%(4)=VAL("&H"+H$)
220 TBL%(5)=2
230 A%(0)=&H3E8
240 PCWT TBL%( ),A%( ) :
250 END
(2) Program example for a format 2 control table
100 ' A program example that writes data to buffer memory 0 of the special function module (A62DA)
110 ' (Head address of A62DA: &H0A)
120 DIM TBL%(8),A%(0)
130 TBL%(0)=256
140 TBL%(1)=1
150 TBL%(2)=1
160 TBL%(4)=12
170 TBL%(5)=&HA
180 D!=&HA0
190 H!=INT(D!/65536!)
200 H$=RIGHT$("0000"+HEX$(H!),4)
210 L$=RIGHT$("0000+HEX$(L!),4):
220 TBL%(6)=VAL("&H"+L$)
230 TBL%(7)=VAL("&H"+H$)
240 TBL%(8)=2
250 A%(0)=&H3E8
260 PCWT TBL%( ),A%( ) :
270 END
11 - 309
:
'Defines arrays
:
'Specifies the station number to
communicate with to the local station
:
'Specifies to write data to buffer memory
:
'Specifies the module number
:
'Specifies the buffer memory address
:
'Higher byte of the buffer memory address
:
'Lower byte of the buffer memory address
:
'Stores the lower byte in the control table
:
'Stores the higher byte in the control table
:
'Specifies the number of bytes to be written
:
'Specifies the values to be written
:
'Executes the write operation
:
'Defines arrays
:
'Specifies a format 2 control table
:
'Specifies network number 1
:
'Specifies station number 1
:
'Specifies to write data to buffer memory
:
'Specifies the module number
:
'Specifies the buffer memory address
:
'Higher byte of the buffer memory address
:
'Lower byte of the buffer memory address
:
'Stores the lower byte in the control table
:
'Stores the higher byte in the control table
:
'Specifies the number of bytes to be written
:
'Specifies the values to be written
:
'Executes the write operation
MELSEC-Q
11 - 309

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents