NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I pass an array of clusters as a parameter from LabView to a TestStand sequence?

Hello everyone,

I've put together a VI that remotely executes a TestStand sequence by looking at the API examples that TestStand comes bundled with. That works without issue and I can run a simple sequence from top to bottom.

 

Now, I've begun modifying the VI to pass an array of cluster data to TestStand's IEngine.NewExecution function.

To do this I:
Create a new array of clusters using IEngine.NewProperty.
Set the size of the array using PropertyObject.SetNumElements

 

And for every index I:
Index the array using PropertyObject.SetSubPropertyIndex

Write values to the index using PropertyObject.SetValWhatever (where "Whatever" is the appropriate datatype I'm writing to).

 

However, I get an error whenever I index the array:

 

Error -17301 occurred at Specified property index '-1' is not valid. Index must be between 0 and 18446744073709551615 in RunTestSequenceWithParams.vi->RunTestSequence.vi

 

I'm hoping someone could review my block diagram and TestStand parameter configuration and tell me if I'm doing something wrong. I have tried many different things and the most useful information I've been able to find has been here:

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9KLSA0&l=en-US

Download All
Message 1 of 4
(4,197 Views)

Hello,

 

NewPropertyObject allow you to create an array of container. Then SetNumElements allow you to size this array.

 

To set data in this array, you can use GetPropertyObjectByOffset to access each element of the array (instead of SetSubPropertyIndex). Elements you are getting this way are containers. Then use "SetValWhatever" on these container reference (PropertyObject)... and that's it !

 

This is working for me :

 

 

GetPropertyObjectByOffsetGetPropertyObjectByOffset

Note : I used the Context as input parameter to get it work easely in a test sequence. This VI generates an array named TriggerData in the Locals.

 

Best regards,

Message 2 of 4
(4,132 Views)

Mathieu,

Thank you for your response!

 

I will attempt your method of building the PropertyObject later today and get back to you.

 

Unfortunately, I do not have access to a sequence context since I am loading the sequence into memory and executing it myself using the TestStand API. Ultimately, I am trying to call IEngine.NewExecution and passing the array of containers in as sequenceArgsParam so that the test sequence can begin working on the data I pass into it.

I've attached a screenshot tho show what I'm trying to do with the object.

0 Kudos
Message 3 of 4
(4,104 Views)

,

 

I only used Context for testing purposes. But as long I can get the Engine, the logic of building a PropertyObject is the same. In your case, just forget the GetEngine method call and the Set Property Object VI: you start with the Engine reference, and end with the NewExecution method instead (don't forget to close the reference passed as sequenceArgsParam after NewExecution method call).

 

According to the documentation of NewExecution Method, I guess that the "top-level" PropertyObject will be the Parameters "container" of your sequence. So you have to add the parameters of your sequence under this top-level container.

 

Build Parameters with array of container - Method 1Build Parameters with array of container - Method 1

You can also use another strategy, building a lookup string that include the index, i.e. [N].SubPropertyName

 

Build Parameters with array of container - Method 2Build Parameters with array of container - Method 2

It should be also possible to set it from the top-level PropertyObject reference, using the lookup string like TriggerData[N].SubPropertyName (you still have to set the number of element of the array, I guess - not tested).

 

Regards,

 

Note : I used LabVIEW 2016 code snippets in this post, instead of basic screenshot. You may be able to insert it in a block diagram...

0 Kudos
Message 4 of 4
(4,075 Views)