LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic loading vi with .exe

Hello together,

 

i´m trying to create a kind of "plugin" architecture. My intention is, building an .exe with Labview and then calling Subvi´s dynamicly. The frontpanel of the subvi´s should be loaded into an subpanel. I have a folder in which I save my plugin vis. With "open vi reference" I want to load the vi into the subpanel and with "call by reference" I want to run the selected vi. Everthing is working as i want. But if I build an .exe I cannot run the plugin vis. more precisely everthing works until I have no other subvi´s in my plugin subvi. I don´t want to "always include" the vis because I don´t want to build everytime a new .exe when I have a new plugin vi. I searched the forum but I´m new in programming with labview and I couldn´t find something what helps me to solve this problem.

 

Let me know if anyone need some more information

 

Thank you

johannes

0 Kudos
Message 1 of 7
(4,970 Views)
I'm not sure what you mean by " cannot run the plugin vis. more precisely everthing works until I have no other subvi´s in my plugin subvi."? Could you explain. You should be able to have a folder of sub-vi's that are not know at the time you build the .exe, that are loaded dynamically when called. How do you identify what vi is to be loaded when you are running?
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 7
(4,968 Views)

And have you looked at the example called 'Plug In Example (Help>Find Examples)?

 

One thing you have to be careful about is making sure that when you distribute the subVIs, all of the dependencies are included in your distribution. This might include DLL's such as lvanalys.dll

0 Kudos
Message 3 of 7
(4,964 Views)

I´ve add an example. It´s LV8.5.1. Maybe someone can look at this example and tell me what I can do better (I think it´s a lot 😉 )If I start the main.vi the "plugins" are loaded. If I start the .exe the "plugins" aren´t loaded.

 

Thanks

johannes

Message Edited by johannes_r on 04-07-2010 03:19 AM
0 Kudos
Message 4 of 7
(4,932 Views)

I have an App that is using plug-in's. The way I designed it:

Each plug-in is an exe. The top level vi has the same name as the exe. In older LV versions, the exe is working like a folder, so I call /plugin-dir/plugin1.exe/plugin1.vi

For 2009 it is a bit different, see the ThiningInG blog

 

Instead of exe, an llb can be used (but then you need the IDE and not only the runtime installed on the target PC).

 

Other ways would to prefix every SubVi with the character '_', this is the way LV is browsing user.lib

 

Felix 

0 Kudos
Message 5 of 7
(4,928 Views)

Thanks everybody for the answers.

@Felix

I´m using LV8.5.1, so the way of using the vis in an .exe doesn´t work. I think since LV 8.2 the way you told me is not working.  I tryed using an llb; it works. I created the llb with an sourth distribution an removed the three checkboxes exclude files from vi.lib, user.lib, instr.lib. So everything is in the new llb. The problem now, is when I create vor every plugin such a .llb conflicts will occur, because it could be that the same vis are in different .llb´s.

 

Of course it could be that implement your hints in a wrong way. 

Are there some other ways to do what I want?

 

Thanks everybody

johannes 

0 Kudos
Message 6 of 7
(4,893 Views)

To avoid name conflicts, the old approach is using namespaces. The OpenG builder will automate this for you. The newer approach is using libraries (lvlib), but I don't know how they work internally (so how to call the vi's).

 

Felix

Message 7 of 7
(4,883 Views)