Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Single and Multi channel Readers/Writers

Solved!
Go to solution

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.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0 Kudos
Message 1 of 7
(8,908 Views)

 


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!

 

0 Kudos
Message 2 of 7
(8,906 Views)
Solution
Accepted by topic author Freestyler

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
Message Edited by reikira on 11-27-2009 07:00 AM
Message 3 of 7
(8,880 Views)

 

 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!

 

 

 

0 Kudos
Message 4 of 7
(8,873 Views)
yes
0 Kudos
Message 5 of 7
(8,870 Views)

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.

0 Kudos
Message 6 of 7
(7,304 Views)

Could you tell me how to get the multichannel data,thanks

0 Kudos
Message 7 of 7
(6,537 Views)