Remote Instrument Communication by c++ problem

I had connected PC and CSA8200 by Agilent GPIB/USB interface, and using Agilent Connection Expert, Microsoft Visual C++ 2010. I tried to remote CSA8200 by using a simple c++ examples code. the code looks good, show as fallows:

--------------------------------------------------
/*idn.c
This example program queries a GPIB device for an identification string
and prints the results. Note that you must change the address. */

#include <visa.h>
#include <stdio.h>

void main () {

ViSession defaultRM, vi;
char buf [256] = {0};


/* Open session to GPIB device at address 01 */
viOpenDefaultRM (&defaultRM);
viOpen (defaultRM, "GPIB0::01::INSTR", VI_NULL,VI_NULL, &vi);

/* Initialize device */
viPrintf (vi, "*RST\n");

/* Send an *IDN? string to the device */
viPrintf (vi, "*IDN?\n");

/* Read results */
viScanf (vi, "%t", &buf);

/* Print results */
printf ("Instrument identification string: %s\n", buf);

/* Close session */
viClose (vi);
viClose (defaultRM);
}

------------------------------------

the output seems like there is a path issue. show as fallows:

-----------------------------------

The thread 'Win32 Thread' (0x1020) has exited with code 0 (0x0).
'test02.exe': Unloaded 'C:\Program Files\IVI Foundation\VISA\WinNT\agvisa\instr32.dll'
'test02.exe': Unloaded 'C:\Program Files\IVI Foundation\VISA\WinNT\agvisa\autocf32.dll'
'test02.exe': Unloaded 'C:\WINDOWS\system32\sicl32.dll'
The thread 'Win32 Thread' (0xd80) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x908) has exited with code 0 (0x0).
The program '[3200] test02.exe: Native' has exited with code 0 (0x0).
-----------------------------------------------------------------

and then i compile again another output show as fallows:

----------------------------------------------------------------------


'test02.exe': Loaded 'C:\Documents and Settings\testop\Desktop\test02\Debug\test02.exe', Symbols loaded.
'test02.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\visa32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\agvisa32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\version.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\msvcr100.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\msvcp100.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\msvcr100d.dll', Symbols loaded.
'test02.exe': Loaded 'C:\WINDOWS\system32\shimeng.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', Cannot find or open the PDB file
'test02.exe': Unloaded 'C:\WINDOWS\system32\shimeng.dll'
'test02.exe': Loaded 'C:\Program Files\IVI Foundation\VISA\WinNT\agvisa\instr32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\sicl32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\Program Files\IVI Foundation\VISA\WinNT\agvisa\autocf32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\Program Files\Agilent\IO Libraries Suite\drivers\ag357i32.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\82357ipt.dll', Cannot find or open the PDB file
'test02.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll', Cannot find or open the PDB file
The thread 'Win32 Thread' (0xdf0) has exited with code 0 (0x0).
First-chance exception at 0x7c812fd3 in test02.exe: Microsoft C++ exception: int at memory location 0x0013fc90..
First-chance exception at 0x7c812fd3 in test02.exe: Microsoft C++ exception: int at memory location 0x0013f9c8..
The thread 'Win32 Thread' (0x13b8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xf9c) has exited with code 0 (0x0).
'test02.exe': Unloaded 'C:\Program Files\IVI Foundation\VISA\WinNT\agvisa\instr32.dll'
'test02.exe': Unloaded 'C:\Program Files\IVI Foundation\VISA\WinNT\agvisa\autocf32.dll'
'test02.exe': Unloaded 'C:\WINDOWS\system32\sicl32.dll'
The thread 'Win32 Thread' (0x3c0) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x12b0) has exited with code 0 (0x0).
The program '[3140] test02.exe: Native' has exited with code 0 (0x0).

------------------------------------------------------------------------------------


Any C++ guy know what is going on? and how can i fix it? Thank you so much.
closed account (G309216C)
Hi,

Too bad that Visual Studio cannot find the needed DLL and Headers files because it needs to export and load them into the exe. Try re-installing SDK again.
I had already uninstall and reinstall. it doesn't work. i think it might be the coding problem, or i need to use the VXIplug&play.
Topic archived. No new replies allowed.