03-21-2011 01:11 PM
Here it is but it's not what you want. This just makes an already existing array control visible and sets the number of elements.
What you want to do appears to be in the realm of modifying the language itself. Scripting is the only real solution so you need to prepare to deal with some pretty advanced programming concepts.
03-21-2011 01:18 PM
As mentioned before, you cannot dynamically create native controls on the front panel of a running VI. Doing so changes the VIs code, causing it to need a recompile. However, you can put a picture control on your front panel and do just about anything with it. Picture controls have a fairly good set of user events, so you can create "controls" and "indicators" on the fly, subject only to your drawing and interrupt handling expertise. Of course, this is not a trivial task. It does, however, get around the dynamic control issue.
03-21-2011 01:20 PM
If you are not familiar with LV then scripting (which amounts programming the steps you would do if wiring the VI yourself) is not a good option. There are other options but lets first see if the simple approaches will get you where you need to go.
Explore the examples tht you have been given so far and let us know why the dod not meet your needs.
There are otther approach (besides scripting) tha can be used but again, walk first then run.
Ben
03-21-2011 01:25 PM
@DFGray wrote:
As mentioned before, you cannot dynamically create native controls on the front panel of a running VI. Doing so changes the VIs code, causing it to need a recompile. However, you can put a picture control on your front panel and do just about anything with it. Picture controls have a fairly good set of user events, so you can create "controls" and "indicators" on the fly, subject only to your drawing and interrupt handling expertise. Of course, this is not a trivial task. It does, however, get around the dynamic control issue.
...and anyone resorting to using the Picture control...
I suggest cheating as much as possible. A simplifying approach would detect the mouse click by the user and then make visable an "off-screen" control of the proper type, and move it to where they clicked and then set the key-focus to the LV control. When done put the control away and use it image in the picture.
The "chaeting part" is using LV to support the widget behaviour rather than trying to code it up using first principles. (been there done that, since the customer was a LV developer themsleves and they explicitly specified he wanted it done the hard way).
Ben
03-21-2011 01:32 PM
Thank you all for help.
I'm not new to LabView, but scripting isn't my competence.
I will try out your suggestions.
Thanks everone!
03-21-2011 02:46 PM - edited 03-21-2011 02:50 PM
@Ben wrote:
...and anyone resorting to using the Picture control...
I suggest cheating as much as possible. A simplifying approach would detect the mouse click by the user and then make visable an "off-screen" control of the proper type, and move it to where they clicked and then set the key-focus to the LV control. When done put the control away and use it image in the picture.
I was intrigued by Ben's suggestion so I threw this together (in LabVIEW 8.2). Set the Number of Controls, run it then click on any "control" to edit the value. There's a fair bit of work to do to put this into production (try adding more controls than will fit on the picture), but it's not a horrible prospect.
EDIT - hit enter to set the value (I hate it that a value change isn't triggered when I click another control).
03-21-2011 02:54 PM
@jcarmody wrote:
...I was intrigued by Ben's suggestion so I threw this together (in LabVIEW 8.2). ...
Full Discloser: JP Drolet was the person that inspired my to take that approach in the first place.
That is method I used to do this VI back in LV 6i (where there was bug where the background color was always black)
Single cell mode.
Multi-cell mode
Ben