03-10-2011 10:46 AM
Hi
I"m using the NI6250 and I want to sample 4 analog input channels.
I want to use the maximum sampling rate of the card
I only need to sample "simultaneously" 2 channels at one time.
I do want to use the 500Mhz/ch capacity.
I don't want to create/clear task every time, but rather set it up at the beginning of my test, and then, switch from one task to another. (each task being sampling of 2 channels)
Can you show me how to do it?
Thanks
RK
Solved! Go to Solution.
03-10-2011
11:49 PM
- last edited on
04-16-2024
06:37 PM
by
Content Cleaner
Hi Rafi,
Unfortunately, it seems like you cannot achieve 500Mhz/ch sampling with the 6250 board you have.
You need some high-end digitizer like this one for such a high sampling rate.
Even in that case you only have 2 channels per board, not 4.
NI's digitizer cards use NI-Scope as their driver, not DAQmx.
So you do not have tasks.
You initialize to board (get a handle), configure the channel/trigger/acquisition and start reading samples from the board.
First, decide on the board you will use, then work on the related driver.
03-11-2011 11:23 PM
Hi Eren,
Tanks for the answere. Actaully I don't need to sample at 500Mhz, I only stated that, as an example, in order to get the solution for handling the 4 channels.
The facts are that I am using the NI6250 and that my hardware is ready and I need to solve this problem in the next few day.
I need to sample pulses which are 500usec wide and with a frequency of 14 hz.
As I stated previously, I'm sampling between channels 1&2, then, 2&3, then 3&4 and last 4&1.
I made some calculations and I decided the following:
I plane to sample at 40Khz as I take into account the errors due to settling time. (there's a graph in the M-Series guide that shows the settling error time as a function of the voltage difference between the channels).
The question now remains...how do I handle the 4 tasks?
Thnks
RK
03-13-2011
03:12 PM
- last edited on
04-16-2024
06:38 PM
by
Content Cleaner
Hi RK,
What you're looking to do may be possible depending on the details. Are you hoping to avoid stopping the current task and starting a new one because you need a seamless transition from one set of channels to the next, or is there another reason? There are a couple of examples I would suggest looking into:
https://forums.ni.com/t5/Example-Code/Read-Multiple-Channels-Sequentially-Using-DAQmx/ta-p/3505693
The first example sets up two tasks and switches between them using a reference trigger. However, this may be difficult to expand to 4 tasks. The second example seems like it might work better - essentially you set up a scan list for the various acquisitions you need. This solution should work as long as you know in advance how many samples from each pair of channels you need to acquire.
The simplest option would be to sample all 4 channels at all times, and simply discard the data you don't need. This would reduce the sampling rate per channel you can achieve, but it also greatly reduces the complexity.
Hope this helps!
Morgan S
Applications Engineer
National Instruments
03-13-2011 03:57 PM
Hi Morgan,
1. I does not need to be a seamless transition from one pair to another.
2. What do you mean by "stopping the current task and starting a new one" ? Did you mean 'Clear' the task or 'Stop' the task?
3. If I need to, I could create task, do the job, clear the task. Do it over with the next channel pair. However, I saw some LV example where 2 tasks are switched by a selector. Since I'm working with CVI and Measurement Studio, I thought to do the same thing. Create four tasks and keep the 4 handles. Then for each channel pair I'll do start task and stop task then, get the measurement and samples with the appropriate handle.
4. With this approach I'll set up my JIG at the beginning of the test, and clear it up at the end. Overall, I think it's better than create/clear tasks throughout the test.
4. Is that a possible approach? Will the card be switching between just 2 channels while the 3 other tasks are stopped?
Thanks again
RK
03-15-2011 09:44 AM
Hi RK,
You don't need to clear and recreate the task each time, you can indeed keep the same handles and switch between them. You will just need to use the Stop Task and Start Task functions to make sure only 1 task is running at a time. I have tested this by creating three tasks, setting different combinations of channels on each, different sampling rates on each, and then using those same 3 task handles in a loop with just a Start Task, Read, and Stop Task. I think you should be able to do exactly what you're describing.
Morgan S
Applications Engineer
National Instruments