AnsweredAssumed Answered

Remote Instrument Communication by c++ problem

Question asked by victorwine on May 24, 2013
Latest reply on May 31, 2013 by victorwine
I don't know what is the reason I cannot identify the new instrument in Command Expert. everything is connect, because Connection Expert clearly show the connection green mark and the IDN command get the GPIB address from the sand & read, even though i had uninstall and reinstall Command Expert.
If I don't use the Command Expert, just remote instrument CSA8200 communication by c++. 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
#include

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.

Outcomes