Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx ReadRaw and EVERYNSAMPLES event

I am using 6132 PCI card to acquire 3 analog channel of data at 1Mhz sampling rate. Originally I use the beginReadMultipleSAmples and endreadmultiple samples way to get the samples in an asyn way. howver, I found I can not keep up with the acquisition speed if I need process the data in real time. This is in .Net 2.5 library. I checked the old C code, it used the readraw method and it only handle 2 bytes per sample per channel. and currently the data returned are double type. Since double is 8 bytes data, I am handling 4 times of data unnecessarily.

 

There is a DaqStream.ReadRaw function can read the raw data from the buffer directly but I do not know a way how to run the function in an asyn way. In the C code there is a "every N sample" event for registration but it is not available any more in .Net library. However, the .Net "SampleComplete" event fire with every sample acquired, with 1MHz rate, this is too often for the system to handle.

 

The question is here that how can we use ReadRaw function in this .Net library?

 

Thank you,

 

 

0 Kudos
Message 1 of 2
(3,185 Views)

Hello,

 

When looking over your post, I'm confused about what you mean with acquiring sample in an asyn way. Do you mean that you want the card to continuously sample and you acquire the sample in the buffer at that particular moment or do you want to have a finite task called when an event occurs that reads X number of samples?

 

As for the questions you have, this is definitely possible using the DAQmxStream.ReadRaw method in .NET 3.5. Unfortunately, I didn't have the .NET 2.0 help installed on my machine but after looking online at several sources, I believe that this is there. After this, you can convert the raw data returned by using the follow KnowledgeBase that explains this in more detail.


Jim St
National Instruments
RF Product Support Engineer
0 Kudos
Message 2 of 2
(3,164 Views)