Using the text format specifier – Echelon NodeBuilder Resource Editor User Manual

Page 66

Advertising
background image

int — The value will be displayed or entered as a

signed, 32-bit integer.

discrete — The value will be displayed or entered
as an 8-bit value that contains either 0 or 1 for

each bit.

text(…) — The text format specifier can be used
for data that is not a simple number

(enumerations, strings, characters, and

structures); for data that must be localized,
scaled, or conditionally formatted; or where data

formatted as text is preferred. The standard
formats defined in STANDARD.FMT are all text
format specifications, since most network tools are

adept at handling text-formatted data, and text-
formatted data may be specified for every data

type. See Using the Text Format Specifier, later in

this chapter, for more details.

Using The Text Format Specifier

The text format specifier has the following syntax: text(<text format list>). The
text format list is similar to the ANSI C printf() arguments, with some simplifications
and extensions. The text format list is a comma-separated list of text formats. Each text

format consists of one of the following:
• A quoted string called a format string. The format string consists of characters to be

included in the formatted output, and may include conversion specifications that

specify how a corresponding field data argument is formatted. A conversion
specification may apply to the entire value to be formatted, or may apply to fields

within the value by adding the field names to the text format list. You can also

include localized list separators in format strings. See Using Conversion
Specifications
and Using Localized List Separators for more information.

• A field name from the value being formatted. The value must be a structure or union

type. Field names are applied to conversion specifications in format specifications

that precede the field name in the text format list, applied from left to right. A

format can display up to a maximum of 127 fields of a structure or array type. See
Using Conversion Specifications for more information.

• A conditional format to specify one of two different formats, where one format is

selected when a value is formatted based on a conditional value. See Using

Conditional Formats for more information.

• A scaling factor to specify a multiplier and adder, and an optional unit string suffix,

that are used to scale the value to be formatted. A scaling factor may be applied to
the entire value, or to an individual field of a structure or union. See Using Scaling

Factors for more information.

• A localized time or date function. These functions format a time or date according to

the user’s operating system’s locale settings. See Using Localized Time and Date

Formats for more information.

Following are a few examples from the standard format file (standard.fmt). See the

standard format file for more examples.

58

Creating and Modifying Resources

Advertising