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

Page 99

Advertising
background image

Chapter 8

Defining Strings for Serial Ports and Viewports

8 – 10

% Formula Indicator

You can use the result from a formula for a character code, color code, or line
drawing parameter instead of entering a fixed numeric value. To do this,
enter the formula indicator in the place of the numeric value within the
respective code. The formula indicator takes this form:

%

fn

where

fn

is a number from 1-56 which specifies the respective formula

result (you must have installed the MATH-PAK option, Cat. No.
5370–CMPK).

Note: The fractional portion of the formula result, if any, is ignored within
the context of this feature.

Serial Ports: You can use the formula indicator with the character code
indicator (see “/ Character Code Indicator”).

Example – Use formulas and formula indicators to transmit a window result
in 16-bit binary code.

Definition of formula 1:

WIN1 / 256

(Window 1 results

256)

Definition of formula 1:

WIN1 % 256

(Window 1 modulo 256)

For a window 1 result of 780:
Formula 1 = 3 (decimal portion disregarded)
Formula 2 = 12

This code

transmits these two bytes (shown in binary below):

/%1 /%2

0 0 0 0 0 0 1 1 0 0 0 0 1 1 0 0

Viewports: You can use the %

fn

code in your string text coding in a variety

of ways – as the numeric part of the character code (see “/ Character Code
Indicator”), as a parameter in drawing a line or placing text (see “Draw Line
Codes” and/or “Plot Line Codes”), or as a parameter for color coding (see
“Change Color Codes”). Refer also to “Text and Tool Viewport Examples”
for an example of using the formula indicator.

You can add the “–” (minus) sign as a prefix (as in

%

5

) to the formula

indicator, in order to use the negative of the specified formula result value
(this can be practical, for instance, if you are using a formula result as a
parameter in drawing or plotting a line).

# (Index) Character

The

#

(index) character is intended to be used along with the

Repeat String

feature (see also

Repeat String

later in this chapter). When the

#

is placed

in the string text, the Color CVIM module replaces the

#

in the output with

the current index value.

Advertising