Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Contact Us
  • Home
  • Products
  • Automation Systems
  • Human Machine Interfaces (HMI)
  • NA

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

Written by Arlo D'Cruz

Updated at February 8th, 2024

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Products
    Automation Systems Control Components Motion & Drives Quality control & Inspection Robotics Safety Sensing Services Software Switching Components
  • Amplify e-Store
    e-Store public
  • Public CSC
+ More

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:

As the custom display field can hold a combination of string data and value data, an identifier is required to identify where to insert the value. NA uses Visual Basic .NET framework so it uses the same placeholders. In this case the value data is inserted by adding {0:XXXX} where XXXX is your numeric format as described below. 

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.

Examples

{0:##.##} will display '12.24'

{0:##} will display ‘12’

{0:000.000} will display ‘012.240’

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:

 

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'

Further Information

If you want to learn more about Custom Numeric Format Strings, please read this Microsoft article.

 

Warning

Any text entered this way will not be added to The NA Resources and will not be translatable. 

 

 


 

data objects custom formatting customdisplayformat

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • NA Screen - Switch to the Home Screen after x time of inactivity
  • How to Create Character Literals in Sysmac
  • How to Use Special Characters in Sysmac
  • Obtaining your NA HMI IP address at runtime

Definition by Author

0
0
Expand