LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneously Analog Input

Solved!
Go to solution

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 

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 1 of 9
(2,647 Views)

A good exampole from which to start could be this one:

NI-DAQmx: Continuous Analog Input with Both Start and Reference (Stop) Triggers



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 9
(2,644 Views)

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 ?

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 3 of 9
(2,640 Views)

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)



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 9
(2,635 Views)

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 ? 

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 5 of 9
(2,626 Views)

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 ? 

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 6 of 9
(2,626 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 7 of 9
(2,621 Views)

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 ?

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 8 of 9
(2,530 Views)
Solution
Accepted by topic author Kobi_K

Yes, that's it!



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 9 of 9
(2,528 Views)