NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does flatten to string data not get passed around in TestStand via a string local variable?

Solved!
Go to solution

I have been attempting to pass around a cluster of data in TestStand as a string using LabVIEW's 'flattened to string' function. When I create a local variable in TestStand of 'string' data type and attempt to write the flattened cluster to this it simply does not get passed. If I convert the flattened string to a binary array and then pass this around I can recover the cluster of data just fine.

 

Is there something I am missing here?

 

I have attached an example Teststand sequence that demonstrates this issue. If you run this sequence the 1st test will fail which is the attempt to simply pass the data structure as a flattened string and the 2nd test will pass as this is the binary array I generated from the flattened string.

 

Thanks,

Pete

 

0 Kudos
Message 1 of 5
(5,027 Views)

attachment included this time...

0 Kudos
Message 2 of 5
(5,026 Views)

If I had to take a guess, I would say it is because your first byte is a NULL character.  If TestStand follows a C paradigm, then a NULL signals the end of a string.

 

Why not just make a Container in TestStand and pass that around?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 5
(5,022 Views)
Solution
Accepted by topic author plf

crossrulz is correct.  The Null character is affecting how TestStand is handling the string.  You'll have to specify the string to be a binary string in the parameter list for both of the VI's.  TestStand then encodes the string so it can prevent data loss. 

 

If you need to operate on the binary string within TestStand you'll have to convert it to a raw data array with PropertyObject.GetValBinary.

 

BinaryString.png

Message 4 of 5
(4,995 Views)

That was simple enough!

 

paulmv... thank you for clarifying on crossrulz's response.

 

 

0 Kudos
Message 5 of 5
(4,988 Views)