Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

ibfindW function corrupts on NI-488.2M V2.0

Hi,
We have an old Win32 GPIB app software written in C++ that uses legacy "ibfind" function for opening the instrument. The app software is an ANSI-build but it calls either ibfindA() or ibfindW() function depending on the operating platform. The problem is, when running the app on an NT platform, the ibfindW() function never opens the instrument returning always ud=0xffffffff and IBERR=EDVR. The equivalent code is:

int ud;
ud = ibfindW( L"DEV1"); // Does not work

The environment where I could see the symptom is:
USB-GPIB-B with NI-488.2M V2.0
Win2K Pro

The symptom could not be seen on WinMe PC (with the same GPIB & drivers) because the app there invoked ibfindA(). Also I did not see older version of NI-488.2M so
ftware such as V1.6. (I don't know if V1.7 has the same problem or not.)

int ud;
ud = ibfindA( "DEV1"); // Works fine

Is this a bug of NI-488.2M V2.0 ?

Thanks and best regards,
Makoto Kondo, Kikusui Electronics Corp.
0 Kudos
Message 1 of 3
(3,463 Views)
Hi,

Have you tried using just ibfind. In the header file this macro is declared to call the appropiatte functions depending on the character type used. The header file includes:

#if defined(UNICODE)
#define ibbna ibbnaW
#define ibfind ibfindW
#define ibrdf ibrdfW
#define ibwrtf ibwrtfW
#else
#define ibbna ibbnaA
#define ibfind ibfindA
#define ibrdf ibrdfA
#define ibwrtf ibwrtfA
#endif

I believe the L macro is also defined depending on the characters used, so using ibfind would make your code more portable.

DiegoF.
0 Kudos
Message 2 of 3
(3,463 Views)
Hi,

I did some research on this problem and found that it is a reported bug on the Wide character functions.

This error affects affects Windows 2000/XP users when using any of the wide character functions: ibbnaW, ibfindW, iblockxW, ibrdfW and ibwrtfW. We can provide an updated dll version to correct the error.

Please email to the technical support department. Go to www.ni.com/ask and select Email NI as the communication method. Please include all your contact information.

DiegoF
0 Kudos
Message 3 of 3
(3,463 Views)