Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB DAQ 6259 - Measure frequency + duty cycle on 4 channels

Hi,

 

I have the USB 6259 DAQ card, one of my applications is to continuous measure 4 digital input signals (PWM signals) and display the frequency + duty cycle of each channel in the vi. The measurement should be realtime, not to loose any signal change, to display the values is not critical - can be every few ms.

 

I used the DAQ assistent to generate several signals, it is really is to use. Will the DAQ assistent work also for my above application? How? 

Is there any tutorial on measuring pwm signals with USB DAQ? I know the examples which are installed on my computer, but they are not a big help for me - as I want a step by step tutorial on this to understand everything.

 

Thanks

Stefan

 

 

 

0 Kudos
Message 1 of 7
(2,999 Views)

Hi,

 

there is no detailed description (like in words) of duty cycle measurement, I´m afraid.

Maybe you want to start with an example like this (http://decibel.ni.com/content/docs/DOC-3424)

What I can tell you for sure is that you will have to use "Semi Period" Measurement Method, which gives you both the duty cylce and

frequency of the signal.

 

Marco Brauner NIG 

0 Kudos
Message 2 of 7
(2,968 Views)

Hi,

 

thanks for the link, I think I understand the procedure know.

But as I understand I have to choose a counter input (CTR) where I connect my "signal to measure". I fugured out that I have only two counter inputs on my USB 6259 DAQ card.

 

So is it limited to 2 channels input, or not? If yes, is it possible to program my vi that I can switch between several input channels to measure the PWM on more channels one after the other in a loop?

 

Thanks!


Stefan

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

Hi,

 

yes, you´re right. Two Counters means two channels here. If you intend to switch the counter input terminals(http://digital.ni.com/public.nsf/allkb/16AF66E3E15C430786256DBF0070C5F0?OpenDocument), you can achieve

this by programming with the DAQmx Task modell a little bit more deeply. To switch the terminal for the counter input, you would have to unreserve the

task, change the terminal with the respective property (Counter Input:Semi-Period:Input Terminal) and commit the task again. 

Unfortunately ther is no KB online, as far as I could see, which explains the task state model, but as I said, try it with stop task and unreserve --> change terminal --> commit task

 

 

best

 

Marco Brauner NIG 

0 Kudos
Message 4 of 7
(2,960 Views)

Hi,

 

thank you for your help, it is working now - I tried it for two channels but seems to be ok.

 

Well I need to calculate with the values in the array. How do I know which time value in my array was from a "high" and which from a "low" phase (I am using the NI example Measure buffered semi period). In fact I need to obtain frequency + duty cycle. I know there is a separate example which handle this, but doesn't support my USB card.

 

Maybe you can help me here as well.

 

Thanks

Stefan

 

 

0 Kudos
Message 5 of 7
(2,936 Views)

Hi,

 

the example "Meas Buffered Semi-Period-Finite.vi" which comes with DAQmx shows how it works.

 

Semi-period measurement differs from pulse width measurement in that it measures both the high and the low pulses of a given signal.  

So for every period, two data points will be returned. You just have to decimate the array and you can add the two values and invert the result to get

the frequency. 

 

Marco Brauner NIG 

0 Kudos
Message 6 of 7
(2,927 Views)

Hi,

 

yes this is right, this is exactly what I did with the array. I get two values, frequency is easy to calculate, but which value comes from the "high" semi period? I need it to calculate the duty cycle.

 

Sorry for having so many questions 🙂

 

Thanks 

0 Kudos
Message 7 of 7
(2,919 Views)