LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extremely Precise Timing

Hello,

 

I want to create a while loop that iterates EXACTLY every 1ms. Any ideas?

 

Thanks

0 Kudos
Message 1 of 7
(3,213 Views)

Use LabVIEW real time, or even LabVIEW on an FPGA which can run loops at 40MHz.

 

You can use a timed loop in Windows but that timing cannot be used reliably because Windows is not deterministic.

0 Kudos
Message 2 of 7
(3,212 Views)

What do you want to do at exactly 1ms? There may be a workaround without RT.

PaulG.
Retired
0 Kudos
Message 3 of 7
(3,184 Views)

I want to count pulses for 1ms, then reset the counter and then count again pulses for 1ms etc.

0 Kudos
Message 4 of 7
(3,144 Views)

I take it this is in relation to the other thread you started for which you haven't received an answer?

0 Kudos
Message 5 of 7
(3,141 Views)

Hi Evangelos,

 

why do you want to reset the counter? Using a shift register and taking differences (by subtraction) is much more easier...

Also:

- Using your USB6009 on plain Windows isn't the right environment for "extremely precise" timing (as said before).

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(3,126 Views)

@Evangelos wrote:

I want to count pulses for 1ms, then reset the counter and then count again pulses for 1ms etc.


Here's a community example that shows how to do this using hardware timing: Use Counter to Create a Clock for a Buffered Edge Counting Task

 

However, it won't work with a USB-6009 because it requires a device that supports multiple counters and buffered edge counting (e.g. TIO, X Series, cDAQ, M Series).

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 7 of 7
(3,102 Views)