LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM & AI Synch

Solved!
Go to solution

Hello,

 

I've been searching at the forums and support to no avail. What I've checked so far is: http://decibel.ni.com/content/docs/DOC-10785  http://forums.ni.com/t5/Multifunction-DAQ/How-to-Syncronize-Analog-Digital-PWM-Input-and-Analog-Digi... and the LabVIEW included examples.

 

What I'm trying to achieve is as simple as reading a PWM signal and an Analog signal synched using LabVIEW 8.2.

I'm measuring:

 - A PWM signal at about 1050Hz using two counters (one used to measure the exact frequency and the other to measure the width of the high pulse)

 -  Analog Signal between -10V and 10V (from a load cell). I will add another analog signal from the same device in the future, but this is irrelevant.

 

This is what I've got so far:

20591iD64905BF8238F678

 

I'm facing mainly one problem with this:

 - Some of my Width and Frequency measurements are wrong. So wrong as extremely tiny width measurements or extremely high frequency measurements (as high as 2500-3000 Hz). I may avoid this by "filtering" the data... But I'm sure I'm doing something wrong and I should be able to get the data OK right from the start.

 

I guess I'm getting wrong measurements from the counters due to the counter reading "from time to time" getting some of the pulses cutted. I was expecting the counter to read continuosly at the best timebase available with my expected frequency/width and simply discarding the excess of data. For example: at time 0 it will return the first value and at dt it will return the nearest value measured, discarding the inbetween data. So if my rate is 100Hz and my PWM goes as fast as ~1000Hz I will have about 10 PWM measures to chose from for each AI measure.

 

By the way, is there any other way of measuring a PWM with just one counter (a part from guessing the frequency)? In the future I may need to read 2 PWM signals and reading them with just one counter will ease my work, as I will avoid having to synch two boards.

 

I will greatly appreciate any help on this, as I'm getting stuck.

 

Thanks in advance,

 

Xavi

0 Kudos
Message 1 of 2
(2,488 Views)
Solution
Accepted by topic author XQuintero

Sorry to reply myself...

 

Now I'm feeling completely stupid. I was relying on the stability of the signal being measured. I've just checked my vi with a pulse train generated from another DAQ device on MAX and it works flawlessly. So problem may be on the signal measured, unfortunately I have no way to check it right now.

 

Anyway, problem solved... 

 

 

0 Kudos
Message 2 of 2
(2,469 Views)