LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Asynchronous VIs: All Clones affected by Wait (ms)

Solved!
Go to solution

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):

Serial Asynchronous Clones.png

 

Thanks

0 Kudos
Message 1 of 9
(2,364 Views)

How many clones do you have running at once?

 

How are you measuring the communication time?

0 Kudos
Message 2 of 9
(2,356 Views)
Solution
Accepted by topic author Foreshadow20

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

Kudos are welcome...
Message 3 of 9
(2,346 Views)

@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.

0 Kudos
Message 4 of 9
(2,330 Views)

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.

0 Kudos
Message 5 of 9
(2,319 Views)

@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

Kudos are welcome...
0 Kudos
Message 6 of 9
(2,310 Views)

You are right, the subVIs were not Reentrant.

 

Thanks!

0 Kudos
Message 7 of 9
(2,296 Views)

@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!

0 Kudos
Message 8 of 9
(2,291 Views)

@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

Capture.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 9
(2,282 Views)