Using Format Specifiers - Omron CX-Supervisor User Manual

Hide thumbs Also See for CX-Supervisor:
Table of Contents

Advertisement

Embedding Point Values in Text

3-13-1 Using Format specifiers

The shift foreman was Fred Smith
and
The shift output was ((ShiftOutput)) litres
becomes:
The shift output was 5000 litres
Format specifiers can be used, similar to the Format script command:
%s for text string points;
%d for integer points;
%f for real floating points.
Where 'MyTextpoint="Hello"':
The text of (("My text point is %s",Mypoint))
becomes:
The text of My text point is Hello
Where MyRealpoint=5467.7658:
To two decimal places the value of MyRealpoint is
(("%4.2f",MyRealpoint))
becomes:
To two decimal places the value of MyRealpoint is
5467.76
Combinations of format specifiers are possible:
((%s to two decimal places the value of MyRealpoint is
%4.2f",MyTextpoint,MyRealpoint))
becomes:
Hello to two decimal places the value of MyRealpoint
is 5467.76
The can be used in various fields, for example:
In Alarm Raised and Cleared Messages e.g.
Alarm Raised: "Boiler Temperature too high. Current
value is (("%.1d", BoilerTemp))"
As captions for popup edit box animations. This is useful as the captions
are then dynamically translated e.g.
Caption: "((CaptionString))"
As parameter to MessageBox. This is useful to help convert numbers to
strings e.g.
MessageBox("Error ((ErrorNum)) occurred")
As parameter to LogError or LogEvent. This too is useful to help convert
numbers to strings e.g.
LogError("Error ((ErrorNum)) occurred", priority)
Titles in Graphs and Charts (useful for translations again) e.g.
Title: "((TitleString))"
In Tooltips, for dynamic information
Tooltip text: "((ToolTipString))"
In Report templates. See Script Reference GenerateReport() for more
information.
SECTION 3 Points
51

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 3.1

Table of Contents