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.
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.
05-19-2020 08:23 AM - edited 05-19-2020 09:20 AM
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...
Solved! Go to Solution.
05-19-2020 09:31 AM
This VI better demonstrates what I would like to have.
05-19-2020 04:11 PM
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:
Hope this helps,
05-20-2020 02:05 AM - edited 05-20-2020 02:06 AM
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.
05-20-2020 09:42 AM
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:
I merged the errors in order to ease bebug of the sequence (not so easy to get it work).
Best regards,