LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing parameters to/from dynamically loaded VIs

Solved!
Go to solution

Hello

I have a data acquisition application which uses a analog Input PCI-Hardware.
With this hardware I sample different channels and display them in diagramms
In "overview" operation I sample 4 channels and display them in 4 diagramms.
So for every channel I have a fourth of the maximum sampling rate.
In "zoom" operation I only sample one channel (with max sampling rate of the hardware)
and display the data in the selected channel (the other channels are igored in zoom mode)

My idea is to launch different VIs depending on the mode (overview, zooom).
I could imagine, that a good approach to perfom this task is calling different VIs
from the main programm.

Unfortunately I do not understand how to pass parameters to/from the VI if I call them
using the nodes "open VI reference", "call by reference" and "close VI reference".
I tried to understand the Labview "Dynamic Load Example" but it's too complicated for me.
Can someone give me a simple example for dynamically loading VIs or are there any white papers
or nugets about this subject?

0 Kudos
Message 1 of 13
(4,662 Views)

How about an image of how I do it?

 

Launch_Template.PNG

 

Another approach would use the Invoke Node Call by Reference where you can pass values to and recieve results back the same way a normal sub-VI call works.

 

I hope that helps,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 13
(4,660 Views)

As shown in Bens example, you need the Val.Set and Val.Get and RunVI methods. OpenG has some wrappers of these methods, which might make it easier for you to use them. There was also a nugget by Damien/DFGray. You can find a list of his nuggets in the breakpoint forum.

 

Felix

0 Kudos
Message 3 of 13
(4,649 Views)

Hi! To pass data to/from dynamically loaded vi, you have many option (other than accessing controls via Vi server):

- Global variables (used wisely...)

- Functional globals

- Queues

- Notifiers (especially good for one-to-many data transfer)

...

 

Marco

0 Kudos
Message 4 of 13
(4,642 Views)

Here is the link to the nugget I mentioned:

Dr-Damien-s-Development-Running-Top-Level-VIs-V-A-String-Server

 

Note that this is the last(?) of 5 post on this topic. You might want to start with the first one.

 

Felix

0 Kudos
Message 5 of 13
(4,638 Views)

Hello Ben,

 

thank's for the info. I will do some tests, to see if it helps to solve my problem. I keep you posted.

 

0 Kudos
Message 6 of 13
(4,613 Views)

also thank's to you Felix. I have to study the nuget and keep you also posted

0 Kudos
Message 7 of 13
(4,611 Views)

Hello, I tried to follow the link unfortunately it does not work. Any hint how to find Dr. Damiens nugets?

0 Kudos
Message 8 of 13
(4,605 Views)

There is one additional http:/ in the link above. Here it comes again (hopefully it works):

 

http://forums.ni.com/t5/LabVIEW/Dr-Damien-s-Development-Running-Top-Level-VIs-V-A-String-Server/m-p/...

 

Felix

0 Kudos
Message 9 of 13
(4,595 Views)

Hi Ben,


unfortunately your proposal does not help me, because I do not understand the diagramm. I have not too much experience with Labview, have a german version of Labview and cannot find the following symbols of your drawing:
Active Name (with the glaces), Active Obj Refnum. Can you plaese sende the picture once again with descrition of symbols displayed, so that I can reprogramm and investigate the example? Thank's

0 Kudos
Message 10 of 13
(4,590 Views)