beautypg.com

Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 102

background image

Operating Functions

Chapter 5

5–65

Use this routine to retrieve the number of characters in the chosen buffer as
its output argument. You must PUSH which buffer is to be examined.

PUSH 1 for the input buffer.

PUSH 0 for the output buffer.

One POP is required to get the number of characters.

Example:

u10 PUSH 0: REM examines the output buffer

u20 CALL 36

u30 POP X: REM get the number of characters

u40 PRINT “Number of characters in the Output Buffer is”,X

u50 END

This routine clears either the peripheral ports input or output buffer.

PUSH 0 to clear the output buffer.

PUSH 1 to clear the input buffer.

PUSH 2 to clear both buffers.

Example:

u10 PUSH 0: REM clears the output buffer

u20 CALL 37

u30 END

Important: Maximum baud rate is 2400 bps for all data recorder CALL
routines. The Peripheral Port is set up in these routines and does not need
setting in BASIC. See section 4.4.3 for required cable connections. Tape
verification failures result if you use a cable with different pin connections

This routine is identical to the CALL 32 routine except the program is
assigned an ID number (0-255) before storing it on tape. This allows you
to search for a specific program on a tape that contains many different
programs. To do this:

PUSH the ID number.

enter CALL 38. From this point on operation is identical to the CALL
32 routine. See section 5.8.3 above titled, “Save Program to Data
Recorder – Call 32” for an explanation.

5.8.7
Get the Number of
Characters in the Peripheral
Port Buffers – CALL 36

5.8.8
Clear the Peripheral Ports
Input or Output Buffer –
CALL 37

5.8.9
Save Labeled Program to
Data Recorder (1770-SB only)
– CALL 38