Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

virtual channels in vb.net

I am trying to call a virtual channel in vb.net.  I have set up the virtual channel using Measurement and Automation Explorer.  I don't understand how to call that channel in my code.   I have been just adding a channel(s) and setting it up in my code but I am trying to use virtual channels.  I have created a channel called "3ChannelHipot".  I tried to call it with mytask = New task("3ChannelHipot") but when I run it I get a message back saying: "Task name specified conflicts with an existing task name."  I have also tried to call it using mytask.AddGlobalChannel("3ChannelHipot") and it does not work either.  I know I am not referencing something right or I have left something out of my code to allow access to the National Instruments virtual channels.  Anyone have any suggestions?  Thanks.
0 Kudos
Message 1 of 2
(3,187 Views)

Hi,

 

What error do you get when using Task::AddGlobalChannel(String)?

 

For the error you mention using the Task constructor, I believe that "3ChannelHipot" is a NI-DAQmx Task in Measurement and Automation Explorer and not a virtual global channel.

 

If you want to load a Measurement and Automation Explorer's task you should use the following:

 

Dim myTask As Task = DaqSystem.Local.LoadTask("3ChannelHipot")

 

For adding a channel you already created in Measurement and Automation Explorer, you are using the right method.

 

Regards,

Anzurio

0 Kudos
Message 2 of 2
(3,173 Views)