12-09-2019 01:59 AM
Hi ,
I want to run a VI as a SubVI using Asynchronus Call and then the same VI as a Asynchronus Call.
Is it possible?
12-09-2019 02:20 AM
Hi himanshu,
@himanshu25 wrote:
I want to run a VI as a SubVI using Asynchronus Call and then the same VI as a Asynchronus Call. Is it possible?
How do you run "as a subVI using AsyncCall"?
You cannot run the very same instance of a VI as "ordinary" subVI and also using ASyncCall. When you want to start several instances of a VI then you should use VI templates or reentrant VIs…
12-09-2019 02:46 AM
@himanshu25 wrote:
I want to run a VI as a SubVI using Asynchronus Call and then the same VI as a Asynchronus Call.
Is that a typo (besides the obvious typo)?
You want to run it as "Asynchronus Call and then the same VI as a Asynchronus Call".
So you simply want to call it asynchronous twice? The VI should be reentrant, and you should open an clone (0x80 or 0x100 IIRC, but read the help on Open VI Reference)...
I personally avoid all kinds of dynamic calling If I can (and I usually succeed)... You only need dynamic calling if the (maximum) number of instances at run time is unknown. Or if the exact instance can change (plug-ins). There are some corner cases where it can be practical to dynamically call VIs. All other cases it can be avoided, making life easier (IMHO)...
12-09-2019 03:19 AM
Hi,
I have a VI that i want to run in a for loop twice using Asynchronous call. The first iteration runs the VI as a normal VI (x100 and x0) and the next iteration it runs in backgound (x100.and x40)
I refered this exmaple. " Asynchronous Call and Collect (Using Option 0x40).vi"
Sorry for asking stupid questions but i am new to LabVIEW.
12-09-2019 03:29 AM
@himanshu25 wrote:
Sorry for asking stupid questions but i am new to LabVIEW.
It's not stupid at all...
Where do you fail? Simply opening the reference in the for loop, with different options the second time should work.
If you post what you have (or an trimmed down version) we can give more detailed advice.
If you only want to call the VI twice, I'd say you can ditch the for loop. Simply put the VI on the diagram for the first (normal call), then do the async call after that. Even the 2nd call could be replaced by a normal call, depending on the circumstances.
12-09-2019 07:39 AM
Somethings to consider:
Bob Schor
12-09-2019 02:06 PM
I am using JKI SM (mainVI and subVI ) and calling the sub VI Asynchronously. My aim is to run two tasks in paralllel. I have not used the Master Slave approch but will try it.
Thanks for your suggestion.