From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert PropertyObject into Cluster/Container

Solved!
Go to solution

Let's say I have a container in TS and code module call (call to a VI). This VI has one input - TS.PropertyObject (Automation Refnum). I pass my TS container to this VI as PropertyObject.

 

Is it possible to now call some method or VI (in LV) to automatically create initial TS container as LV cluster? And later copy values from referenced PropertyObject into this new cluster?

 

I attached some example VI and sequence file. Lets say I want to write PropertyObject value into the error input cluster (see VI).

 

I was thinking that LabVIEW Adapter may have such feature, since when I configure LV code module call, TS automatically links containers with LV clusters (as well other types). I was able to call adapter in LV but I don't see any method I could use...

 

Adapter.png

Michał Bieńkowski
CLA, CTA

Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
Download All
0 Kudos
Message 1 of 5
(2,350 Views)

This VI better demonstrates what I would like to have.

 

VI.png

Michał Bieńkowski
CLA, CTA

Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
0 Kudos
Message 2 of 5
(2,321 Views)
Solution
Accepted by topic author bienieck

Hello Michal,

 

As far I know, there is no direct method to get what you want. I mean, the adapter is able to generate a TestStand type from your LabVIEW cluster. The same kind of operation, from TestStand to Labview would require dynamic cluster creation. That's probably doable by scripting, but I never tried - too complicated, not appliyable to Run-Time deployment, and so on.

 

If you want something generic, you may try to traverse a LabVIEW cluster, using OpenG VCluster palette, and trying to find a matching SubElement in the passed PropertyObject. If my cluster contains a Boolean item (type boolean) and two strings String1 and String2, I will use GetValBoolean and GetValString to retrieve data from TestStand and building the luster using VCluster palettes. The lookup string will be "Boolean", "String1" and "String2", and I need to take care of the data type to use the corresponding GetVal<Something>.

If there is a cluster in the cluster, the lookup string may be somthing like "SubCluster.String3" for instance.

 

The reference of your data structure is the LabVIEW cluster, and you try to retrieve its data from the PropertyObject, according to the LabVIEW reference. That's definitly not immediate !

 

Notes:

  • Naming of elements in the cluster must match naming rules in TestStand (Property object names may contain only letters, numbers and underscore and cannot contain spaces and start with a number)
  • VCluster from OpenG seem to be the only way to build up a cluster from variant, I didn't find a equivalent in native Data Type Parsing palette

 

Hope this helps,

Message 3 of 5
(2,292 Views)

I like this. I already started some workaround with variants, but VCluster sounds even better. Thanks!

 

It's not exactly what I want but for now it will be ok.

Michał Bieńkowski
CLA, CTA

Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
0 Kudos
Message 4 of 5
(2,270 Views)

Michal,

 

You may need some recursive implementation. I didn't resist to try to get it by myself (easy to say it may be possible like this...). So here is an implementation (I didn't handle arrays, but it should be quite easy to add). I attach the source code, saved for LV2015, there is two sub-VIs in a VI (you will need OpenG support).

 

Here is what does look the VI.vi code module diagram:

sample.png

 

I merged the errors in order to ease bebug of the sequence (not so easy to get it work).

 

Best regards,

Message 5 of 5
(2,242 Views)