Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you read temperature from a thermocouple using NI-DAQmx and Visual Basic?

How do I perform voltage/temperature linearization using Visual Basic 6.0 and NI-DAQmx (NOT Traditional NI-DAQ).  Any information or sample code would be greatly appreciated.
0 Kudos
Message 1 of 27
(11,166 Views)

Hello,

Below is a link that explains how to do this and where some examples are on your pc.  Also attached, is a zip file that contains some more specific examples for thermocouple measurements.  This file also include a VB .NET example.  You can just disregard that if you like.  I hope this is enough to at least get you started.  If you have any further questions, please do not hesitate to contact us.  Thanks and have a great day!

http://digital.ni.com/public.nsf/websearch/B22FE2B0F9C8935286256E920073DA07?OpenDocument

Regards,
Lon
0 Kudos
Message 2 of 27
(11,151 Views)
I have a question regarding the source code you gave me.  When I enter the voltage channel and the TC channel in the application and run it I get the wrong temperature values.  If I continue to press the start button on the application the values drop each time.  Is my device configured wrong, or am I not fully understanding the application?  I'd appreciate it if you could provide me with a little more insight.
 
P.S. Thanks for the souce code 🙂
0 Kudos
Message 3 of 27
(11,131 Views)
The application is actually set up for one analog input channel and one thermocouple channel. If you want to simplify it, you can take all of the AI channel stuff out. You also may want to make sure you are using the correct input terminal configuration.  If you are connecting directly to the inputs, you want to be in differential mode.  The program is set to NRSE.  Change the DAQmxSetAITermCfg to DAQmx_Val_InputTermCfg_Diff.  Also verify that you are in fact connected to the TC channel specified in the front panel of the program.  If you are in differential mode, you want to connect one lead to the channel you specify and the other lead to that channel + 8.  I hope this helps.  Thanks and have a great day!
 
Regards,
Lon
0 Kudos
Message 4 of 27
(11,113 Views)
hi yatinM
thanks for your help.I run your vb.net example.but still cannot work.the problem is that in your example daqsystem.local.getphysicalchannels() function only can detect other pxi boards(pxi 4472,pxi 6221). cannot detect pxi4351 and add it.
my programme plate is under windows xp, vb.net 2005.
in my pxi system, 4 pxi 4472s, 1 pxi 6221 and 2 pxi 4351s. Max listed pxi4472 and pxi 6221 under daqmx device,pxi4351 under daq device.
how to read temperature from pxi4351 under vb.net 2005?
 
 
best regrads!
 
 
papaya
 
 
 
0 Kudos
Message 5 of 27
(10,597 Views)
Hi Papaya,
The 4351 is a traditional DAQ device and will not show up under NI-DAQmx devices. This card can be programmed in VB.NET but it is challenging. There are no built in Traditional DAQ drivers for .NET so you will use C function calls to program the 4351. Here is a link to the NI-4351 Instrument Driver. The instrument driver includes some examples. I hope this helps!
Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 6 of 27
(10,576 Views)
thanks for your help.but I am still in the trouble how to program to control pxi4351 under vb.net 2005. as you mention that i have to use C languange. indeed i know less about C. Is there any other way to use vb.net 2005 or Cwai ?
 
best regards!
 
 
papaya in china
 
0 Kudos
Message 7 of 27
(10,553 Views)
Hi Papaya,

I searched the 435x User Manual and did not find any where that specifically said that CWAI could be used to program the 4351. It did list Visual Basic as one of the options for programming the 4351. I did find a Developer Zone article that might prove to be useful for acquiring and logging data in Visual Basic. Do you have Measurement Studio?
Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 8 of 27
(10,529 Views)

Hi Ima U

thanks.I have meaurement studio enterprise 810. and i add the active x(cwai.ocx) into vb.net tool tab,but after drag cwai on my form,there no device listed under the cwai(Axcwai seems window pack it as Axcwai)?so cannot use cwai too.where am i wrong?

searching ni forum days, still in vain.

Regards!

papaya

0 Kudos
Message 9 of 27
(10,523 Views)
Hi Papaya,

It seems that there is some kind of interference with Visual Studio Service Pack 3 and Windows XP with Service Pack 1 using CW DAQ controls. To fix this problem, try to un-install Visual Studio and then re-install without the Visual Studio Service Pack. After this installation is complete, your DAQ board should show up in the CWAI device list. I hope this helps!
Regards,

Ima
Applications Engineer
National Instruments
LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
0 Kudos
Message 10 of 27
(10,508 Views)