LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication with an asynchronous called VI

Hello There , I am  currently facing problem in passing the queue refnums from vi to another vi using start asynchronously call node . I have created the control for the queue out from the obtain queue node and passed the refnum to the terminal in the async call node but in my target vi it says not a refnum . Can you please help me on how to send the vi refnums 

0 Kudos
Message 11 of 15
(98 Views)

@indian_tony_stark_HC wrote:

Hello There , I am  currently facing problem in passing the queue refnums from vi to another vi using start asynchronously call node . I have created the control for the queue out from the obtain queue node and passed the refnum to the terminal in the async call node but in my target vi it says not a refnum . Can you please help me on how to send the vi refnums 


Once you attach your code, we will be able to tell what's wrong. 

0 Kudos
Message 12 of 15
(82 Views)

@nollMarvin wrote:

Hi,

 

that is exactly what i have in mind. Problem is though that i need to get a return value. Let my describe an example situation:

The main app puts the "initialize video grabber" command on the queue. The videograbber VI dequeues the command und execute the necessary code. Depending on the operation was sucessfull or not, it has to send a return value e.g. "init sucessfull" or "init not sucessfull: camera not found".

Should i use another queue to send the return values back to the caller? How can the caller match responses to the corresponding command calls?

Is there an easy way to do this. I think there has to be a simple solution, because this seems to be an every day problem, right?


We use notifiers as part of the message sent to the asynchronous VI. This Notifier is used to send back a signal when the asynchronous VI has finished executing. We call this a "Self-addressed Envelope" like TV shows used to ask for when initiatting view communications.

 

You can call the Asynchronous VI with the "Start Asynchronous call" shown below where you  can then pass in any parameters required, for example a Event reference, a Queue reference, a Messaging object or whatever. You can then use this reference (initialised by the caller before starting the asynchronous VI) for comms. If a notifier as self-addressed envelope is included in the datatype of this messaging option, you can essentially implement a synchronous call to the VI. Or you can have a "deferred synchronous" call or any variation of it.

Intaris_0-1732028316219.png

 

0 Kudos
Message 13 of 15
(57 Views)

The easiest would be to place Obtain queue in a FG where it's created on First call, then you can easily use it in both Main and Asynch VI, but i like Intaris solution of activating the connector pane and simply wire it.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 14 of 15
(50 Views)

You can call the Asynchronous VI with the "Start Asynchronous call" shown below where you  can then pass in any parameters required, for example a Event reference, a Queue reference, a Messaging object or whatever. 

Intaris_0-1732028316219.png

 


One thing that (as of LabVIEW 2019, anyway) can not be passed in to Start Asynchronous Call is a Channel Wire.  I had a multi-station Master/Servant design implemented as Channel Message Handlers where the Master ran up to 24 asynchronous "stations" created as asynchronous Clones.  The Station, itself, as well as the Master routine, followed the CMH (Channel Message Handler) model, using Messenger Channels, but to communicate from the Main to each of its Servants, I used a Queue, which was used exclusively to send messages to the individual Servants, where they were turned back into Channel Messages and integrated into the Clone's Channel Message Handler design.

 

Bob Schor 

0 Kudos
Message 15 of 15
(14 Views)