Call 37: clear the prt2 port buffers – Rockwell Automation 1771-DB BASIC MODULE User Manual
Page 225

Chapter
Call Routines 0–68
12
12 -35
Use this routine to retrieve the number of characters in the buffer you
choose.
Input and Output Arguments
This routine has one input and one output argument. The input argument
is the buffer you want to examine:
0 = transmit buffer
1 = receive buffer
The output argument is the number of characters in the specified buffer.
Syntax
PUSH
buffer to examine
CALL 36
POP
number of characters
Example
>10 PUSH 0: REM EXAMINES THE TRANSMIT BUFFER
>20 CALL 36
>30 POP X: REM GET THE NUMBER OF CHARACTERS
>40 PRINT “NUMBER OF CHARACTERS IN OUTPUT BUFFER IS”, X
>50 END
Use this routine to clear the PRT2 port receive and/or transmit buffer.
Input and Output Arguments
This routine has one input argument and no output argument. The input
argument is the buffer you want to clear:
0 = transmit buffer
1 = receive buffer
2 = both buffers
Syntax
PUSH
buffer to clear
CALL 37
Example
>10 PUSH 0: REM CLEARS THE TRANSMIT BUFFER
>20 CALL 37
CALL 36: Get the Number of
Characters in the PRT2 Port
Buffer
CALL 37: Clear the PRT2
Port Buffers