Mitsubishi QD51 Programming Manual page 469

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 the comment data stored in a memory card to the PLC CPU
110 ' (Comment capacity: 3 k steps)
120 DIM TBL%(10),A%(150)
130 OPEN "0:PROG9.DAT" FOR INPUT AS #1
140 FOR J=&H0 TO &HB80 STEP 128
150 FOR I=0 TO 127
160 INPUT #1,A%(I)
170 NEXT I
180 TBL%(0)=255
190 TBL%(1)=10
200 TBL%(2)=J
210 TBL%(3)=128
220 PCWT TBL%( ),A%( )
230 NEXT J
240 CLOSE
250 END
(2) Program example for a format 2 control table
100 ' A program example that writes the comment data stored in a memory card to the PLC CPU
110 ' (Comment capacity: 3 k steps)
120 DIM TBL%(10),A%(150)
130 OPEN "0:PROG9.DAT" FOR INPUT AS #1
140 FOR J=&H0 TO &HB80 STEP 128
150 FOR I=0 TO 127
160 INPUT #1,A%(I)
170 NEXT I
180 TBL%(0)=256
190 TBL%(1)=1
200 TBL%(2)=1
210 TBL%(4)=10
220 TBL%(5)=J
230 TBL%(6)=128
240 PCWT TBL%( ),A%( )
250 NEXT J
260 CLOSE
270 END
11 - 299
:
'Defines arrays
:
'Opens the file
:
'Reads from the file
:
'Specifies the station number to
communicate with to the local station
:
'Specifies to write comment data
:
'Specifies the head address of the
comment data to be written
:
'Specifies the number of bytes to be written
:
'Executes the write operation
:
'Closes the file
:
'Defines arrays
:
'Opens the file
:
'Reads from the file
:
'Specifies a format 2 control table
:
'Specifies network number 1
:
'Specifies station number 1
:
'Specifies to write comment data
:
'Specifies the head address of the
comment data to be written
:
'Specifies the number of bytes to be written
:
'Executes the write operation
:
'Closes the file
MELSEC-Q
11 - 299

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents