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

Page 88

Advertising
background image

Chapter 8

Defining Strings for Serial Ports and Viewports

8–12

(–x)

The “minus” sign (

) placed within the format code specifies the

value will be left justified within the transmitted field. Any unused places are
left as spaces following the value in the transmitted field.

Examples: Assume window 1 result = 123

This code

transmits (or displays) this field:

W1(4)

_ 123

W1

_ _ _ _ _ _ 123

W1(–4)

123 _

W1(–)

123 _ _ _ _ _ _

(0x)

The zero

(0)

placed at the left of the field width specifies that any

unused places in the transmitted field are filled with zeros. The “minus” sign

()

can be included to specify the value will be left justified.

Examples: Assume window 1 result = 1234

This code

transmits (or displays) this field:

W1(08)

00001234

W1(–08)

12340000

Examples: Assume formula 1 result = 123.4

This code

transmits (or displays) this field:

F1(08)

0123.400

F1(–08)

123.4000

(x.d)

The

x

indicates the field width, while the

d

value specifies the

maximum number of decimal places to be present in the field. Note that the

d

value is only effective if decimal places are actually part of the tool result.

Also, if the specified field width is not large enough to include the entire
result – whole number component and all of the decimal component – the
result is truncated from the right. A

d

value of 0 can be used – this specifies

that no decimal places (or decimal points) are used.

Advertising