11-26-2009 02:40 AM
Hello! I went through the documentation for the various channel readers and I have still some questions, but let me first explain what I have to do:
we're writing a software in C# and I'm writing the data acquisition part. This module should expose high-level functions to the rest of the software, masking the used hardware, so the methods that I'm writing are as general as possible (the module will "translate" the high-level functions in daqmx calls).
Now let me explain my question: I'm a little bit confused between the single-channel and the multi-channel reader and writer functions. What is intended for channel? Virtual channel or physical channel? And what happens (which reader/writer should I use) if a virtual channel includes more physical channels (e.g. "Dev1/ai0,Dev1/ai1")
Thank you in advance... This is the first thing that I would like to know, I'll ask you the rest afterwards.
Solved! Go to Solution.
11-26-2009 03:50 AM
Freestyler wrote:
And what happens (which reader/writer should I use) if a virtual channel includes more physical channels (e.g. "Dev1/ai0,Dev1/ai1")?
I've just realized that this question was unclear. I had in mind two main and one secondary scenario:
1. A task with a single virtual channel with some physical channels inside (e.g. call once "CreateVoltageChannel" with some physical channels)
2. A task with multiple virtual channels, one for each physical channel used (e.g. more "CreateVoltageChannel", one for every physical channel)
3. A task with multiple virtual channels with mixed single/multi physical channels
Thanks!
11-27-2009 06:59 AM - edited 11-27-2009 07:00 AM
Hi Freestyler,in the attached file you can find some info about Virtual and Physical channels and Tasks.
a) You can’t create a single channel with some virtual channels inside; a virtual channel is a physical channel with some optional info connected
b) You can create a task with multiple virtual channels inside
c) In order to create more than a virtual channel inside a task, you can use one CreateVoltageChannel for all the channels if all the channels have the same property value (such as Range, etc.) or different CreateVoltageChannel if you want to set different properties for each channel
d) If you have a task with only a virtual channel inside you will use DAQmx Read >>Analog>>Single channel, if you have multiple channels inside the task, you will use DAQmx Read >>Analog>>Multiple channels
Serena
11-27-2009 09:20 AM
Thank you for your response!
@reikira wrote:c) In order to create more than a virtual channel inside a task, you can use one CreateVoltageChannel for all the channels if all the channels have the same property value (such as Range, etc.) or different CreateVoltageChannel if you want to set different properties for each channel
d) If you have a task with only a virtual channel inside you will use DAQmx Read >>Analog>>Single channel, if you have multiple channels inside the task, you will use DAQmx Read >>Analog>>Multiple channels
OK, I think that now I've understood (this was the unclear part). So, for example:
I have 16 AI channels (NI-6229 with differential inputs).
I'm adding some voltage channels to the AItask I've created:
AITask.AIChannels.CreateVoltageChannel("Dev1/ai0:2", "SomeChannels0,SomeChannels1,SomeChannels2", AITerminalConfiguration.Differential, -10, +10, AIVoltageUnits.Volts);
AITask.AIChannels.CreateVoltageChannel("Dev1/ai8", "JustOneChannel", AITerminalConfiguration.Differential, -10, +10, AIVoltageUnits.Volts);
After this I'll have 4 virtual channels with names SomeChannels0, SomeChannels1, SomeChannels2 and JustOneChannel, am I right?
Thanks again!
11-27-2009 09:32 AM
07-15-2013 04:12 AM
Hi Reikira
b) You can create a task with multiple virtual channels inside
Can you please tell me how can I create a task (programatically) with multiple virtual channels? I have tried this using task.AddGlobalChannels()..but it works only for a single virtual channel.
For e.g. If I have a virtual Channels with name Channel_1 that represents port0/line1 in MAX and Channel_2 which represents port1/line2 in MAX and I wisht to create a task that has both the channels in it, how will I do it?
Regards
Ricky
________________________________________________
Note: I do not wish to give physical channel name while creating a task. This way I use abstraction by MAX efficiently..which means that the user does wiring, give name to channels in MAX and then runs to program which has same output..no matter to which port or line the wires are connected because it uses Virtual names and not physical name.
05-28-2016 06:34 AM
Could you tell me how to get the multichannel data,thanks