Industrial Automation
Industrial Automation | Europe

myKnowledge

Main > Product Type > Automation Systems > HMI > NA
Minimize Text   Default    Enlarge Text
 

Print
E-mail

How To Use Custom Format And Text In Data Display And Data Edit Objects In NA HMI


Data Display and Edit Objects allow you to format how the value is displayed on the NA screen using the 'ValueFormat' property. Sometimes it is necessary to fully customise the field so it displays a mixture of text and the value formatted in a specific way. This article shows how to use the custom format on a Display or Edit object.
 
Once you have selected the Display/Edit object, change the 'ValueFormat' property to 'Custom' as shown on the picture below:
 
Once 'Custom' format is selected you can choose your format and do further customization in the field provided:
 
 
 
Text Customization

It is possible to add additional text that will be displayed in Data Edit and Data Display. 

The correct syntax to do that is as follows:

myText {0:my format} myText.

So if you edit your Data Display or Data Edit object in  the is way:

the  NA Runtime will look as follows:

Difference between "0" and "#"

"0" - Replaces the zero with the corresponding digit if one is present; otherwise, zero appears in the result string.

"#" - Replaces the "#" symbol with the corresponding digit if one is present; otherwise, no digit appears in the result string.

Other Examples:
  • Current Speed = {0:##,###} widgets\hour will display 'Current Speed = 12,345 widgets\hour'
  • Current Speed = {0:0} widgets\sec will display 'Current Speed = 7 widgets\sec'
  • Current Speed = {0:00.000} widgets\sec will display 'Current Speed = 07.444 widgets\sec'
Note 1: If you want to learn more about Custom Numeric Format Strings, please read this Microsoft article.
Note 2: Any text entered this way will not be added to The NA Resources and will not be translatable. To learn more about NA resources please read 'Understanding NA Resources' article.
See Also:

Introduction to the NA series HMI




Comments (View All Comments / Add Comment)

Related Articles
No related articles found.
Created 2014-08-11
Modified 2015-04-08
Views 13397

 

You are not logged in.