Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

one minute data

a.o.o to all;
I want to get data of one minute from DAQ using time base API
guide me:
1)What API i should use to gain data from DAQ of one minute time span
2)What should be the sample rate AND What should be values of parameters of DAQ_RATE API
3)What should be the Size of Buffer that store one minute of data of one channel
4)What should be the Size of Buffer that store one minute of data of 8 channels
any ohter suggestion to get one minute data from daq contineously ,mostwelcome
thanks ajmal
Lead Data Scientist
0 Kudos
Message 1 of 5
(3,510 Views)
Hi ajmal,

The DAQ driver installs shipping examples which will be a helpful starting point. You can find them at:
C:\Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ai

Depending on how many samples you require within that one minute (The tutorial below provides information on determining a sampling rate), you can consider the "SCANsingleBufAsync" or the "DAQDoubleBufAsync" examples. If the number of samples you require can fit into the buffer of your DAQ device, you can use the first example which acquires "count" number of examples, specified in the DAQ_Start function. If the number of samples required is more than what the buffer can hold, you can use the second sample which acquires continuously, and use some timing function to stop the acquisition after one minute (you'll need to replace DAQ_Start with SCAN_Start..see comments in sample).

Acquiring a Waveform of Data

If you're acquiring finite number of examples (not continuously), the buffer size should be greater than "count". If you're using the continuous acquisition example, the buffer size will determine how many samples are retrieved from the buffer. The DAQ Reference Help will be able to provide information on the parameters involved with the functions.

Furthermore, is there a reason why you're using the Traditional DAQ driver as suppose to the new DAQmx driver? Which DAQ device are you using? The new DAQmx driver is simpler to work with.

Thanks,
Lesley Y.
0 Kudos
Message 2 of 5
(3,491 Views)
thanks sir for replying
i have PCI-6025E card i install DAQmx driver but on running my Application it throws exception of such as that the "this is not an Natinal instruments device ........"so plz tell how i can install the daqmax driver correcty
regards
ajmal
Lead Data Scientist
0 Kudos
Message 3 of 5
(3,482 Views)
sir ;
u have mentioned timing function .What timing fuction should i use after getting one minute of data?.Plz specify
also i m getting data continiously.I m using scan_start to get data continiously.
Lead Data Scientist
0 Kudos
Message 4 of 5
(3,479 Views)
Hi ajmal,

Can you see your PCI-6025E device in the Measurement and Automation Explorer (MAX) listed both under the Traditional DAQ and NI-DAQmx folders? Use the Test Panel in MAX to make sure the board operates properly. If you see the board, but it's indicating a self test failure, try first resetting the device under the Traditional DAQ folder, then reset the device under the NI-DAQmx folder. You can verify the version of your DAQ driver installed by expanding the "Software" folder in MAX and highlighting the item "NI-DAQmx" to see what's listed on the right hand panel.

If you're using the DAQmx driver, you will not be using the scan_start function, but the DAQmx functions. You can use the shipping examples found in:
C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\
as a starting point. Specifically, try the "Cont Acq-Int Clk" project

I am not too familiar with VC++ programming, but try looking into the CNiTimer class to determine when the data acquisition task stops (e.g. when the timer reaches 60 sec, execute DAQmxStopTask). For more details on that, I recommend checking the MSDN website.

Thanks,
Lesley Y.
0 Kudos
Message 5 of 5
(3,462 Views)