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

Updated Mar 21, 2018

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). A useful further resource is Share Binary Data Containing Multiple NULL '\0' Characters to a TestStand Local Variable

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 / 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. 

WAS THIS ARTICLE HELPFUL?

Not Helpful