08-10-2021 02:53 AM
Here is what I am trying to do. Please comment on how/if I can do it in LV.
I have information of all controls/indicators and their respective data types in LV or in a text file.
Ideally, I want to create a VI for which the user can select which controls to connect to the pane at edit time and then assign the values. (More like a "Read/Write Control" in LV to which the user connects an FPGA interface and then selects which controls/indicators to write/read at edit time).
08-10-2021 03:28 AM
Hi usman,
@usman66 wrote:
Ideally, I want to create a VI for which the user can select which controls to connect to the pane at edit time and then assign the values.
Which "pane" are you talking about? The connector pane at the upper right of the frontpanel or a pane (aka part) of your frontpanel?
To answer your question: You can use LV scripting to edit a VI at edit time…
08-10-2021 10:26 PM - edited 08-10-2021 10:27 PM
Thanks for the reply.
Yes I am referencing to the connector pane.
Let me explain a little more.
I have a lot of controls for which it may not be possible to connect all of those to the connector pane (because it only allows a limited number per VI as I understand).
Also, the user will not be writing to all the controls for one instantiation of that VI. So, I want to give the user a way to specify, at edit time, only those controls that it wants to wire in that instance.
One way could be that I put all the controls in a cluster and then the user can only wire the controls it wants, using "bundle by name". In that case, is it possible to find out at run time, which elements of the cluster did user actually wire? (other than comparing old and new values).
Ideally I would like to build something like a "read/write control" primitive in LV that we usually wire a reference to, and then choose only the controls that we want to update. Is it possible to create a VI that acts more like that at edit-time.
As I understand, VI scripting will only allow me to create a new VI which possibly has only those controls that the user selects a edit time. So, that would require the user to select the controls it wants, then run a VI that creates another VI which will have only those controls.
08-11-2021 01:35 AM
This seems waaaay clunky. There has to be a better way to do this.
08-12-2021 06:15 AM
I don't guess that its the usual/idle way of LabVIEW programming.
If possible try to share the code Snippet/VI for better understanding.
Also check on how to use polymorphic VI,s
08-12-2021 07:27 AM - edited 08-12-2021 07:28 AM
Hi usman,
@usman66 wrote:
Yes I am referencing to the connector pane.
I have a lot of controls for which it may not be possible to connect all of those to the connector pane (because it only allows a limited number per VI as I understand).
Well, you want to write to a (rather) unlimited number of controls using the connector pane - while the connector pane allows "only" upto 28 connections…
There surely are other/better options:
08-12-2021 07:32 AM
I think the whole concept of placing such a huge responsibility on the user to "get it right" is downright dangerous. I mean, I suppose we are all just guessing until we see some code, but there has to be a better way to do this.
Besides, I don't know how IT would feel about letting users modify code on the fly and run it.