03-31-2016 12:05 PM
Hello everyone,
sorry for my beginer question. Is it possible to measure duty cycle with myDAQ? If yes, could you give me an advice please how? I want to measure temperature with temperature sensor SMT 160-30 with duty cycle output. I tried both analog and digital input. In the case of analog input there is a problem with zero amplitude (error). If I use digital input then output is boolean 1 and 0 and I dont know how to proceed to determination of duty cycle. I use DAQ assistant so I will gratefull for solution with DAQ assistant.
thanks a lot
Pavel
Solved! Go to Solution.
03-31-2016 01:31 PM
Which duration do you want to measure?
03-31-2016 02:01 PM
Hi Artem,
thanks for response.
I am not sure if I understand your question. I want to measure continuously and I would appretiate if it could be possible to determine duty cycle e.g. each 5 seconds.
03-31-2016 02:32 PM
What kind of signal you have?
You talk about cycling and then about temperature sensor.
Do you want measure temperature period?
Can you draw or record sample of signal?
03-31-2016 02:55 PM
Hi Pavel,
I think you'll want to use a counter input task. If you're using the DAQmx drivers you can take a look at the Counter - Read Pulse Duty Cycle and Frequency (Continuous) example, by clicking on Help >> Find Examples.. and searching for "duty cycle".
Or, you can use a drop down a DAQ Assistant on your block diagram and configure it for a counter input task.
03-31-2016 03:03 PM
I already did it, but it showed me a statement that current device (myDAQ) has not inputs for such measurement of duty cycle (in the case of counter input).
03-31-2016 03:14 PM
please see datasheet of this temperature senzor e.g. at http://www.gme.cz/img/cache/doc/969/009/smt160-30-datasheet-1.pdf . The output of this signal is square signal witch changing duty cycles as effect of temperature.One way coul be: I could connect sensor to digital input I will get changing values 1 and 0 (according to square cycle and duty cycle the amount of measured 1 and 0 should be influenced by temperature). Unfortunatelly I am beginer with labview and I dont know how to work with logical values (1 or 0) to calculate amount of ones and zeroes. From ratio of ones and zeroes it is possible to calculate duty cycle.
03-31-2016 03:19 PM
What you should do is capture an analog waveform (the PWM signal). Then you do a comparison on all of the captured data to see if it is larger than a threshold. A typical threshold for a 5V signal is 2.5V. That should result in a boolean array. You then use Boolean To (0,1) followed by Mean. If you want a percentage, multiply by 100.
03-31-2016 03:29 PM - edited 03-31-2016 03:31 PM
You can read array of DI data. In port format it already numeric. Then you can use Pulse measurement VI
03-31-2016 03:34 PM
crossrulz: Thank you for your advice. It is certainly solution of my problem. Unfortunatelly I dont know how to make the block diagram. I have never worked with arrays in labview (I am really begineer). Is it hard to built this block diagram? Is it possible somehow zero the values e.g. after 5 seconds to calculate new array and then new value of duty cycle(the value of duty cycle will be refreshed every 5 seconds)?
thank you very much