LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Start Asynchronous Call Reentrant

I've experimented with the new LV 2011 "Start Asynchronous Call" method on reentrant VIs.  I am able to instantiate multiple clones of the VI, but the input data is not propagated to the clone VI.  I have tried a few different 'options' flags on "Open VI Reference."

 

Has anyone else observed this behavior?

 

 

 

Call Reentrant.png

0 Kudos
Message 1 of 9
(4,665 Views)

Hello Jonathan,

 

This is Andrew Brown, an Applications Engineer from National Instruments. I will be happy to work with you to get the Start Asynchronous Call to recognize your inputs. 

 

After examining your provided code and creating an example myself, I found one issue with your code. The only flag you should need to use for Asynchronous Call and Collect is x100. That is based off the Open VI Reference and Asynchronously Calling a VI and Collecting the Results documents located within LabVIEW 2011 Help. If you were going to pass in multiple flags, you would want to use the OR operator ( v ) rather than the AND operator ( ^ ). 

 

I attached the example code provided by LabVIEW 2011 within the "Asynch Call and Collect.zip" file.

 

Based off that code, I wrote my own example that asynchronously calls a subVI multiple times with different inputs. The code for my example is attached as "Multiple Asynch Calls - Diff Inputs.zip" 

 

 

 

Please let me know if you are still having issues after working with these examples. Thanks, and have a great day!

 

Regards,

 

Andrew Brown 

Software Engineer
National Instruments
0 Kudos
Message 2 of 9
(4,637 Views)

Thanks for your response.  Are there any considerations / implications if the target VI is reentrant?  In my use case the target VI is a polling interface inside an infinite while loop and needs to keep a separate data space.

0 Kudos
Message 3 of 9
(4,631 Views)

Hello Jonathan,

 

In order to ensure reentrant execution using the Asynchronous Calls, the x40 flag needs to be set. This is based off the infomation documented in the same Open VI Reference document within the  LabVIEW 2011 Help files I referenced earlier. Again, I recommend using a logical AND ( ^ ) operator to combine this flag with the x100 flag. 

 

I hope this additional information helps. Thanks, and have a great day!

 

 

Regards,

 

Andrew Brown

Software Engineer
National Instruments
0 Kudos
Message 4 of 9
(4,605 Views)

I notice in the example the "front panel open option"  following on from the start asynchronous call, will this work as a method to dynamically load a VI and just have it open it's front panel rather than actually run ?

 

 

cheers

 

Dannyt

Danny Thomson AshVire Ltd
0 Kudos
Message 5 of 9
(4,557 Views)

I think I have just answered my own questio fiding this in the LabVIEW help

 

 

Miscellaneous Details

Danny Thomson AshVire Ltd
0 Kudos
Message 6 of 9
(4,555 Views)

Hi Everyone

 

I see there are posting on Asynchronously calling a VI.

 

I am starting to program using labview and I see a need to use this function.

 

Essentially, I need to call the file DUT1 while in a loop monitoring a chamber. When the DUT1 VI has finished, it will return a result. I then use this result in my loop to make a decision. I used the "open reference" and "start asychronous" plus the "Wait" function however, I cannot get it to open the file.

 

Any ideas? 

 
0 Kudos
Message 7 of 9
(4,497 Views)

Hi Sr Test Engineer,

 

Could you just use the DUT1 VI you mentioned as a subVI on your main VI's block diagram. From what you described, this process would give you the behavior you are looking for.

 

On your block diagram, you can right-click, click on Select a VI... and browse to your VI that you would like to insert in the program. You may want to edit the connector pane of the subVI so that it behaves properly in your main program, but you will be able to send output to other parts of your code easily using this method.

 

Here is a link to some information on building the connector pane:

https://www.ni.com/docs/en-US/bundle/labview/page/building-the-connector-pane.html

 

I thought this example might be useful as well, it shows how to use a producer/consumer pattern but also contains the basic idea of using a subVI.

https://forums.ni.com/t5/Example-Code/Start-VIs-from-Main-Application-Using-Producer-Consumer-Event/...

 

 

 

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
0 Kudos
Message 8 of 9
(4,485 Views)

Thanks

 

This may do the trick

 

 

I will try it and let you know if it works for me

0 Kudos
Message 9 of 9
(4,475 Views)