10-28-2015 03:58 PM
Hello All,
I am currently trying to read continuously a PWM using the counter input of a NI USB-6361.
The PWM has a frequency of 1kHz, therefore I should read a sample every 1ms. Unfortunately, the loop take about 3-4ms to execute which means I lose about 75% of my data. I wonder what I should do to acquire my PWM once every 1ms.
A simple VI of how I acquire my data looks like this:
I tried adding this DAQ function:but every time I do I get different errors like the clock is too fast or I try to acquire a sample before it is ready etc..
Any help would be greatly appreciated because I know the card is fast enough to aquire at 1kHz and I am just wasting its potential right now.
Sincerely,
Cynthia
10-29-2015 02:07 PM
Hi cgagnon7843,
Did you already tried using the examples that LabVIEW provide?
From the LabVIEW toolbar Help>>Find Examples>>Hardware Input and Output>>DAQmx>>Counter Input>>Counter - Read Pulse Duty Cycle and Frequency (Continuous).vi
You can also look for examples in the community:
PWM (square-wave) Frequency and Duty Cycle Detection on Non-Counter DIO -
https://decibel.ni.com/content/docs/DOC-12911
PWM (square-wave) Frequency and Duty Cycle Detection on Counter DIO -