Mitsubishi QD51 Programming Manual page 585

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
Since the break characters require to be specified in the lower and higher bytes
of different elements of <control table>, it is convenient to use hexadecimal
as shown below.
%(2 to 4)=&H
Program Example
10 ' This program sets and reads break characters
20 DIM TBL1&(2),TBL2%(4),TBL3%(4)
30 A%=1
40 TBL1%(0)=9600
50 TBL1%(1)=&H107
60 TBL1%(2)=&H1
70 ZOPEN #A%,TBL1%( )
80 TBL2%(0)=22
90 TBL2%(1)=2
100 TBL2%(2)=&H30D
110 ZCNTL #A%,0,TBL2%( )
120 TBL3%(0)=23
130 ZCNTL #A%,0,TBL3%( )
140 PRINT "Number of break characters=";TBL3%(1) :
150 PRINT "Break character=&H";HEX$(TBL3%(2))
160 ZCLOSE #A%
170 END
11 - 415
If a character equal to one of the set break characters is detected during the
execution of the ZRECEIVE instruction, the reception data until the break
character is stored in the input element of the receive request, after which the
execution of the receive request is ended.
Express the lower byte as
a 2-digit hexadecimal number.
Express the higher byte as
a 2-digit hexadecimal number.
:
' Defines arrays
:
' Communication channel CH1 (RS-232C)
:
' Sets the baud rate
:
' Sets the character length and parity bit
:
' Sets the stop bit
:
' Opens the communication channel
:
' Specifies to set break characters
:
' Specifies the number of break characters
:
' Defines break characters
:
' Executes the setting of the break
characters
:
' Specifies to read the break characters
:
' Executes the reading of the break
characters
' Displays the result
:
' Closes the communication channel
MELSEC-Q
11 - 415

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents