Strings in Teststand Are Being Cut at Every Occurrence of \0

Updated Oct 13, 2023

Reported In

Software

  • LabVIEW
  • TestStand

Issue Details

Sometimes I get strings containing \0 that I must read. This is read by LabVIEW code and passed to TestStand, but it seems like TestStand cuts the string at \0. 
How can I solve this?

Solution

TestStand strings are NULL terminated and hence it is seeing the \0 as the end of the string. 
You can pre-strip the NULL and replace with a different delimiter, or make it an array of strings (implicit delimiter is the elements).

Alternatively, if you are using a binary string, you can set the string to be a binary string in TestStand.
KCS TS Image.png

Additional Information

Depending on why the string needs passing back, you can change it to an array of numbers, but that becomes a pain if the strings are long or need resolving or comparing. You need to do that in the language of choice.
Very few instruments have this behaviour unless you're in binary mode or you're asking for multiple responses in one command out (concatenated commands) or your read is not 1:1 with the request for information.