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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Choose Implementation

Hi everybody, I would ask you some about how to implement on a Labview, how to create a Choose implementation dialog box, a step-by-step manual of how to create this dialog box would be very useful 

 

0 Kudos
Message 1 of 5
(2,342 Views)

Hi LDSaldo,

I think first you must define for us what a "Choose implementation dialog box" is. Then you should attempt to code it up yourself and post your code. It's ok if the code does not run, we can point you in the right direction.

Also, make sure to keep your question focused on the end goal, there is often a simpler way of doing something when you don't get caught up on the details.

0 Kudos
Message 2 of 5
(2,336 Views)

If you're using LabVIEW 2019, I'd suggest taking a look at the C:\Program Files (x86)\National Instruments\LabVIEW 2019\resource\Framework\Providers\LVClassLibrary\ChooseImplementation directory.

 

This contains the LabVIEW (G) code used by a project provider to implement the dialog that appears when you open a dynamic dispatch VI for which multiple implementations are possible in LabVIEW 2019. Unfortunately some most of the VIs are locked, but it might get you started on some details.

 

Urgh. Ok, well, then I guess I'll fall back on - what are you trying to do?

 

You can create dialog boxes by creating a new VI that is set to open the front panel when run, close (or return to original state) on end, and contains an Event Structure with an Ok button (and optionally Cancel button) as the only option(s) to trigger an event, and then work from there if you need a more complicated dialog.

 

In terms of choosing between implementors of some behaviour, in current LabVIEW we'd usually use dynamic dispatch and multiple children of some "abstract"(ish) class to do that, so you can use things like Get LV Class Name and/or Get LV Class Default Value By Name to get names of loaded options, or get classes by known name, then output the object along a parent class wire type to code that does something with it. This essentially is a Factory Pattern implementation.

 


GCentral
0 Kudos
Message 3 of 5
(2,293 Views)

Hi Gregory 

I have several libraries in wich I use Different Classes dynamic dispatch VI`s, when making a package library I thought I could do the pop up as it appears in the attached image it would be helpful how to do that exampleChoose Implementation.JPG

0 Kudos
Message 4 of 5
(2,274 Views)

That is a tree control, filled with (a hierarchy of) items.

 

You can get the class hierarchy and member VIs from the project. This will still work in an executable (when done correctly). If you load packed libraries dynamically, you should be able to get the hierarchy information.

 

So, with VI Server, a tree control, some determination and a little help (optional), you should be able to make a similar dialog.

0 Kudos
Message 5 of 5
(2,225 Views)