Call 35 – get numeric input character from prt2, Purpose, Syntax – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 205: Examples

Advertising
background image

Publication 1746-RM001A-US-P

Input Functions 13-15

CALL 35 – Get Numeric
Input Character from
PRT2

Purpose

Use CALL 35 to retrieve the current character in the 256 character input buffer of
port PRT2. It returns the decimal representation of the characters received as its
output argument. Port PRT2 receives data transmitted by your device and stores it
in this buffer. If there is no character, the output argument is a 0 (null). If there is a
character, the output argument is the ASCII value of that character. There is no
input argument for this routine.

Syntax

CALL 35
POP [ASCII value of character]

Examples

Example 1

>1

REM EXAMPLE PROGRAM

>10 CALL 35

>20 POP X

>30 IF X=0 THEN GOTO 10

>40 PRINT CHR(X)

READY

>RUN

A

READY

>

The above example assumes the PRT2 input buffer contains the ASCII character
A.

IMPORTANT

A 0 (null) is a valid character in some communication protocols.
Use CALL 36 to determine the actual number of characters in the
buffer.

IMPORTANT

Purge the buffer before storing data to ensure data validity.

Advertising