LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delta time interval indicator

Solved!
Go to solution

Screenshot 2023-08-02 at 1.38.43 PM.png

Hey everyone, so I have to create an indicator 'delta time' that shows the time elapsed between each iteration of the 'counter' display indicator. the counter itself is set to every 2 seconds, but the 'delta time' indicator is supposed to show a value close to 2, but not exactly the number 2. 

0 Kudos
Message 1 of 11
(1,063 Views)

Hi Tompm, the "Wait (ms)" node has an output of the time in milliseconds. You can use a shift register to store the value from the previous iteration. Then subtract the previous value from the current value to get the difference.

0 Kudos
Message 2 of 11
(1,033 Views)

mcduff_0-1691012358778.png

 

0 Kudos
Message 3 of 11
(1,031 Views)

Thanks for setting this up, I just tried it and it's not quite exactly what I'm looking for. I'm getting delta time to display 2 seconds exactly still, my indicator is supposed to be close to 2 seconds but not exactly.

0 Kudos
Message 4 of 11
(1,021 Views)

Hi thanks for the reply. 

Screenshot 2023-08-02 at 3.13.32 PM.png

 I tried to implement what you were talking about but I got stuck on understanding what my 'x' input should be for the subtraction. 

0 Kudos
Message 5 of 11
(1,018 Views)

What would you think about the output of the Wait (ms) function?

It's the same functionally as the earlier example with the Feedback Node (the Feedback Node is functionally a shift register but with potentially a few extra options in terms of how and when to initialize it).

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 11
(1,005 Views)

Hi tompm, the top input would be the output of "Wait (ms)". But, rounded to the nearest millisecond the value may be 2000 ms every time. There is not much going on in the loop to cause any kind of jitter. If you need higher resolution, you can get your timing data from the "High Resolution Relative Seconds" VI. You can get this by installing "hidden gems" though VIPM, or I have attached it as a snippet to this post.

 

Note: snippets are special png files that can be dragged onto a LabVIEW block diagram.

0 Kudos
Message 7 of 11
(1,001 Views)
Solution
Accepted by topic author tompm

This should be passing for the assignment.

 

mcduff_0-1691085370702.png

 

Message 8 of 11
(951 Views)

Screenshot 2023-08-03 at 11.44.26 AM.png

 I didn't do it exactly as you, but I made some tweaks and yes this is exactly what I wanted thank you so much!

0 Kudos
Message 9 of 11
(933 Views)

@mcduff wrote:

This should be passing for the assignment.

 

mcduff_0-1691085370702.png

 



@mcduff wrote:

This should be passing for the assignment.

 

mcduff_0-1691085370702.png

 


Let's go back to all blue wires (but change Delay to an Unsigned Integer, we simply cannot complete a loop iteration before it starts....not in any environment in this universe)

 

To get a value close but not exactly 2 simply overburden the UI Thread by using the mouse to shake the VI Front Panel back-forth and all around the monitor.


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 11
(930 Views)