How can I control Timer/Conter input of an NI DAQ Pad-6259 by using the data acquisition toolbox ?

5 Ansichten (letzte 30 Tage)
I Want to meassure the frequency of a rectangular binary signal with a counter input of an NI DAQ Pad-6259. I tried the way described in the matlab help. Here is the example.
s = daq.createSession('ni'); s.addCounterInputChannel('cDAQ1Mod5', 'ctr0', 'Frequency') s.inputSingleScan
if I do this, the method "inputSingleScan()" returns NaN.

Antworten (1)

Manisha
Manisha am 19 Sep. 2012
Hi Peter,
It seems that your code is correct. I would double check your hardware setup.
1. Is your signal connected to the correct terminal. You can find the correct terminal by executing
s.Channels(1).Terminal
2. What is the amplitude of your signal. Make sure amplitude is high enough for your counter to detect it.
3. Are you getting the correct frequency using National Instruments MAX?
Hope this helps,
Manisha
  1 Kommentar
Peter
Peter am 24 Sep. 2012
My NI device supports 4 ways of meassuring frequency with a counter. The first two are for low frequencies, and the second thwo are for high frequencies. I don't know which of this 4 methods is used by the code shown in the matlab help. Each of this methods needs another connection of the hardware, but matlab supports only one funktion
s.addCounterInputChannel('cDAQ1Mod5', 'ctr0', 'Frequency');.
Can somebody tell me which method is used by matlab or how I can influence this ?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Acquisition Toolbox Supported Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by