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.
03-26-2019 09:55 AM
Hi,
I am trying to create control dynamically on front panel using VI scripting.
Attaching code for creating combo class.
Problem is combo box is created in new VI while I want to create it in same VI in which I have written my code in block diagram.
It is giving an error 1000.
Please assist.
03-26-2019 10:50 AM
You're not going to be able to script yourself because a VI can't be edited if it is running.
03-26-2019 11:57 AM
Put another way. Scripting can only do what you can do. It is like a robot doing the work you would normally do. But adding controls to a running VI is not something you can do, it changes the code and needs a recompile, which is why when a VI is running, or reserved to run, edits aren't allowed.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-26-2019 01:54 PM
@Hooovahh wrote:
Put another way. Scripting can only do what you can do. It is like a robot doing the work you would normally do. But adding controls to a running VI is not something you can do, it changes the code and needs a recompile, which is why when a VI is running, or reserved to run, edits aren't allowed.
It is possible to fake it out and edit a running VI; but it almost always leads to a LV crash.
03-27-2019 04:26 AM
@Jacobson-ni wrote:
You're not going to be able to script yourself because a VI can't be edited if it is running.
Thanks @jacobson for your inputs.
03-27-2019 05:13 AM
Thank you for your inputs. I think it might not possible to create new objects on same FP.
03-27-2019 05:38 AM
Here're some workarounds:
1) avoid dynamic controls.
For instance, use a tree control, that shows all items (settings?) as tree item. When clicked, show the type of control and let the user edit it.
Hard to advice on this without the specific problem.
Combined with right click menus, tree controls, listboxes, etc. can be really convenient to solve complex GUI problems.
2) use sub panels.
Put 2000 (the maximum nr. of dynamic controls) on the FP. Then, position the required nr of subpanels correctly and fill them with predefined controls (or vice versa). You'll have a reference to those controls, and you can get dynamic events from them to do pretty much everything you'd want. SP are surprisingly efficient, there would be hardly no overhead.
The only problem is that non-square controls (could just as well be VIs) can block mouse input to controls in the same rectangle (because the subpanel is square).
03-27-2019 08:24 AM
@Amit_Amrutkar88 wrote:
Thank you for your inputs. I think it might not possible to create new objects on same FP.
Correct there are only a few things that you can change in a VI when it is running:
03-29-2019 05:12 AM
Just to mention, this terrible inconvenient limitation is resolved in NXG.
Not that I'm suggesting to switch to NXG now, but now that this problem will eventually be fixed.
Finally...