09-14-2009 10:39 AM
Hi Ajay,
Here is some general information to get you started and more familiar a few concepts. If you have additional questions/concerns, please provide more information about your application, hardware, and software.
Go to Start>>Programs>>National Instruments>>NI-DAQ>> NI DAQmx Help and search for Data Transfer Mechanisms. This will provide an explanation of the different types of data transfer.
Take a look at this knowledge base article as it discusses syntax.
Start>>Programs>>National Instruments>>NI-DAQ>>Text Based Code Support for Examples and the DAQmx C Reference Help file. Try finding an example that is similar to your application and use it as a reference.
Hope this helps!
09-16-2009 12:15 AM
Hi h_baker,
Thank you for your reply.
I have one query regarding the ADC buffer which generates as event when it is full with the data.
I need to capture this event and read the data from the buffer.
Please let me know the name of the event which is to be captured.
Thanks,
Ajay
09-16-2009 02:11 AM
Hi h_baker,
I have founded that we can register for a particular event through DAQmxRegisterSignalEvent function.
The event which I need to capture is specified by DAQmx_Val_Acquired_Into_Buffer in DAQmxRegisterSignalEvent function.
Can you please provide me with the example in .Net C#?
I want to capture the DAQmx_Val_Acquired_Into_Buffer event in windows service developed in .Net C#.
Regards,
Ajay
09-16-2009 05:30 AM
Hi h_baker,
Can you please let me know the location for NI-DAQmx .NET Reference Help?
Is it available online?
Thanks,
Ajay
09-17-2009 04:50 PM
Hey Ajay,
Take a look at this link as it provides details to the Help File location.
09-18-2009 07:16 AM
Hi,
I am new to application development using Ni DAQ. I want to develop an application which will read the data from the buffer of multiple channels. I founded one way of doing the same i.e. through SampleCompleteEventHandler handler. But I have founded that all the Ni DAQ devices does not support this event handler.
Can you suggest any other way to achieve the same objective?
Thanks, Ajay
09-21-2009 06:14 PM
Hi Ajay,
Correct me if I am wrong; however, it sounds like all you are trying to do is acquire from multiple channels. Attached are a few links that may help you with this:
USB-6009: Best Way to Sample Multiple AI Channels Simultaneously
Continuously Acquiring Data from Multiple Samples in VB.NET
Continuously Acquiring Data from Multiple Samples in C#.NET
I know you are not using C but this link uses the SampleCompleteEvent. Read through the .c file as an example of how it is used.
What hardware are you using?
09-22-2009 02:11 AM
Hi h_baker,
Yes, you are absolutely correct. I want to acquire data from multiple channels at the same time.
I am using NI USB-6212 device as an interface between the tool on one side and my application on the other side. I donot know whether I can acquire data from multiple channels at the same time or not from this device.
I used SampleCompleteEvent event to achieve the same, but unfortunately my device does not support this event. So now I am trying to read the samples through BeginReadMultiSample and EndReadMultiSample APIs provided by Ni DAQ library.
Please confirm that if I will use these APIs and use asynchronous callback method is there any chance of missing the samples?
Regards,
Ajay Kumar Wahi
09-22-2009 03:51 AM - edited 09-22-2009 03:52 AM
Hi h_baker,
I have tried to read the samples from a single channel through asynchronous callback method. When the method is invoked for the second time EndReadMultiSample function throws exception which is mentioned as below:
"Measurements: Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.
Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.
Property: NationalInstruments.DAQmx.DaqStream.ReadRelativeTo
Corresponding Value: NationalInstruments.DAQmx.ReadRelativeTo.CurrentReadPosition
Property: NationalInstruments.DAQmx.DaqStream.ReadOffset
Corresponding Value:
Task Name: aiTask
Status Code: -200279"
Please let me know where can be the issue? I have tried the follwing example with NI USB-6212:
..\Documents\National Instruments\NI-DAQ\Examples\DotNET2.0\Analog In\Measure Voltage\ContAcqVoltageSamples_IntClk
Thanks,
Ajay