Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

VB program crashes when I try to read a thermocouple input.

I can monitor 30 voltage inputs on an scxi with a slightly modified datalogger. When I add 1 thermocouple input, the program crashes. How do I add different channel types to my program? I am using named virtual channels. The thermocouple channel is on the same scxi card as some of the voltage inputs (scxi 1122). Do I need to monitor different channel types with a different CWAI controls? IF so, how? ANy help is greatly appreciated.

Regards,
Mike Spaner
0 Kudos
Message 1 of 5
(3,614 Views)
Mike,

When your program crashes, do you receive an error? If not, are you using error handling? Where does the program crash? You should be able to use the same CWAI control with different types of channels.

A little more information concerning the crash may help.

Spencer S.
0 Kudos
Message 2 of 5
(3,614 Views)
The W2K machine just locked up and shutdown. I isolated the problem. I tried to read one thermocouple channel from the scxi rack. I set up a t-type thermocouple virtual channel using measurment automation. When I try to read the channel, the system crashes. I set up the channel as a low voltage input and I am using the thermocouple sample code to do the CJC voltage measurement and I am using the daq tools control to scal the thermocouple voltage:
lErr = CWDAQTools1.ConvertTC(TCType, CJCTemp, cwCelsius, chanVolts, chanTemps)

Is there an easier way to read the thermocouple temperature or is the use of DAQ tools required?

Thanks,
Mike
0 Kudos
Message 3 of 5
(3,614 Views)
Mike,

You should be able to use your thermocouple virtual channel. If you run the example from the following location with your thermocouple virtual channel entered as the "Channel" input, do you also receive a crash:

C:\Program Files\National Instruments\MeasurementStudio\VB\Samples\DAQ\Scxi\Continuous Acquisition

I was able to run this example with a thermocouple virtual channel.

Spencer S.
0 Kudos
Message 4 of 5
(3,614 Views)
Thanks...I finally got everything working. The problem was that I was using one cahnnel list for two channel type (thermocouple and voltage). All is well...
Mike
0 Kudos
Message 5 of 5
(3,614 Views)