03-09-2010 01:24 PM
Hi all.
I new to Labview, and I just started playing around with the scripting functionality. Unfortunately, I've reached a road block and I need some help to figure out how to do what I need to do (if its even possible).
Basically, I want to use scripting to copy a cluster containing one or more user generated controls from a VI which is saved on disk into a new VI which I'm creating using scripts. Thus far, I have been able to open the existing VI and grab a reference to the cluster, but I haven't been able to place the same cluster into the new VI (only a generic empty cluster). I'm not concerned about the values inside the controls in the cluster...I just need a cluster with the exact same controls inside of it in my new model.
i.e., If it is a cluster with 3 numerics, 1 boolean and 1 string in that order, I need a cluster created with 3 numerics 1 boolean and 1 string in my new model, but I don't care if the fields are populated with the same values.
It seems the "Open VI Object Reference" node is only used to grab and modify an object within a VI, but can't be used to copy it or move it to another VI. The "New VI Object" node doesn't seem to allow you to specify an existing object to create the new object from. The only possible solution I can think of would be to open the existing VI, and use "Open VI Object Reference" to grab a reference to the cluster. From there, could I create a new cluster, and possibly iterate through all the controls which the existing cluster contains, and copy them into the new cluster?
Of course if there is another solution I'm open to any and all options. Thanks for the help!
03-09-2010 01:31 PM
03-10-2010 09:43 AM
I tried the move and panel select/copy (I couldn't find the paste), but I finally found a solution that works perfectly. There is a VI Invoke method called "Create from Reference" that creates a perfect copy of what I need. Thanks for the help!
06-24-2010 03:01 AM
DFGray, I cannot seem to find Paste either, where is it hidden?
(Using 8.6)
06-24-2010 03:24 AM
Found it!
Of course spending a few minutes actually thinking normally helps ![]()