Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency divider, help with configure input PFI

Solved!
Go to solution

Hello,

 

I'm sure this is a very simple question but I cannot seem to find the answer myself.  I would like to bring in a signal coming from a chopper at 15 Hz and divide the signal by 2 or 4 and the send that signal to my meters.  I have a NI 6216 and I thought I'd bring in the signal into CTR 1 SRC (PFI 0) and out CTR 1 OUT (PFI 5) and use a counter pulse generation subvi.  I can't even seem to get to the point of testing the software because I do not understand my hardware well enough.  When I wire my chopper signal into the 6216 the signal is pulled down by the device.  The manual for the 6216 mentions something about programmable power-up states but says to use the DAQmx my ports are currently set to tristate.  Do want to change it to high or low?  Is this even my problem? 

 

Thank you very much for your time.

0 Kudos
Message 1 of 5
(7,123 Views)

Hi colleenalana,

 

The 6216 has an internal pull-down resistor (from the specifications, it is 50k Ohm typical, 20k Ohm minimum).  What does the circuitry look like coming from your signal source?  If the source is a sinking digital output then you'll need to use an external pull-up to 5V (~10k-20k Ohm should be a reasonable value depending on your signal source).

 

Using the counters should work well once you are able to detect the input signal.  You'll want to use a Counter Output Ticks task, with the source of the ticks being the signal from the chopper (e.g. on PFI 0).  The minimum value for "high ticks" and "low ticks" is 2, so this would by default give you a divide-by-4.  However, using the DAQmx Export Signal property to set the behavior to Pulse instead of Toggle will let you achieve the divide-by-2.  In this case, the board pulses once whenever it transitions between "high" and "low" ticks rather than changing state.

 

 

Best Regards,

John Passiak
Message 2 of 5
(7,116 Views)

Thank you very much.  I can now see my signal on the test panel.  I must be having trouble with my programming because I am not generating a signal.  I am attaching my code if anyone has a moment to look it over.  Thanks!

0 Kudos
Message 3 of 5
(7,094 Views)
Solution
Accepted by topic author colleenalana

Hi colleenalana,

 

The attached code should hopefully be along the lines with what you need.  You need to use implicit timing in order to tell the counter to generate pulses continuously.  Otherwise the counter will just generate a single pulse.

 

 

Best Regards,

John Passiak
Message 4 of 5
(7,088 Views)

Thank you very much!

0 Kudos
Message 5 of 5
(7,026 Views)