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

Page 71

Advertising
background image

Operating Functions

Chapter 5

5–34

5.4.22.4
PRINT USING (special characters)

Use the USING function to tell the BASIC Module what format to use
when displaying printed values. The module “stores” the desired format
after the USING statement is executed. All outputs following a USING
statement are in the format evoked by the last USING statement executed.
You do not need to execute the USING statement within every PRINT
statement unless you want to change the format. U. is a “shorthand”
notation for USING.

Important: The USING statement applies to numbers following it until
another USING statement is encountered.

5.4.22.5
PRINT USING(Fx)

This forces the BASIC Module to output all numbers using the floating
point format. The value of x determines how many significant digits are
printed. If x equals 0, the module does not output any trailing zeros, so the
number of digits varies depending upon the number. The module always
outputs at least 3 significant digits even if x is 1 or 2. The maximum value
for x is 8.

Example:

u10 PRINT USING(F3),1,2,3

u20 PRINT USING(F4),1,2,3

u30 PRINT USING(F5),1,2,3

u40 FOR I=10 TO 40 STEP 10

u50 PRINT I

u60 NEXT I

uRUN

1.00 E 0

2.00 E 0

3.00 E 0

1.000 E 0

2.000 E 0

3.000 E 0

1.0000 E 0

2.0000 E 0 3.0000 E 0

1.0000 E+1
2.0000 E+1
3.0000 E+1
4.0000 E+1
READY

5.4.22
Special Print Formatting
Statements (continued)

Advertising