10-05-2012 09:10 AM
Darin K provided a workaround that gets me what I need: http://forums.ni.com/t5/LabVIEW/Select-Control-Label-with-VI-Server-Scripting/m-p/2176698#M699729
I was really hoping the Label.Select would have worked.
03-15-2013 12:37 PM
Thanks to the examples i can create an Enum using scripting. Is there any way to save it programmatically?
03-15-2013 12:38 PM
Use the Save Instrument method.
03-15-2013 01:53 PM
When i attempt to wire in the Save Instrument method, LabVIEW reports it as an invalid method.
03-15-2013 03:12 PM
I'd do it like this:
03-18-2013 08:10 AM
Darik.K gave you the full correct solution, but I would like to clarify things a bit. If you want to save any custom control (such as an enum), you need to actually create a custom control (which is a variant of a VI, see Darin.K's example). The easiest way to do this is to create the custom control first, then drop it on your front panel using the New VI Object primitive and specifying the path to the custom control as the input. The key point is that the custom control is a separate item from the VI you are using it in.
03-18-2013 08:27 AM
Thanks for the reply. I got it to work using scripting, then realized that i didn't need scripting to do what i wanted to do. I was suprised to find out that i can modify an enum using VI server and then save it programmatically. Seems unusual that NI would allow that, but if it is a bug, i don't want it fixed. It saves me a lot of headaches!
06-28-2013 09:19 AM
Ok, so I created a strict typedef of an array of clusters using scripting, set the default value, and saved it to a file. When I open the file, the typedef looks right and contains the default value that I set in the creation script. In the same code, I create a new VI from a template, and create a constant on the block diagram using the new VI scripting function, and passing it a path to the newly created strict typedef. The constant has the right structure, but is an empty array. If I run the part that creates the VI a second time (After the code stopped, I assume that clears stuff from memory) the new VI now has a constant WITH data.
Can anyone tell me how to get this to work the first time? Is there a way to flush the typedef from memory before I create the sub-vi that I want to place it in as a constant?
Thanks in advance,
David Dupont
06-28-2013 01:21 PM
Figured it out. If you are diligent about closing your references when you're done with them then things work more like you want them to.
Thanks anyhow.
David
08-27-2013 02:51 PM
Can I access the Tools Palette through scripting? I have two monitors at work, but ocassionally bring my laptop home where I dont have a second monitor. If I had my tools palette open on my second monitor at work, and then try to do some work at home, no more tools palette without a LabVIEW restart. If I can access it, I would like to programattically change its position, perhaps via a quickdrop plugin...