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.
09-06-2016 06:46 PM
Using scripting, I can create typedefs and save them. I can create a control, open the typedefs and insert them into a cluster in the new control. But they are just clusters in the cluster and lose the connection to the typedef. I need to keep them as typedefs. I can do it manually by creating the cluster and dragging the typedefs in from a project, but can't get scripting to do it. Any brilliant scripters there?
Solved! Go to Solution.
09-07-2016 09:13 AM
This works for me:
How were you doing it?
09-07-2016 09:24 AM
Great start, thanks. But now I want to add several more typedefs into the same cluster. Here, the NewViObject won't work, so I was using the Move method for the typedef cluster, with the owner being the main cluster. This works but inserts them as clusters, not typedefs.
I think I can make it work with the Move, then Replace method - still working the flow. Fortunately this is in a system setup procedure and not where performance is an issue.
09-07-2016 09:43 AM
(Hate to reply to myself) but that worked. Akward, but works.
Using LV Scripting:
-Create Cluster
-Create Typedefs
-Cluster->Move typedef into cluster (set owner as cluster)
-Get refnum (Open VI Object Reference) to cluster formerly known as a typedef
-Cluster->Replace with path to typedef
I now have a cluster full of typedefs.
If there's a better way, please let me know.
09-07-2016 10:56 AM
... and I would suggest you mark your (previous) response as the "Solution", just in case someone else has the same (or related) issue. Congratulations on your persistence and willingness to "experiment".
Bob Schor
09-07-2016 12:21 PM
I don't know why you think that "NewVi Object" won't work; it works just fine:
09-07-2016 12:24 PM
I suspect that the reason you're not getting typedefs is that you are moving/copying a control from the FP of a typedef (which is not typdef'd) rather than moving/copying a control that is an instance of a typedef.
09-07-2016 01:11 PM
Pretty obvious why I didn't think it would work - cause I didn't think! Doh!
I Assumed it would create an additional cluster each time, and didn't test it.
Thanks for correcting me