From Saturday, Nov 23rd 7:00 PM CST - Sunday, Nov 24th 7:45 AM CST, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Millisecond timer with pause

Solved!
Go to solution
What hardware are you using? I'm about %99.999 sure that you are confused about the proper settings of the DAQmx Task. Without being able to at least create a simulated device and check it capabilities, we are left guessing weather or not the Task can even be configured for Continuous Sampling. And, if the task IS configured as Single Sample the Start Task and End Task are pointless (although a DAQmx Control Task.vi call with a Commit would help a lot!)

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

 

  • Why do you think this is a problem of Altenbach's code?

I never said its Altenbachs' codes problem, it was working fine but was not able to use for measuring small times.

  • Does your hardware allow for such sample rates in single-point mode?

Yes, I have used it for acquiring analog signals. I am using PXI-6345 I\o card.

  • Does your hardware allow for continuous measurements using hardware timing? (Why don't you use this when possible

why would I need use a continous measurement, when I only need to detect a single edge

0 Kudos
Message 12 of 16
(386 Views)

I was able to do it using a counter

0 Kudos
Message 13 of 16
(381 Views)

@gok010 wrote:

I was able to do it using a counter


Yup, there was something very wrong with your DAQmx Task that was hardware dependant. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 14 of 16
(377 Views)

@gok010 wrote:

Thank you for replying to my post, though your code works well up to measuring 30ms, it is inaccurate in measuring less than 30ms


My code is highly accurate within the limits of a non-realtime OS (~2ms). Once you add your DAQ code, the loop time is determined by the slowest process inside the loop and this is outside my control. Basic dataflow principle.

 

Since you only want to measure time and not immediately react to it, all you probably need is a continuous hardware timed acquisition that stops at the next occasion after the signal has changed, then you can analyze the waveform to see exactly when it happened within the precision of your sampling rate.

 

If you want deterministic single-point processing, you need an FPGA, of course.

 

(Sorry, I cannot look at your counter code. Only LabVIEW 2020 here)

 

 

0 Kudos
Message 15 of 16
(370 Views)

Thank you, it worked with continuous mode  

0 Kudos
Message 16 of 16
(322 Views)