LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI with edit time pane connections

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). 

0 Kudos
Message 1 of 7
(1,642 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(1,628 Views)

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. 

0 Kudos
Message 3 of 7
(1,596 Views)

This seems waaaay clunky.  There has to be a better way to do this.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 7
(1,585 Views)

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

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 7
(1,545 Views)

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:

  • use clusters/arrays to bundle related items into some kind of container and so decrease the number of needed connector pane inputs
  • use a variant input with an enum to select which control to change in your subVI (maybe useful for AEs/FGVs)…
  • learn about LV-OOP to use classes and objects: now you can easily change a lot of properties of a single object!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(1,537 Views)

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 7
(1,532 Views)