LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having trouble getting wait(ms) to run in parallel in my While Loop

Putnam, I really don't think that is true. Take a look at the attached snippet. If I follow what you said, then in this snippet, the 2 second delay should only execute after the case structure has finished executing the 1 second delay due to data flow. In that case we should expect the x-y indicator to update every 3 seconds, but in fact, it updates every 2 seconds.

 

So it is pretty clear to me that the 2 second delay node is executing in parallel, and this seems to be consistent with the documentation on NI's website (I posted a couple of links earlier). I think if you distill my large VI snippet down, it essentially functions in a similar manner to this posted snippet in terms of where the delay node is situated inside the main DAQ loop. So to me, the inconsistent behavior seems indicative of some other conflict...perhaps what I'd posted earlier about property nodes and conflicts with the UI thread?

 

snippet.png

0 Kudos
Message 21 of 23
(292 Views)

You're right, the wait(ms) does execute in parallel. That is not the problem.

 

Have you tried disabling the different read functions? Diagram disable structure will be your friend when doing this. Disable one HW interaction a the time and you might find the culprit. Is there any other code in your system that has access to the same HW or the same vi:s? The wait(ms) is likely to alter the timing of your code, which could possibly trigger race conditions.

 

Property nodes are slow and forces a swap to the user interface thread, but that is nothing that should change because of the wait(ms) function.

 

Are you running Windows on a reasonably modern computer btw?



CLA
www.dvel.se
0 Kudos
Message 22 of 23
(261 Views)

Thanks M_Peeker. Didn't know about disabling structures in the block diagram. I will play around with it when I can to see if I can find the culprit. There is other code in another loop that reads or writes a couple of the variables whose property nodes are used in the posted loop. So it very well could be an issue related to that. However, the hardware is being accessed only within the main loop I posted. This is running on a pretty new machine, so I don't think that should be an issue. I guess there isn't an easy answer for this issue yet.

0 Kudos
Message 23 of 23
(251 Views)