Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Tradition NI-DAQ virtual channels on VB.net

I am using Traditional NI-DAQ (Legacy) with an SC-2345 board and several thermocouples (TC02 modules). I am writing a program with VB.net 2003, and I am not sure how to call the virtual channels for my thermocouples in my program. Sorry, I am totally unfamiliar with Traditional NI-DAQ, but I did manage to create the virtual channels with MAX (http://digital.ni.com/public.nsf/allkb/08B5397FC24F89338625686D007E9773)... now I just need to get them into my program....
 
I think it is something to do with AxCWAI1.Channels.Add...? Any ideas?
0 Kudos
Message 1 of 8
(3,862 Views)
I can add one channel... but it will only allow me to add one. From what I can tell there are 3000 different ways to add a virtual channel, but it will only see one. I can't figure out how to add multiple channels (right now it pulls the data from the first added channel and ignores the rest. If I comment out the first channel, it will read only the second, etc...)
0 Kudos
Message 2 of 8
(3,857 Views)
Hello,
 
If I may ask, what DAQ device are you using?  Would it be possible for you to use the NI-DAQmx API instead?  National Instruments does not include native .NET libraries for Traditional NI-DAQ. This will make it much more difficult for you to use Traditional DAQ in VB .NET 2003.  Since you mentioned that you are not familiar with Traditional NI-DAQ anyway, it seems that it would be logical for you to switch to NI-DAQmx, unless you are using a legacy device that is only supported in Traditional DAQ.
 
You may find some helpful information here: Programming NI-DAQ in Microsoft Visual Basic .NET.
 
Are you currently using the Traditional NI-DAQ ActiveX controls or the Traditional NI-DAQ dll to interface with your DAQ board? 
0 Kudos
Message 3 of 8
(3,846 Views)
Hi Elizabeth,
 
Yes, I am actually using a legacy device (a DAQCard-AI-16XE-50?). I could use the 6015 board, but the DAQCard would be easier because of portability and fewer outlets needed. Which is why I am in the uncomfortable position of programing
 
I am using the ActiveX controls... I can use my program to get the data no problem... here is a snip of my code, although there are a bazillion ways to create the channels. After this code, I use console.writeline to check to see how many channels are open (channels.count....) and it says there are 8. "TCH #" is the name of the channel as how I configured it on MAX, and TCH# is what I was going to use in the rest of my program (a ChannelType). Unfortunately, it pulls the data from whichever channel I add first (in this case, channel "TCH 1"), and gives me that data for TCH1, TCH2, TCH3, TCH4, etc...
 
Thank you for your help!!!
 

AxCWAI1.Channels.Add("TCH 1", TCH1)

AxCWAI1.Channels.Add("TCH 2", TCH2)

AxCWAI1.Channels.Add("TCH 3", TCH3)

AxCWAI1.Channels.Add("TCH 4", TCH4)

AxCWAI1.Channels.Add("TCH 5", TCH5)

AxCWAI1.Channels.Add("TCH 6", TCH6)

AxCWAI1.Channels.Add("TCH 7", TCH7)

AxCWAI1.Channels.Add("TCH 8", TCH8)

0 Kudos
Message 4 of 8
(3,836 Views)

Hi,

Thanks for the additional information.  I am not too familiar with these ActiveX controls, so I will have to do some research to find an answer for you.  I will let you know as soon as I find out anything that is helpful.  In the meantime please let me know if you make any progress.  Thanks!

0 Kudos
Message 5 of 8
(3,814 Views)

Hello,

I just want to apologize for not getting back to you on this issue.  I was out sick last week and I got really far behind.  Are you still working on this issue?  Any updates?

Once again, I am so sorry for my unresponsiveness...

0 Kudos
Message 6 of 8
(3,771 Views)

Not much progress yet... I think it has something to do with right-clicking on the AI control I added to the form, going to properties, and adding named/global channels (created in MAX) there. I have been messing with that recently, but I am still unable to get it working.

Thanks so much, hope you are feeling better!

Marilyn

0 Kudos
Message 7 of 8
(3,762 Views)
Hello Marilyn,
 
Below is an image of the Help for this method.  Looking at the parameters of this method, I am not sure I understand what the second parameter is in your call to the Add method:
 
AxCWAI1.Channels.Add("TCH 1", TCH1)
 
It seems to me that if you are reading virtual channels, you should actually be using:
 
AxCWAI1.Channels.Add("TCH 1" )
 
 
Have you tried this?

Message Edited by Elizabeth L on 08-23-2007 09:19 AM

0 Kudos
Message 8 of 8
(3,746 Views)