Movicon Help on Line - Rel. 11.7.1301
Some fields displayed in the project allow data formats according to their needs. You can select a format from those listed below according to the control or data type to be displayed:
The different types of predefined Movicon formats are:
"x", "xx", "xxx", "xxxx", "xxxxx": where the x number identifies the minimum integer figure to be displayed, independently form the value. Zeros are added before the number to reach the figure chosen.
"x.x", "x.xx", "x.xxx", "x.xxxx", "x.xxxxx": where the x number after the decimal point indicates the number of decimal figures to be displayed
"x,xx" ,"x,xxx", "x,xx.x", "x,xx.xx", "x,xx.xxx", "x,xxx.x", "x,xxx.xx", "x,xxx.xxx": where the comma puts figures into groups. For example you can have groups of thousands, hundreds, etc.
When using the "x.x" decimal figure format its meaning changes according to variable type whether being "integer" or "floating point". When being an "integer" number, the value can be displayed as a decimal (divided by 10,100,etc.), but only for "Display", "Meter", "Trend" and "Data Analysis type objects. For all the other objects, such as Basic Shapes, Charts, etc., just add the same number of "0"s as there are "x" after the dot, leaving the displayed numeric value unaltered. When being a "floating point" number, the selected decimal numbers will be displayed and the last figure will be rounded off based on the non displayed remaining figures.
Some objects/functions also support the option to group figures such as the the thousands. The format are the ones that use the comma (x,xx, x,xxx). These formats are not support by the following objects/functions:
Editable Displays
Meter Scales
"Text - Show Value" Animations
Numeric Pad (called from display or from button)
Variable Watch Window
Dynamic Object Tooltip
Trace Comment Window (Audit Trail)
Write/Reading values in RealTime ODBC
Recipe Manager Object
You also can add the desired measures to the predefined Movicon formats. This is done by simply adding a space and then the text desired after the format (i.e. "x.xx mm", "x,xxx.x Kg", etc.).
Example 1
If you want to display a value formatted with three figures, select the "xxx" Format. The result will be according to how the variable's value is:
Variable Value |
Value Displayed |
1 |
001 |
10 |
010 |
100 |
100 |
Example 2
If you want to display a value formatted with two decimal figures, select the "x.xx" Format. The result will be according to how the variable's value is:
Variable Integer Value in Meters, Trend, Data Analysis displays |
Value Displayed |
1 |
0.01 |
10 |
0.10 |
100 |
1.00 |
|
|
Variable Integer Value in other objects (Basic Shapes, charts, etc.) |
Value Displayed |
1 |
1.00 |
10 |
10.00 |
|
|
Variable Float Value |
Value Displayed |
1.2345 |
1.23 |
|
When using formats with decimal figures applied to integer Variables, only their display and not their contents can be edited. In practise divisions of 10, 100, etc., is only for graphical displaying purposes and does not influence the real value of the variable in any way. |
Example 3
If you wish to display a value formatted with a decimal figure and groups of hundreds, select the "x,xx.x" format. The resulted will depend on the value and the variable type:
Integer Variable Value in displays Meters, Trend, Data Analysis displays
|
Displayed Value |
10 |
0.1 |
1000 |
1,00.0 |
10000 |
10,00.0 |
|
|
Integer Variable Values in other objects (Basic Shapes, charts, etc.) |
Displayed Value |
1 |
1.0 |
10000 |
1,00,00.0 |
|
|
Float Variable Value |
Displayed Value |
1234.567749 |
12,34.6 |
Formats for Numerical values and strings
The type of syntax supported for doing custom formats is as follows:
%[flags][width][.precision][{h | l | L}] type
Each field of the above syntax is a single character or a number indicating a certain option of the selected format. The most simple formats contain only the percent sign and a character indicating the type (eg. %s). The optional fields, which appear before each character indicating the type, control the other aspects of the format. If the per cent sign is followed by a character that has not meaning as a format character, it will get inserted in the output string. For instance, in order to print the "%" you will need to write "%%".
flags |
Controls the presence of the sign, spaces, decimal characters, hexadecimal or octal or prefixes:
+: the sign is put in front of the value (+ o -). Only the - sign is returned for default.
0: When the field width is preceded by "0", the "0" characters are used for reaching the number of characters requested
#: when used with the "0", "x" or "X" formats, the "0", "0x" or "0X" prefixes are put in front respectively; when used with the "e", "E" or "f" formats it forces the presence of the decimal character no matter what; when used with the "g" or "G" formats it forces the presence of the decimal character without cutting off the initial zero
|
width |
An integer signed value indicates the minimum number of characters to be printed. When the characters to be printed are lower than the number specified, spaces are added until the value provided is reached. When the width value is preceded by "0", the "0" characters are used instead of the spaces.
|
precision |
An integer signed value preceded by the point (.) indicates the number of characters after the decimal character for those formats with decimals or the number of figures to be printed for integer formats.
|
type |
indicates how to interpret the associated variable. The following formats are available:
In front of the character indicating which type, if this data type allows it, you can put the "h", "l" or "L" prefixes indicating:
|
|
Formats in Hexadecimal are not supported by the "Display" object's "Value Format" property. This format can only be managed in objects in read only, using the "Text -Display Value' animation property. This animation property can also be set in "Display" objects to display hexadecimal values, but only when the variable has not been set as "Tag Display"and only in the "Text -Display Value' animation property. |
Formats for Date and Time values
The Date and Time values can be formatted using the following syntaxes:
Code |
Meaning |
%a |
Abbreviated name of Weekday |
%A |
Complete name of Weekday |
%b |
Abbreviated name of month |
%B |
Complete name of month |
%c |
Local Time and Date |
%d |
Day of month expressed in numbers (01-31) |
%H |
Time expressed in 24 hours ( (00-23) |
%I |
Time expressed in 12 hours (01-12) |
%j |
Day of year expressed in numbers (001-366) |
%m |
Month expressed in numbers (01-12) |
%M |
Minutes expressed in numbers (00-59) |
%p |
A.M./P.M. indicator for 12 hr representation |
%S |
Seconds expressed in numbers (00-59) |
%U |
Weeks of the year expressed in numbers, with Sunday as first day of the week (00-53) |
%w |
Days of the Week expressed in numbers (0-6; Sunday = 0) |
%W |
Weeks of the year expressed in numbers, with Monday as first day of the week (00-53) |
%x |
Local date |
%X |
Local time |
%y |
Year expressed in numbers without specifying century (00-99) |
%Y |
Year with century expressed in numbers. |
%z,%Z |
Time difference abbreviated or in full |
%% |
Percentage sign |
The '#' character can be used for further modifying some formats to get the following results:
Code |
Meaning |
%#a, %#A, %#b, %#B, %#p, %#X, %#z, %#Z, %#% |
The "#" character has no meaning to these formats and therefore will be ignored |
%#c |
Local date and time in full format. Example: "Friday, August 06, 2004, 08:48:55" |
%#x |
Local time represented in full format. Example: "Friday, August 06, 2004" |
%#d, %#H, %#I, %#j, %#m, %#M, %#S, %#U, %#w, %#W, %#y, %#Y |
The "#" character in these formats deletes any zeros preceding figures. Example: "05" becomes "5" |