11 - 425 11 - 425
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
Reading the receive buffer size and the number of characters
Control table format definition
Element position
Item
Description
%(0)
Processing code
Specify the processing code.
Processing Code 80
%(1)
Receive buffer
Read the size of the receive buffer.
%(2)
Number of characters
Read the number of characters stored in the
receive buffer.
• It is possible to read the size of the receive buffer and the number of characters
stored in the receive buffer using this code.
• Specify 80 for the processing code.
• The reading operation can be performed on CH1 (RS-232C), CH2 (RS-232C),
and CH3 (RS-422/485).
Program Example
5 ' This program reads the receive buffer size and the number of characters stored in it
10 DIM TBL1%(10),TBL2%(10)
:
' Defines arrays
20 CH%=1
:
' Specifies the communication channel
30 TBL1%(0)=9600
40 TBL1%(1)=&H108
50 TBL1%(2)=&H1
60 ZOPEN #CH%,TBL1%( )
:
' Opens the communication channel
70 TBL2%(0)=80
:
' Specifies to read the size and the number
of characters
80 ZCNTL #CH%,0,TBL2%( )
:
' Executes the read operation
90 PRINT "The size of receive buffer=";TBL2%(1)
:
' Displays the result
100 PRINT "The number of characters=";TBL2%(2)
110 ZCLOSE #CH%
:
' Closes the communication channel
120 END