Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple channel data acquisition

Hello Pavan,

You might try increasing how often you read your number of samples.  You could do this by decreasing nSamples and the number of numSampsPerChan in your DAQmxRegisterEveryNSamplesEvent and DAQmxReadAnalogF64, this would cause the buffer to be emptied more often. 

Give that a try and let me know if it doesn't help,
Micaela N
National Instruments
0 Kudos
Message 11 of 19
(2,962 Views)
Hi Micaela,

Sorry for the delay. I tried with low values as you mentioned, but still it is giving me the same error (I have attached a screenshot of the error). I am attaching my program with this message, can you verify it by testing on your systems.

thanks,
-Pavan.
Download All
0 Kudos
Message 12 of 19
(2,943 Views)
That is a lot of throughput....3 channels @ 10 MS/s is 60M bytes per second.  Can you run your program at slower rates w/o getting that error?  If so, what rates can you achieve w/o error?
-Alan A.
0 Kudos
Message 13 of 19
(2,940 Views)
Hi,

I can go roughly upto 8MS/s and from then it gives out the error. Even at 8MS/s it sometimes reads in and sometimes it doesn't. Is there anyother solution for this other than capturing 1AI-2DI (since two of my signals are square waves)?? Even with 1AI-2DI, I can capture only for 12 sec at max, if I try to give more than 12sec the program doesn't even start and gives out application error (maybe this is something with allocation of buffer, even though I have 2GB of ram).

thanks,
-Pavan
0 Kudos
Message 14 of 19
(2,911 Views)
Hello Pavan,

I took a quick look at your code and I would recommend making your buffer larger and decreasing how often you read the data.  For you buffer, I would recommend making it large enough to hold at least 1 second of data, so at least 10 M samples.  Also, if you decrease how often you return the data you will decrease how often data is transferred, I would recommend transferring data approximately every 10ms, so set your number of samples for your RegisterEveryNSamplesEvent to be ~1M Samples. 

Hopefully that will help with the error,
Micaela N
National Instruments
0 Kudos
Message 15 of 19
(2,884 Views)
Hi Micaela,

We have decided to use 1AI-2DI approach to use our ram more efficiently for large amounts of data acquisition at one shot. I would like to know if there is any other way to read in the analog data other than 'DAQmxReadAnalogF64'. Using this, each sample is of 8bytes and this alone uses up ~916MB for 12 secs of continuous acquisition whereas digital data uses up ~229MB with 1byte/sample (which is reasonable) and our analog samples are always between 0 to+5V.

One more thing is the program is not consistent all the time. Till yesterday it ran fine and read in the data, today it suddenly stopped reading in the values (when I ran it in debug mode at different acquisition times, it seems that it doesn't even go into the callback function for EveryNSamples) and ends the program after it allocates the memory space for variables. I haven't changed the program since yesterday Smiley Sad

thanks,
-Pavan
0 Kudos
Message 16 of 19
(2,824 Views)
Hello Pavan,

Part of the reason each sample is 64bits is that each of the samples has been scaled, you could read in raw data, but this would be in the native format of the device, it is not scaled and you will need to refer to the 6115 document to determine the format it uses.  You will also want to look at the documentation in the NI-DAQmx C Reference Help >> NI-DAQmx Key Concepts >> Reading and Writing Data >> Data Format and Organization >> Raw Data before using this format.  You would need to scale and possibly reorder the data after reading it.

Does anyone else use your program or have access to your hardware?  It's hard to track down a random bug that just appears, so you might see if anyone else has changed anything in your system without telling you.

Regards,
Micaela N
National Instruments
0 Kudos
Message 17 of 19
(2,802 Views)
Hi Miceala,

No one has changed the program since I ran it successfully for the last time. It stopped working suddenly. I can see that the program never goes into the 'EveryNCallback' function even after I start the tasks and rather it ends the program without any errors and without recording in any data. It would be great if someone can run this program and check if they can reproduce the same.

thanks,
-Pavan
0 Kudos
Message 18 of 19
(2,766 Views)
Hi,
I figured out the problem. I just deleted all the devices from MAX and removed the board from the system and reinstalled. Now, its working as it is expected to work.

thanks for your help,
-Pavan
0 Kudos
Message 19 of 19
(2,764 Views)