07-26-2012 01:19 PM
Hello!
I have been experimenting with LabVIEW for about a week now and have run into a brick wall. I have found a fairly effective way of reading a PWM signal through an analog input and determining the pulse width. However, it is becoming necessary for this project to do this same thing using a digital input. I've been playing with this for about a day now and am not making much headway.
For reference, I will be using a 9524 device
Any ideas?
07-26-2012 01:38 PM
Hi JPISU,
and what's your problem?
Before you used some kind of AI: took a signal, checked for threshold value to determine PWM pulse, calc the length of the pulse.
Now you could: use a DI to take a signal, check for TRUE to determine the PWM pulse, calc the length of the pulse...
Maybe you need some additional hardware to connect the former analog signal to your digital input?
07-26-2012 01:42 PM
That's what I'm hoping to do, actually! I am trying to think of a way to do it that does not require a counter as my DAQ device does not have one! I can determine when there is a rising and falling edge, but I am having trouble with the timing in the middle. Essentially, I haven't been able to calculate the duty cycle. I understand, mathematically, how it should work (at least I think I do ) but am having difficulty implementing it in LabVIEW. I've been searching other forums and most provide solutions using a counter.
Thanks!
07-26-2012 01:45 PM
Allow me to correct - I thought I was able to detect the rising/falling edge, but I don't have confidence in it.
07-27-2012 09:09 AM
Hello JPISU,
It is not possible to do PWM at high frequencies using digital lines because the timing used for that has limitations. Check the KB Software-Timed PWM Using a Digital Output Line, it gives examples on how to do it, but you need to have in mind that there might a certain delay.
Best Regards,
07-27-2012 09:12 AM
amezam,
Would you reccommend just sticking to an analog input?
07-27-2012 09:19 AM - edited 07-27-2012 09:20 AM
Hi JPISU,
"I thought I was able to detect the rising/falling edge, but I don't have confidence in it."
When you don't have confidence you should do some software testing...
Btw. do you use a cDAQ chassis or a cRIO?
@amezam:
I don't see the connection between outputting a PWM on a DO line and detecting edges of a DI signal?
07-27-2012 09:21 AM
Gerd W.
I am not going to need to send a PWM from LabVIEW in my final application. I will be reading the PWM signal off a board I am testing. I am concerned with reading this signal (coming off the DUT) into LabVIEW via a DI terminal and then determining pulse width.
Jane
07-27-2012 09:45 AM
Sorry for omitting this - we use a CDAQ chassis.
07-27-2012 09:51 AM
Also, if it is helpful at all, I've attached two vi's. One, functions just as I need it to - but it doesn't involve data aquisition. The second should be similar to the first, but is non functional - I keep getting an error that my amplitude is zero.
Any thoughts?