10-12-2017 01:32 PM
I have asynchronous VIs running creating clones and the "Wait" is propagated. The VI that is cloned is a serial communication (different ports) that have a 100ms delay between the write and read.
1 Clone: Communication Loop has the accurate 100ms.
2 Clones at the same time: Communication Loop is 200ms for each clone.
I tried using "Wait Until Next Multiple", but that has the same effect.
I tried setting the Preferred Execution to instrument I/O, but that has no effect. Same goes for "time critical priority".
Reentrant execution is checked.
Preallocate clone for each instance is checked
This post has a summary of my Asynchronous Calls:
https://forums.ni.com/t5/LabVIEW/Are-these-Asynchronous-VIs-considered-as-open-reference/m-p/3688254
This is the VI being called Asynchronously (I just added shift registers to the Session):
Thanks
Solved! Go to Solution.
10-12-2017 01:45 PM
How many clones do you have running at once?
How are you measuring the communication time?
10-12-2017 01:50 PM - edited 10-12-2017 01:51 PM
Are all those sub-VIs we see also reentrant? Especially your Wait-VI? I strongly assume, it is not. Making a VI reentrant and calling it dynamically does not make the subVIs reentrant.
Regards, Jens
10-12-2017 02:44 PM
@jg69 wrote:
Are all those sub-VIs we see also reentrant? Especially your Wait-VI? I strongly assume, it is not. Making a VI reentrant and calling it dynamically does not make the subVIs reentrant.
Regards, Jens
That's what I was thinking too, but in that case the first clone would not continue to run at 100ms, it would also run at 200ms, which is why I wanted more info on how the timing is measured.
10-12-2017 03:04 PM
gregoryj wrote:That's what I was thinking too, but in that case the first clone would not continue to run at 100ms, it would also run at 200ms, which is why I wanted more info on how the timing is measured.
Not necessarily. Imagine this situation: both clones try to call the Wait at the same time. The first clone gets access to it, waits 100ms, and then proceeds. Then, since the first clone is no longer calling the Wait VI, the second clone can now call it - and waits another 100ms. Now you have 200ms timing for the second loop. Meanwhile, if the Write and Read take at least 100ms, then the Delay VI will be free again for the first clone to call with no delay, but depending on the actual operations, the second clone could again run into the same issue on the next iteration.
10-12-2017 03:28 PM
@Gregory wrote:
@jg69 wrote:
Are all those sub-VIs we see also reentrant? Especially your Wait-VI? I strongly assume, it is not. Making a VI reentrant and calling it dynamically does not make the subVIs reentrant.
Regards, Jens
That's what I was thinking too, but in that case the first clone would not continue to run at 100ms, it would also run at 200ms, which is why I wanted more info on how the timing is measured.
1 Clone: Communication Loop has the accurate 100ms.
2 Clones at the same time: Communication Loop is 200ms for each clone.
Well, the OP wrote, running 1 clone, he waits 100ms, running 2 clone, each clone needs 200 ms. Exactly as expected if the wait-vi is a shared resource because it's NOT reentrant.
Regards, Jens
10-12-2017 04:04 PM
You are right, the subVIs were not Reentrant.
Thanks!
10-12-2017 04:17 PM
@jg69 wrote:
1 Clone: Communication Loop has the accurate 100ms.
2 Clones at the same time: Communication Loop is 200ms for each clone.
Well, the OP wrote, running 1 clone, he waits 100ms, running 2 clone, each clone needs 200 ms. Exactly as expected if the wait-vi is a shared resource because it's NOT reentrant.
Regards, Jens
Wow, I did not read closely at all!
10-12-2017 05:06 PM
@Gregory wrote:
@jg69 wrote:
1 Clone: Communication Loop has the accurate 100ms.
2 Clones at the same time: Communication Loop is 200ms for each clone.
Well, the OP wrote, running 1 clone, he waits 100ms, running 2 clone, each clone needs 200 ms. Exactly as expected if the wait-vi is a shared resource because it's NOT reentrant.
Regards, Jens
Wow, I did not read closely at all!
What do they teach CLA's
Use Stall Data Flow.vim