Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

anyone has the code example for measuring the CJCTemp(SCXI1102) with using Visual C++?

thanks, i really appreciate that, as I modify the code implemented in vb, it cannot works in C++. I dun understand how the variant 'volts(0)' in vb works for, i think this cause the problem that I can't get cjtemp.
0 Kudos
Message 1 of 5
(2,937 Views)
The example you are looking at in VB simply acquires a point of data from the CJC channel and stores the resulting voltage in the volts(0) variable. ConvertThermistor() is then called in order to convert a voltage to a temperature.

To do this in VC++ I would recommend starting out with the SCXI_AIonePoint example that ships with the NI-DAQ driver. You can find this example in the \Program Files\National Instruments\NI-DAQ\Examples\VisualC\SCXI directory. If you do not see this directory on your computer than you can perform a custom install of the NI-DAQ driver and choose only to add the examples for Visual C. This will only install the examples, it will not reinstall the driver itself.

Looking at the NI-DAQ Function Reference Manual we see tha
t a call to SCXI_Single_Chan_Setup with a channel number of -1 corresponds to the CJC channel. You simply need to read from this channel and you have the CJC voltage.

NI-DAQ Function Reference Manual for PC Compatibles
http://digital.ni.com/manuals.nsf/websearch/1630A0B68738B269862567C1007A2912?OpenDocument&node=132100_US

Regards,
Justin Britten

Applications Engineer
National Instruments
Message 2 of 5
(2,937 Views)
thanks a lot
0 Kudos
Message 3 of 5
(2,937 Views)
hi, i start to use the example u said to try to read the CJC voltage, but I can't even compile it. the error is as below:
test1Dlg.obj : error LNK2001: unresolved external symbol _SCXI_Scale@52
test1Dlg.obj : error LNK2001: unresolved external symbol _AI_Read@16
test1Dlg.obj : error LNK2001: unresolved external symbol _NIDAQDelay@8
test1Dlg.obj : error LNK2001: unresolved external symbol _SCXI_Single_Chan_Setup@16
test1Dlg.obj : error LNK2001: unresolved external symbol _NIDAQErrorHandler@12
test1Dlg.obj : error LNK2001: unresolved external symbol _SCXI_Load_Config@4


I wonder wat component is missing, can u tell me? thanks
0 Kudos
Message 4 of 5
(2,937 Views)
In the VisualC examples directory I pointed you to, you will find both a .MAK file and a .C file for each example. The .MAK file is a makefile for a Visual C project. This makefile can be loaded into versions of Visual Studio prior to version 6.0, or converted into a project file that is compatible with version 6.0. If you open up the makefile you will find that certain NI-DAQ driver libraries and header files are necessary.
Specifically, you will need to include the nidex32.lib and nidaq32.lib library files.

Regards,
Justin Britten

Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(2,937 Views)