Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Duty Cycle of Digital Inputs

Solved!
Go to solution

I'm trying to use counters to measure the duty cycle of a digital input so I looked at the ReadCtrFreqScalar function but I'm have having trouble finding which type of channel needs to be created for that type of read to work. I started with making a CIFreqChan and used ReadCounterScalarF64 to measure that but using the same channel to measure duty cycle is giving an error saying the read function doesn't match the channel type. Can anyone help? I just need to know which channel creation function I should replace the frequency with.

 

Note: Specifically I'm using NI cDAQ-9178 with the NI-9421 (DSub) module if that helps.

0 Kudos
Message 1 of 2
(6,010 Views)
Solution
Accepted by Goldeagle3492

DAQmxCreateCIPulseChanFreq

 

Don't use both reads, only DAQmxReadCtrFreqScalar.

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 2
(6,003 Views)