LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Within the TCL and NPL, how do you start a DAQ-STC timer to count the elapsed time spent in time critical code?

Clarification: I have a 6030E DAQ board which has a built-in DAQ-STC counter chip. I've created a RTOS for my PXI8175 controller. Unfortunately, while in the TCL clock interrupts are ignored and therefore any time based operations are erroneous. Is there a way to tell the TCL to service clock interrupts? Otherwise, perhaps the following concept should be implemented: Initial Time Stamp + elapsed time spent in TCL = Final Time Stamp
0 Kudos
Message 1 of 2
(2,664 Views)
While the system clock might fall behind, there are a number of ways to measure elapsed time accurately. Here they are in ascending order of accuracy:

1) Tick Count - Each tick is 1.000686 milliseconds.
2) DAQ-STC counter - The base clock is 20 MHz, thus the finest period of measurement is 50 nanoseconds.
3) NI-TIO counter - The base clock is 80 Mhz, thus the finest period of measurement is 12.5 nanoseconds.
4) RDTSC - Read Timestamp Counter is an assembly instruction which reads timestamps right off the CPU. The period depends on CPU speed (i.e. 1 GHz yields 1 nanosecond period).

Programming #1 requires two calls to Tick Count and a little math. There are shipping DAQ examples that demonstrate how to count events/time with counters, so that addresses #
2 and #3. As for #4, there's an RT shipping example that demonstrates how to use RDTSC. There's also an RT template, which is identical to the RT example I mentioned.

Let me know if you need more info.
0 Kudos
Message 2 of 2
(2,664 Views)