beautypg.com

Rockwell Automation 5370-UPK CVIM USER-PAK Option User Manual

Page 87

background image

Chapter 8

Defining Strings for Serial Ports and Viewports

8–11

the result of the gage 1, and limits the field for that result to three places in
the viewport display.

For example: Assume the gage 1 result = 34

This code

transmits (or displays) this field :

G1

_ _ _ _ _ _ _ 34 (where “_ ” represents one space character)

G1(3)

_ 34

The field formatting code options are described in following pages, along
with examples for each option.

Field Formatting Codes:

(x)

where

x

is a number 0–40, specifies the “field width.” That is, the

field will contain

x

number of places. Note that, in specifying the field

width:

Results exceeding the specified field width are truncated from the right.

The maximum field width of any given field is 40; specifying a higher
number for the field width will result in a field width of 40 places.

Any unused places are left as spaces preceding the value in the field (that
is, the field contents are right justified within the field), if no other
specifications are defined for the format.

Examples: Assume window 1 result = 1234:

This code

transmits (or displays) this field:

W1

_ _ _ _ _1234 (default format is 9 places, right justified)

W1(5)

_ 1234

W1(3)

123 (result is truncated)

W1(0)

(no field transmitted or displayed)

Examples: Assume formula 1 result = 123.45:

*

This code

transmits (or displays) this field:

F1(5)

123.4 (result is truncated)

*

F1(6)

123.45

F1

_ _123.450 (default format is 9 places, three decimal)

*

Note: Decimal points (“

.”), if present in the result, use one of the

allotted places in the field. If a decimal point is present, make sure you
allow for its use of one place.