LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

load dynamically vi's

hi
 
My application requies to call, custom developed VI's.
i am very much confused, to use call by reference as
the input is predefined.
 
As far as the input to the custom called Vi...i am not sure....
i want to call this custom defined Vi, and if required pass
the values from my program.....
 
is there any way, where in then inputs to the vi is not,
specified and still we can call and pass the required parameters.
 
 
is there any way, we  can acheive this.
if so please guide me
 
regards
rags
Message 1 of 11
(4,677 Views)

Like you said, the Call by Reference node should be used when you have several VIs with the same connecter pane patterns.

The other way of calling a VI dynamically is feeding its reference into an invoke node and using the Set Control Value method, followed by the Run VI method. You will have to get the names of the controls right, or you will have errors. Look at the help for those methods for more details.


___________________
Try to take over the world!
Message 2 of 11
(4,670 Views)

Hi,

Thank you for the reply,  i am not able to get the clear picture,of the above mentioned approcah by you.

i walked throught the example....only to find VI server/semaphore or ques type.can you guide a lit bit more breifly and send me the path of the example code.

 

regards

rags

Message 3 of 11
(4,659 Views)
The attached VI (caller.vi - LabVIEW 7.1) shows the basics of opening a VI using Invoke Nodes and setting control values on the called VI (firstrun.vit).

To run these, save both to the same directory, open 'caller.vi' and run it. Set some values in the controls and hit 'Open new Instance' and the firstrun.vit will open with the values populated in it's controls.

Ed

Message Edited by Ed Dickens on 08-01-2005 10:47 PM



Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Download All
Message 4 of 11
(4,656 Views)
hi Ed...
 
Thank you. For the reply, and the example VI's.
 
Rgds
rags
 
Message 5 of 11
(4,652 Views)
Hi
 
I could not get mail you ...yesterday...as there was a server break down...
i am bit confused...very run the caller is calling the firstrun..its opening an
instances...and teh file name is beign added wit a numeric number.....
 
even when i just wanna open the firstrun.vi...its opening with different file number.
i am nor able to under stand how its creating the instances number...
when you are just passing it to FP open with a invoke node with an open instances
 
can you please explain the process..
 
rags
Message 6 of 11
(4,632 Views)
The numbers are created because Ed saved the VI as a VI Template (vit). Whenever a template VI is opened, it creates a new instance of the VI in memory, which can later be saved. You can save a vit by clicking File>>Save As.

___________________
Try to take over the world!
Message 7 of 11
(4,618 Views)
Using Templates in this manner allows you to programatically open several instances of a VI and populate its controls. It's the same as opening a template from the File menu, except you can send data to the front panel.

If you don't need to open several at the same time, just change the path so it points to a regular VI and it will open it without the added number in the name.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 8 of 11
(4,606 Views)

Hi,

        I am having the same need. In addition I need to read the output of the vi. How can I do this?

 

Thanks,

Vasanth.

Ya Ya
Message 9 of 11
(4,325 Views)


@Vasanth wrote:

I am having the same need. In addition I need to read the output of the vi. How can I do this?


If you need to use different VIs with the same connector panes, then you should use the Call by Reference node.

If the VIs are different, then you can use the Get Control Value method to get the value of an indicator, but the key is that you will need to know when to read that value (you have to wait until the VI is finished). There are other methods of transferring data between VIs which might be more appropriate. If you tell us what you are actually trying to do, we might be able to offer more help.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
Message 10 of 11
(4,314 Views)