PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

Aligning counter input with analog input on PXI-6229

I am trying to read in a handful of analog input measurements along with two counter input measurements. I was able to set up, acquire, and log the analog inputs just fine. However, I keep running into errors when I try to set up my counter inputs. I need a frequency input to change pulses to RPM and GPM, the first from an encoder that sends 60 pulses per revolution and the other from a turbine flow meter that sends a calibrated number of pulses per gallon. 

I found an example on the forums for using the analog sample clock and trigger to align the counter inputs with the analog inputs but I can't seem to get it to work. Synchronous Analog and Encoder Inputs   I tried initially setting the counter tasks up in NI-MAX but I kept getting errors so I switched to just creating the channel in the VI like in the linked example. I've attached a screenshot of my code below along with a screenshot of the error. It makes it pretty clear I can't use the sample clock but I don't understand why. How else can I align the three input tasks?

 

Error -200300 occurred at DAQmx Start Task.vi:7220003

Possible reason(s):

Invalid timing type for this channel.

Property: SampTimingType
Requested Value: Sample Clock
Possible Values: Implicit, On Demand

Task Name: _unnamedTask<9>

 

I'm not looking for anything high speed, I acquire at 10Hz and just do one sample at a time. I just want to make sure the counters align with the analog inputs. 

Download All
0 Kudos
Message 1 of 5
(739 Views)

Sample clock buffered frequency measurement is only supported on X Series DAQ.

 

M Series

ZYOng_0-1786932523487.pngZYOng_0-1786932523487.png

 

X Series

ZYOng_1-1786932542026.pngZYOng_1-1786932542026.png

 

 

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
Message 2 of 5
(654 Views)

Well, maybe you don't need a frequency measurement, just count edges (without resetting them inbetween) , read them with your sample clock and do the calculations in a consumer loop (if needed).  If the uncertainties for the frequencies is too high,  you can increase the samplerate and/or use more samples.. 

 

my old vi for such a task used a subvi called  'Get Terminal Name with device Prefix.vi'  to get the AI-Sampleclock-name to tell the counter sample clock which clock to use, but i can't find it in LV25 , so my old vi is broken   ...   anyhow, try to configure both tasks with the same sample clock .... 

maybe the newer DAQmx driver are smarter ... or a smarter DAQmx user can help 😉

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 3 of 5
(614 Views)

Thank you both for the input. I didn't realize that was a limitation of the board I am using. I'll switch to counting edges and do the frequency calculation myself. I already have it set up to all use the same sample clock from the analog input, it just kept throwing an error. 

0 Kudos
Message 4 of 5
(603 Views)

can't really test it, but you can try to read back the source and rate (using the clock property node)

AI & CI test.pngAI & CI test.png

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 5
(583 Views)