Call 95 – get number of characters in prt1 buffers, Purpose, Syntax – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 140: Example

Advertising
background image

Publication 1746-RM001A-US-P

11-10 Status Functions

CALL 95 – Get Number of
Characters in PRT1
Buffers

Purpose

Use CALL 95 to retrieve the number of characters in the chosen buffer of port
PRT1.

You must PUSH which buffer you want examined:

PUSH 1 for the input buffer

PUSH 0 for the output buffer

One POP is required to get the number of characters.

Syntax

PUSH [buffer selection]
CALL 95
POP [number of characters]

Example

>1

REM EXAMPLE PROGRAM

>10 PUSH 0 : REM EXAMINES THE OUTPUT BUFFER

>20 CALL 95

>30 POP X : REM GET THE NUMBER OF CHARACTERS

>40 PRINT “NUMBER OF CHARACTERS IN PRT1 OUTPUT BUFFER IS ”,X

>50 END

READY

>RUN

NUMBER OF CHARACTERS IN PRT1 OUTPUT BUFFER IS 0

READY

>

Advertising