03-23-2012 09:17 AM
Hello,
Does anyone have a suggestion or starting code that would allow me to acquire a duty cycle on a digital input port? I have 24 pwm (0-5vdc) signals I need to continuously monitor during durability testing. Currently I use the counters on an x series card (PCIe 6323) but my sample size has increased and we prefer not to use 6 daq cards.
Thanks,
Diesel
Solved! Go to Solution.
03-23-2012 12:15 PM
I think one of the NI FPGA solutions would be appropriate here. Not cheap, and programming on the FPGA is more limited than standard LabVIEW so there's a learning curve, but the FPGAs can handle a lot of digital channels.
03-23-2012 03:36 PM
Thanks for the reply!
Maybe I should be more specific; acquiring PWM using the digital channels on my PCIe 6323 x series card. I am able to acquire the digital signal but I am not able to convert it into a duty cycle.
I have been considering the FPGA for a while but I am hesitating for the very reasons you pointed out.
03-23-2012 03:54 PM
How accurately do you need to measure duty cycle, in terms of time units? Or, alternatively, what is the minimum on time that you need to be able to measure? I don't have a 6323, but it appears that you can do buffered acquisition of digital signals at up to 1mhz; is this fast enough for your application? If so, you can calculate duty cycle by reading a number of samples (several periods is probably best), adding the number of true samples, and dividing by the total number of samples. (I'd do this by using the boolean to 0,1 function, cast to a 32-bit value if necessary, then sum array elements and divide.)
04-03-2012 06:58 AM
I have successfully used the method you described. Thanks for your help!