LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

acquire pwm on a digital line

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(3,081 Views)

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.

0 Kudos
Message 2 of 5
(3,075 Views)

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.

0 Kudos
Message 3 of 5
(3,064 Views)
Solution
Accepted by topic author Diesel

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.)

0 Kudos
Message 4 of 5
(3,061 Views)

I have successfully used the method you described. Thanks for your help!

0 Kudos
Message 5 of 5
(3,029 Views)