Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can not use USB GPIB interface ?

Normally we use a NI PCI GPIB interface board in our system, and my Pascal software works fine.

For debuging purposes we have moved one of the instruments to another location, where we only have the NI USB GPIB interface.

The NI Measurement and Automation Explorer (MAE ?) can see the instrument through the USB GPIB interface and communicate with it.

My software, unfortunately, can not. 😞

When I try the initial ibdev command I just get an $8000 error and no handle.

It is the same software and the same instrument. The only things changed is the GPIB and the PC.

What is wrong?
And how to overcome this ?
0 Kudos
Message 1 of 11
(5,788 Views)
Might it be, that your Pascal programm is linked against an older version of the GPIB-library, that doesn't support the USB-Interface ?
0 Kudos
Message 2 of 11
(5,772 Views)
Could be. The DLLs are dated 2002 and so is the original PAS interface file.

I will see, if I can locate a newer set somewhere.

Here by NI or among my colleagues MANY LabView discs.
0 Kudos
Message 3 of 11
(5,756 Views)
OK have now downloaded the GIGANTICAL ver. 2.5 driver and installed it on my notebook.

But where are all the interface files for language support I also asked to be installed ?

I have found an Examole901239.zip file and downloaded it with major difficulties (Firefox couldn't do it !) but that was MUCH older (1997) than what I am using now.
0 Kudos
Message 4 of 11
(5,745 Views)
Nope! 😞

The newest driver file just downloaded did produce dll and sys files about one week newer that what I already have.
Measument Explorer calls both version 2.52.

So I guess that is not the solution, unless NI has changed something in how the interface is initialized. since 2002.
I can see there is now support for a trigger too, but would it help, if I got the link for tat as well. My LoadDLL works fine as it is.
The problem pops up, when I try to use the USB GPIB unit to get a handle to the external ninstrument.

However, I can see, that I use EOSMODE $140A (LF as terminator or something.)
Do I have to set the interface up to that in advance ?

And how to do that ?
The EOS Byte is cleared to 0 every time I try to save the change. in the explorer.
And only 8 biyts are accepted.


0 Kudos
Message 5 of 11
(5,739 Views)

Walker,

Sorry for some of the confusion, but it looks like your interface is working fine.  Using the interface (GPIB-USB-HS) in Measurement and Automation Explorer (MAX) is always the first step to communicating with your instrument.  Since this works and  your program does not work, your program is probably expecting your interface to have a certain setting that has not been configured yet on your new system.

To discover this setting, we can take two spy captures.  The first should include a short run of your program on the old system (PCI-GPIB) that just opens a board handle does a few operations and then closes it (or just the first few hundred lines or your program executing would be sufficient).  The second capture should have be of the new system and should show the error. 

More than likely your program expects your iterface to be at a different board number (GPIB0, GPIB1...) or a different primary address (PAD - 0, 1...).  These types of errors will be caught by NI-Spy.

For help with taking spy captures, see this KB: http://digital.ni.com/public.nsf/allkb/8D890EC09B15C05A86256E6F007E3E86?OpenDocument

Since v2.5 includes support for Vista, the example programs directory was changed to another location.  The readme will tell you where this new location is (it's OS dependant).

I hope this helps,
Steven T.

0 Kudos
Message 6 of 11
(5,721 Views)
Tried using the NI Spy.

Using it with the PCI-GPIB is, unfortunately, NOT that easy an option as that system is about 80 miles from here 😞
However, going there and debug my software (not the GPIB) may be the only solution, if somebody around here can supply me a car.

Instead I first used the Spy  with  NI's explorer doing a 'Scan for Instruments'.
It started out with an ibfind(GPIB0)

I  managed to get a link to ibfindA  in the software interface and tried sending it a zerro terminated string 'GPIB0'.
It failed. Again with 32768 in ibsta, 0 in iberr and 0xE0140025 in ibcntl. Some driver error it seems.

So far I have seen nothing but that return, no matter what I try. Including addressing a wrong board or device address.
I have single stepped through parts of the DLL, and it does seem to require a zerro terminated string for ibfindA.
And the DLL was looking at a zerro terminated string containing 'GPIB0' ! (0x30 for 0)

During the debug session, the Spy first recorded the command as OK but later it was changed to failed.
I was actually able to single step through NI Spy as well.   Smiley Surprised

But as even this simple command, which does not involve anything but board name, does not work, my problem seems to be somewhere deep in the system, (getting through to the deep below driver or similar) or ... ?

ibfindA and ibdev both end up with the same return values shown above.
After my two deliberate commands I guess it is the GPIBCleanup that finally sends an ibonl(?board?,0), which also fails, returning an EHDL (23) in iberr. (Invalid Handle)
That kind of figures, as ibdev failed to give me a handle in the first place.


0 Kudos
Message 7 of 11
(5,701 Views)

Walker,

Why do you need to get a link to the functions in the DLL?  Are you using direct entry into the DLL instead of using language interfaces provided?  Assuming that you are using a language that does not have language support in the examples folder, you would have to use direct entry into the DLL in order to get to any of the functions.  Which DLL are you trying to access?  I will also need the version of the NI-488.2 driver you are using in your GPIB-USB system.

I had originally thought that you had been using the language interface of one of the supported languages.  This would just require you to include an object file in your project in MSVC for example. 

The answers to the questions above will help us find out what is going wrong.  Since the utilities in MAX are working fine, there is no problem with the driver.

Thanks,
Steven T.

0 Kudos
Message 8 of 11
(5,686 Views)
I am using Delphi 6 (Pascal), for which there does not seem to be direct support.
In fact I have to extract some of the link codes from various demos and guess about the rest from various .H files.

I have not checked, if there is an .OBJ file available, I can use, but it the examples don't use any ....

The driver in use is 2.52, dated Feb. 26th 2007.
I do have one available that is 10 days newer (also ver. 2.52!), but testing my software on a PC with that installed also fails.

0 Kudos
Message 9 of 11
(5,675 Views)

Hello Walker,

You mentioned that you did see the example programs that get installed to your system.  Do these work for general instrument communication?  You should not have to modify anything about these examples except the strings that are sent across the GPIB.

You also should not have to do all of this guess work.  Here is a link that has much more information about using NI-488.2 with Delphi.

http://zone.ni.com/devzone/cda/tut/p/id/4873

I hope this points you in the right direction,
Steven T.

0 Kudos
Message 10 of 11
(5,635 Views)