06-14-2011 07:07 AM
Hi ,
I'm trying to find an example for Simultaneously Analog input for my NI6212
I want to Create 5 analog input channels that will work Simultaneously by an hardware trigger...
Thank you
Solved! Go to Solution.
06-14-2011 07:59 AM
A good exampole from which to start could be this one:
NI-DAQmx: Continuous Analog Input with Both Start and Reference (Stop) Triggers
06-14-2011 08:19 AM
HI Roberto ,
I already know how to create tasks , channels and use them.
I'll Reformulate my question :
I have 1 analog output connected to 2 different AI channels.
I want to read the AI at the same time.
Is it a good plan to make 2 different Task Handles for each AI ( tHandleAI1 , tHandleAI2 )
and for this handles to create 2 different AI Channels with DAQmxRegisterEveryNSamplesEvent for each one....
Or maybe there is another way ?
06-14-2011 09:45 AM
If you want to read "simultaneosly" the best option is to have one task only to which you can add both AI channels.
The board will acquire both signals with the time difference only due to switching and settling time -usually some microseconds, it depends on board hardware capabilities. (This is because your board has one ADC only sequentially connected to all AI channels to be used: should you have a "simultaneous sampling" board it would guarantee that measures are effectively taken at the same moment)
06-15-2011 12:30 AM
I have one of the X-Series devices NI PXIe-6356 which can work with Simultaneous Sampling.
So lets say i'll creat 1 task with 5 AI channels.
What i don't understand is how will i control the input buffers , will i get 5 diffrent buffers ? or just 1 big buffer ?
Can i still use the EveryNSamples function for each channel ?
06-15-2011 12:30 AM
I have one of the X-Series devices NI PXIe-6356 which can work with Simultaneous Sampling.
So lets say i'll creat 1 task with 5 AI channels.
What i don't understand is how will i control the input buffers , will i get 5 diffrent buffers ? or just 1 big buffer ?
Can i still use the EveryNSamples function for each channel ?
06-15-2011 01:42 AM - edited 06-15-2011 01:49 AM
I have no experience with simultaneous sampling boards, but I don't think they will act differently from other boards.
The typical structure in this case could be:
1. Create the task
2. Add several AI channels to it
3. Start the task
4, Read data
5. Stop the task
While reading data, you will receive one large buffer with all channels data in it. Options in DAQmxReadAnalogF64 () function permit you to organized the buffer so that channel data are grouped or interleaves, while the function returns the number of samples per channel so that you can properly handle your buffer given that you know how many channels you are acquiring.
EveryNSamples event operates normally, but you must consider that the number passed is the number of samples per channel, so that you will need a buffer at least NSamples * NChannels large to read the entire set of measurements.
06-19-2011 02:38 AM
Hi Roberto,
"Options in DAQmxReadAnalogF64 () function permit you to organized the buffer so that channel data are grouped or interleaves"
I want a better understanding of the option if I'll set the Fill mode to Group by channel (non-interleaved) and I have 3 AI of 300 samps then I'll receive 1 big buffer of 900 samps
That divided like that :
0 - 299: AI0
300 - 599: AI1
600 - 899: AI2
Is it the case ?
06-19-2011 07:56 AM
Yes, that's it!