02-05-2011 02:51 PM
Is there a way to copy a Control to the clipboard? As far as I discovered is is only possible to paste text to the windows clipboard. My intention is to create a little application that finds GPIB-Addresses from a definition file in the network and copies a VISA-Resource Control (or constant) to the clipboard. So, in any VI I can just run my little application which I start from the LabView-Menu, select my Device and have a VISA-Resource Constant or Control in the Clipboard So far the idea. It is possible to copy and paste a control from one VI to another - can this be done programmatically?
Thanks in advance.
Ben
Solved! Go to Solution.
02-05-2011 03:04 PM
No need for anything so complicated. Read the file and populate a combo box by writing to it's Strings[] property.
02-07-2011 02:32 AM
Yes, I know. But if I preferred the more complicated solution: is it possible at all?
02-07-2011 03:27 AM
02-07-2011 03:56 AM - edited 02-07-2011 03:57 AM
Yes, it's possible, with some scripting. This snippet shows how. It creates a constant, but you can paste a constant to a front panel. You can drag this into LV 2009 or later to turn it into functional code. I'm not sure I understand why you want this, though.
02-07-2011 04:35 AM
Looks good. Dragging into LV2010 doesn't work - it's a PNG. Where do I find the second VI on the left (where the enumerator 'VISA Resource Name' is connected to)?
02-07-2011 05:20 AM
Not all browsers support the dragging option. Save the image to your hard drive, then drag it from there into an empty VI.
In general, to access the New VI Object primitive and other scripting options you need to enable scripting in the Options dialog (in 2010, in earlier versions you need to download the scripting API installer separately).