05-21-2011 03:02 AM
软件: Win7 32bit,VC++6.0
硬件:USB-GPIB-HS,tds220
我想在VC6.0下写一个程序通过USB-GPIB-HS控制tds220示波器,已经安装了驱动NI488.2,和visa502runtime,在编译示例程序的时候一直报错,不知道是少安装了东西,还是什么别的原因,请前辈们指点,谢谢!
主程序如下:
#include <stdio.h>
#include <stdlib.h>
//#include <userint.h>
#include "tktds2x0.h"
#include "tktds2x0.c"
main ()
{
ViSession tktds2x0;
ViStatus error = VI_SUCCESS;
ViReal64 initialX, incrementX;
ViInt32 actualRecordLength, actualPts;
ViReal64 *waveform = VI_NULL;
/*
If you want to run this sample program and the instrument is not
present, set the Simulate flag to 1. (Example: "Simulate = 1")
*/
checkErr( tktds2x0_InitWithOptions ("GPIB::3::INSTR", VI_TRUE, VI_TRUE,
"Simulate=0,RangeCheck=1,QueryInstrStatus=1,Cache=1",
&tktds2x0));
Error:
return 1;
}
报的错主要是:
Linking...
tktds2x0_example.obj : error LNK2001: unresolved external symbol _Ivi_SetErrorInfo@20
tktds2x0_example.obj : error LNK2001: unresolved external symbol _Ivi_Dispose@4
05-29-2011 09:34 PM
It seems you use the driver from the instruments vender.
Could you directly use the example of GPIB from NI VISA???
05-31-2011 08:44 AM
Dear sir,
I solved this issue already. this problem accurred beacuse I didn't link the ".obj" file.
by the way, the dirver was downloaded from NI.
anyway thank you for your replay!