Mitsubishi QD51 Programming Manual page 330

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
(Executed in BASIC on the LM7000)
10 ' This program sends data to the console (transmission from the LM7000)
20 ON ERROR GOTO 380
30 '
40 '***** RS-232C CH.OPEN *****
50 DIM T%(8)
60 CH%=18
70 T%(0)=4800
80 T%(1)=&H8
90 T%(2)=&H1
100 T%(3)=0
110 T%(5)=0
120 T%(4)=0
130 T%(6)=0
140 T%(7)=0
150 ZOPEN #CH%,T%( )
160 '
170 '***** RS CNTL *****
180 DIM CNTL%(1)
190 CNTL%(0)=32
200 CNTL%(1)=&H1
210 ZCNTL #CH%,0,CNTL%( )
220 '
230 '***** DATA SEND *****
240 DIM TBL%(2)
250 TBL%(0)=12
260 TBL%(1)=0
270 TBL%(2)=100
280 SD$="AD51H-BASIC "
290 ZSEND #CH%,0,TBL%( ),SD$
300 PRINT "SEND CHARACTER =";TBL%(1)
310 PRINT "SEND DATA =";SD$
320 '
330 '***** RS-232C CH.CLOSE *****
340 ZCLOSE #CH%
350 END
360 '
370 '***** ERROR ROUTINE *****
380 ERTYPE%=ERR:ERLINE%=ERL
390 IF ERTYPE%=94 THEN ERTYPE%=ZERROR(1) :
400 PRINT "ERROR CODE =";ERTYPE%
410 PRINT "ERROR LINE =";ERLINE%
420 RESUME 340
11 - 160
:
'Branches to line 360 if an error occurs
:
' Defines the array
:
' Defines the channel number
:
' Specifies the baud rate
:
' Specifies the character length, parity bit,
:
' Stop bit, and DC control
:
' Specifies control by the DC signal
:
' Specifies the DC1 and DC codes
:
' Specifies the receive buffer
:
' Specifies the DC2 and DC3 codes
:
' Specifies the DC4 code
:
' Opens the communication channel
:
' Defines the array
:
' Specifies control by the RS and ER
signals
:
' Turns the RS control signal on
:
' Executes control by the signals
:
' Defines the array
:
' Specifies the request characters
:
' Stores the characters to be transmitted
:
' Specifies the timeout value
:
' Defines the transmission data
:
' Executes the transmission
:
' Displays the number of transmitted
characters
:
' Displays the transmitted data
:
' Closes the communication channel
:
' Ends the execution
:
' Stores the error occurred, and the line
' Notifies if it is a Z-related error
:
' Displays the error code
:
' Displays the line where the error occurred
:
' Returns the operation to line 320
MELSEC-Q
11 - 160

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents