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

Page 64

Advertising
background image

Operating Functions

Chapter 5

5–27

Causes a question

mark (?) to print on the console device. This

prompts

you to input two numbers separated by a comma. If you do

not enter

enough data, the module prints TRY AGAIN on the console

device.

Example:

u10 INPUT A,B

u20 PRINT A,B

uRUN

?1

TRY AGAIN

?1,2
1

2

READY

You can

write the INPUT statement so that a descriptive prompt tells

you what to

enter. The message to be printed is placed in quotes after

the INPUT statement.

If a comma appears before the first variable on

the input list,

the question mark prompt character is not displayed.

Examples:

u10 INPUT“ENTER A NUMBER” A

u10 INPUT”ENTER A NUMBER–”,A

u20 PRINT SQR(A)

u20 PRINT SQR(A)

u30 END

u30 END

uRUN

uRUN

ENTER A NUMBER

ENTER A NUMBER–100

?100

10

10

You can

also assign strings with an INPUT statement. Strings are

always terminated with a carriage

return (cr). If more than one string

input is requested

with a single INPUT statement, the module prompts

you

with a question mark.

5.4.16
Statement: INPUT
(continued)

Advertising