NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert Structure/Array to Strings from TestStand ?

Solved!
Go to solution

Hi evryone,

 

Context :

I actually use the software TestStand from NI.

I use it to sequence the execution of binary files on remote machines. eg : 

begin

step 1 : init.exe (param01, param02, param03) on MACHINE_A

step 2 : action1.exe (param04) on MACHINE_B

step 3 : action2.exe (param05, param06) on MACHINE_A

end

 

Problematic :

So, I would like to pass any type of parameters in order to correctly call my binary files.

Eg, I would like to pass Array and Structure parameters to my binary files.

I know it is possible to create Array and Structure in TestStand environment.

 

However, it is impossible to send in parameters Array and Structure variables to binary files.

Because binary files only accept in native Strings and Integer variables.


ArrayStruct_parameters.JPG

 

 

My need :

 

So I would like to call the function Str() from TestStand, in order to parse Structure/Array to Strings.

 

but I don't Know how to use this function to achieve my objective.

 

Is there someone who can help me about it ?

 

Thank you in advance.

0 Kudos
Message 1 of 4
(4,909 Views)

Hi,

 

Did you use those binary files with different interface (not TestStand)? How did you pass those Arrays and Structures then? Did those Arrays were somehow flattened to string format or maybe different conversion were made? 



0 Kudos
Message 2 of 4
(4,900 Views)

 

That is exactly what I want to implement.

For the moment, I can not pass Array and Structure variables in parameters.

 

But I wish find an internal function available in TestStand environment in order to parse Array/Structure to Strings.

0 Kudos
Message 3 of 4
(4,889 Views)
Solution
Accepted by topic author fab34430

Try:

 

Engine.SerializeObjects() --- the options parameter can specify whether you want to serialize as binary (fastest), xml, or ini. In all three cases the end result is a string you can then use with Engine.UnserializeEx().

 

Or

 

PropertyObject.Serialize() -- This only supports ini format and serializes the object you call it on. Use PropertyObject.UnserializeEx() to convert it back.

 

Hope this helps,

-Doug

Message 4 of 4
(4,884 Views)