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
  • Machine Automation Controllers

Using Strings on NB HMI with Sysmac NX/NJ

Written by Arlo D'Cruz

Updated at April 18th, 2023

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

Introduction

When using STRING Data Type on Sysmac NJ with HB HMI, please note the following restrictions:- 

The NB ‘Text Display’ and ‘Text Input’ ‘parts’ enable a user to display and enter STRINGs. However, the NB HMI will always pad any remaining characters with the space character (ASCII - 0x20, or 32 Decimal). 

The Sysmac NX/NJ terminates its strings with a NULL (ASCII 0x00) character. This is the ‘c’ standard of termination for STRINGs. The length of an NB String can only be defined as a number of words in length – meaning that the length of the data will always be an even number of characters. 

If the Sysmac NX/NJ is made to exactly the same number of characters as the NB, then it will fail to read correctly in the NJ. This is because there will be a runtime fault due to there being no NULL terminator. Sysmac NX/NJ must see a NULL to know where the STRING is terminated. Therefore always define the STRING in the Sysmac NX/NJ one byte longer than defined in the NB. 

Solution

When using STRINGs/Text with NX/NJ and NB, always make the NX/NJ STRING at least one character longer than the NB definition.

Example

For example In NB – a Text Input is defined as 5 words (10 characters in length).

In the NX/NJ, define the length of the STRING one character longer than in NB.

NbHmiString is defined AT D0 (%D0) and length 11 characters. So code that works with the STRING entered on the NB HMI will always be terminated correctly (assuming that no other data butts up to the end of the data in %D0).



nx nj nb string text sysmac

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Do I need Power Supply units for my NX CPU?
  • Error codes in Sysmac Studio
  • Major or Minor Revision mismatch for EtherNet/IP Error 0116
  • Ethernet/IP Setup Guide Using Network Configurator
  • EtherCAT Ring Topology FAQ

Definition by Author

0
0
Expand