Text

In the dialog for configuring visualization elements, you can specify a text for the element in the Text category. This can be entered directly or/and a variable can be defined which will determine the text string. The usage of placeholders ( Placeholder) is possible. Also the default settings for font and alignment are done here.

Note

As soon as text parameters are additionally provided dynamically, which means by a system or structure variable (see Textvariables resp. ‘Programmability’), the static definitions which are done in the currently opened dialog , will be overwritten!

In case of multiple definition of an element property consider the specific order of precedence concerning according to which a value might be overwritten in online mode by another.

../_images/720da5139151e0cc0a317f3412deb566

Enter the text in the Content field. With the key combination Ctrl + Enter you can insert line breaks, with Ctrl + Tab, tab stops. Besides the input of a pure text string you can use the following formatting sequences (via button the corresponding online help page can be opened):

../_images/6b1ccc184377ecfe0a3313905c72d969
  • If you include “%s” into the text, then this location, in Online mode, will be replaced by the value of the variable from the Textdisplay field of the Variables category. Instead of “s” you also can use other formatting strings conforming with the standard C-library function ‘sprintf’: See here a sample list of strings and arguments:
Character Argument / Output as
d,i Decimal number
o Unsigned octal number (without leading zerol)
x Unsigned hexadecimal number (without leading 0x)
u Unsigned decimal number
c Single character
s String
f

REAL-values;

syntax: %|<alignment><minimal     width><accuracy>|f

Accuracy defines the number of decimal places behind the comma (Default is 6). Example see below.

Note

- If you want to get displayed a percent sign% combined with one of the formatting strings mentioned above, you must enter “%%”. For example: Enter  “Rate in %%: %s” to get displayed in online mode “Rate in %: 12” (if the text display variable currently is “12”).

- Be careful with letter case: capital letters, i.e. %S instead of %s not acceptable.”

The value of the variable will be displayed correspondingly in online mode. You can enter any IEC-conforming format strings, which fit to the type of the used variable.

Note

It is not checked whether the type which is used in the formatting string matches with the type of the variable which is defined in the ‘Text Output’ field!

Example:

Input in the ‘Content’ field: Fill level     %2.5f mm

Input in the ‘Textdisplay’ field (variable of type REAL),  e.g.:plc_prg.fvar1

-> Output in online mode e.g.: Fill level     32.8999 mm

  • If you enter “%t”, followed by a certain sequence of special placeholders, then this location will be replaced in Online mode by the system time. The placeholders define the display format, see the following table.

Note

Do not insert any other characters before %t in the ‘Content’ field (in contrast this is allowed for e.g. “%s”, see above)

%a Abbreviated weekday name
%A Full weekday name
%b Abbreviated month name
%B Full month name
%c Date and time representation appropriate for locale
%d Day of month as decimal number (01 ““ 31)
%H Hour in 24-hour format (00 ““ 23)
%I Hour in 12-hour format (01 ““ 12)
%j Day of year as decimal number (001 ““ 366)
%m Month as decimal number (01 ““ 12)
%M Minute as decimal number (00 ““ 59)
%p Current locale’s A.M./P.M. indicator for 12-hour clock
%S Second as decimal number (00 ““ 59)
%U Week of year as decimal number, with Sunday as first day of week (00 ““ 53)
%w Weekday as decimal number (0 ““ 6; Sunday is 0)
%W Week of year as decimal number, with Monday as first day of week (00 ““ 53)
%x Date representation for current locale
%X Time representation for current locale
%y Year without century, as decimal number (00 ““ 99)
%Y Year with century, as decimal number
%z, %Z Time-zone name or abbreviation; no characters if time zone is unknown
%% Percent sign

Examples:

%t%a %b %d.%m.%y %H:%M:%S

-> Display in online mode: Wed Aug 28.08.02 16:32:45

Between the placeholders you can insert any text strings:

%Today is %d.%m.%y

-> Display in online mode: Today is 28.08.02

Note

If a text string is to be transferred into a translation file, which will then be used in Online mode to enable switching into another national language, it must be delimited at the beginning and end by #.

Examples: “#Pump 1#” or else even “#Pump# 1”.

The second case might for example in the event of multiple occurrences of the text Pump (Pump 1, Pump 2, etc.), prevent multiple appearances in the translation.

  • If you include”%<PREFIX>” into the text, you can enter instead of “PREFIX” a certain string, which will serve as an identifier concerning the use of dynamic texts. The prefix will be used together with an ID number, which is to be defined in the ‘Variables’ category of the configuration dialog in field ‘Textdisplay’. The combination references to a certain text, which is defined in a xml file available for this purpose and listing all possible dynamic texts. Thus at run time the text which is indicated by the current ID-Prefix-combination will be displayed. For further information see also the description of Language Switching ( Language Switching). See there also information on the usage of Unicode-Format.

The configured text will appear online in the prescribed alignment within the element: horizontally left, center or right and vertically top, center or bottom.

Via button Font the dialog for font selection will appear. Choose the desired font and confirm with OK. (The list of offered fonts depends on the target system.) The Standard-Font button can be used to assign the currently valid standard font to the element. That is defined in the visualization settings in category Display ( ‘Extras’ ‘Settings’).