Rockwell Automation 5370-CUPK Color CVIM USER-PAK Option User Manual

Page 100

Advertising
background image

Chapter 8

Defining Strings for Serial Ports and Viewports

8 – 11

You can use the # (index) character in two ways:

Place the # in the string to take the place of the tool number designation in
a data code – for example, G#, or W#.

Place the # by itself in the string to transmit or display the current index
number.

You can, at your option, specify the format of the index “field” in the output.
You specify the index field format by including an optional formatting code
in parentheses immediately following the index character in the text string
you are defining (see “Field Format Codes”).

Using an Offset with the # (Index) Character – You can include an
“offset” with the index character, by placing either the “+” or “–” sign after
the “#,” followed by the offset value.

Example – We want to display the statistical mean for gages 1-8. To do this,
we would use the data code for statistical mean value, Sn.3, where n
represents the tool type and number. For this data code, the n values 9-16
indicate gages 1-8.

We could use the following string:

Gage

#

Mean =

S #+8 . 3 n

and use the

Repeat String

feature, with

Start

= 1,

End

= 8,

Increment

= 1.

In this string, the term # + 8 is used for the n value in the data code Sn.3:

Data code Sn.3

Gage

#

Mean =

S #+8 . 3 n

n= #+8

where

When this string is repeated for index values from 1-8, the n value

#+8

(current index value + 8) indexes through the values 9-16. In this way, eight
strings are displayed, which provide the mean values for gages 1-8:

Gage

1 Mean = 144.560

Gage

2 Mean = 222.666

Advertising