LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Engine Pressue Acquisition VI Help

Well, 20 cycles of a 20 Hz sine wave means that you're looking for 1 second worth of samples.  If you sample at 72000 Hz in Finite Sampling mode, then you should configure DAQmx Timing for 72000 samples.   And then *because* you're taking a fairly short capture in Finite Sampling mode, you may as well *also* request the full 72000 samples from your call to DAQmx Read.   And then you should further get rid of the loop because your first read retrieves all the samples and any further iterations would error out anyway.

 

I noticed however that the default PFI terminals on your front panel don't match what you described in your posting.  Given that discrepancy, I'd recommend you *also* carefully examine your physical wiring connections, and don't forget that the DGND connection to your square wave generator(s) is important too!

 

Some general background info: the '# samples' inputs to DAQmx Timing and DAQmx Read have distinct meanings.  (And unfortunately, those meanings aren't entirely consistent as you choose between Finite and Continuous Sampling, and as you choose whether or not to wire up a specified # samples to Read.  See this suggestion for more griping by yours truly.)  In the specific case of Finite Sampling, it's fairly common (but not strictly necessary) to wire the same value to both inputs.  With Continuous Sampling, it's fairly unlikely that wiring the same value to both would result in desired behavior.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 11 of 14
(417 Views)

Thank you sir for helping me,

I have connected analog sine input to ai5 of NI USB-6351, and square waves to PFI14 and PFI15 along with ground for all the terminals.

I was able to acquire the analog signal by using a sample rate of 72000 and the number of samples 72000. Also, I was able to acquire 36000 samples which take only 0.5 seconds. 

But, when I tried the same code again it is not working and showed an error which I have attached herein along with the code.

I have checked the connections with all the terminals, I have even tried by changing terminals PFI12 and PFI13 which corresponds to counter 0 and 1 of this hardware.

Please give some suggestions.

 

Download All
0 Kudos
Message 12 of 14
(410 Views)

That's an acquisition timeout error.  It most likely means that either sample clock or trigger signals weren't present at the designated PFI terminals.  If they were present, your 10 second timeout was plenty long enough to allow 7200 samples to be collected at a (nominal) 72 kHz.   Is it possible you mixed up which terminal was which?  If so, you'd have been sampling at only 20 Hz and 10 seconds wouldn't have been nearly long enough for 7200 samples.

 

Also note: it's helpful to save the front panel control values as defaults (Menu: Edit->Make Current Values Default) and re-save before posting.   This time your screencap helped show the values you used, but the posted vi had blanks for the ai channel and PFI terminals.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 13 of 14
(395 Views)

Thanks for helping me out, the problem is solved. It was that the digital signal used as the clock pulse was not reaching the terminal from the function generator.  

0 Kudos
Message 14 of 14
(387 Views)