10-14-2022 06:00 PM
I have two VIs (see in the attachment).
The first VI (AsynchronousCall.vi) performs an "asynchronous call." (see in the following picture)
The following VI (Test.vi) is started by the asynchronous call. (see in the following picture)
The first VI only iterates over an array and starts the Test.vi. An element from the array is passed. This element should then be used in Test.vi. However, the first entry from the array is not passed correctly after the first call. It follows that my asynchronous program does not receive the correct input data.
Important: In order to recreate Senario, the front panel of Test.vi can be opened first after the asynchronous call. Because when it's open, it works as intended! The target/actual comparison is in the following list:
Target value
Actual value
How can it be avoided that the string is empty the first time it is called?
The 32-bit version of LabView 2015 is used, but this Senerio also occurs with newer versions (32-Bit LabVIEW 2019)
10-15-2022 04:21 PM
Virtually nothing you say makes any sense.
Try the attached set. I don't see anything unexpected.
10-17-2022 04:29 AM
What problem are you trying to solve?
Are you sure asynchronous dynamic calling will solve it?
It never solved anything for me (just causes crashes and hanging VIs).
I've always found easier solutions for my problems.
10-17-2022 04:57 AM
I have found that it can work. I have for instance classes that instantiate a background daemon through this, that keeps running in the background to process something and communicates with the class interface through queues, events or some other mechanism. However I would fully agree that this is an Advanced technique that should not really be attempted to be used before someone has gone through the entire Basic and Intermediate training courses and written a few applications with those techniques, before attempting to do Asynchronous VIs. It's the same in other programming languages, be it Futures (Java). Lambdas (C#), coroutines (Lua), or function pointers/callback functions (C++). These are generally advanced programming features that should not really be used until someone has a sound understanding of the programming language in question.
(And that's not directed at you Wiebe, I know that you know LabVIEW well, but you may have tried asynchronous VIs a few years to early and a burnt child tends to fear the fire.)
10-17-2022 07:21 AM
@rolfk wrote:
(And that's not directed at you Wiebe, I know that you know LabVIEW well, but you may have tried asynchronous VIs a few years to early and a burnt child tends to fear the fire.)
Yes, that is pretty accurate.
I think I tried them recently, and still got locked VIs. But even if they worked (for me), I'd still prefer dynamic dispatching, parallel for loops, and a few other techniques over dynamic calling VIs in general. Maybe also because dynamically calling OO code is harder and less often needed.
I guess it's up to OP now, to decide to share the use case... Maybe (async) dynamic calling is appropriate, maybe there's another solution.