LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Are Timing functions blocking or I do not understand LabVIEW

Solved!
Go to solution

Consider the simple code below:

 

snip.png

 

If I look at the time difference between loops it is always around 20, maybe 19 or 21.

Why is that?

  1. The loop has a 20ms wait period in it.
    1. My understanding of that wait, is the loop executes every 20ms assuming nothing is holding it up. So the other operations in the loop can execute from 0 - 20 ms during this wait.
  2. So the Tick Counts should be able to execute at any time in the loop, assuming non-blocking functions, parallel execution.
  3. It seems like Tick Counts always executes after the wait, why is that?

What am I missing, it should be something simple.

 

mcduff

 

EDIT: I think now it is always executing at time 0 in the loop, then always 20 ms, not sure why I thought there was delay. Still spot on with high resolution seconds.

 

Need some sleep. 🙂

0 Kudos
Message 1 of 3
(2,630 Views)
Solution
Accepted by topic author mcduff

Another way to think of this is "If there's no reason to wait, do it now!"  [This is something my dad always used to say to me, particularly when there was a chore to do ...].

 

Bob Schor 

Message 2 of 3
(2,614 Views)

Your code cannot tell anything about execution order within the loop diagram, just the time between successive iterations. That time depends on the slowest function, i.e. the wait in your case. The ms resolution of the ticker is very course compared to anything else. You can substitute "high resolution relative seconds" instead, giving you better units and more resolution.

0 Kudos
Message 3 of 3
(2,591 Views)