Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

AG5462x IVI Driver Bug - Solved???

I just upgraded an old test system design that uses Agilent 54622 scopes and I found the "Query Unterminated" bug in the IVI and P-n-P drivers.  I see several discussions on this but I do not see where this problem has been resolved.  Is there a fix for it?  If not, is someone working on it?
0 Kudos
Message 1 of 12
(5,268 Views)
The bug has been documented, but a fix has not yet been released. 

In the meantime, there is an easy workaround.  In "ag5462x.c" change line 5374 from "viCheckErr( viWrite (io, "*ESR?\n", 7, VI_NULL);" to read "viCheckErr( viWrite (io, "*ESR?\n", 6, VI_NULL);".

Hope this helps,
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 2 of 12
(5,247 Views)
My application uses the scope as an IVI instrument.  Doesn't the 5462x DLL need to be updated to fix this?
0 Kudos
Message 3 of 12
(5,238 Views)
That .c file is the source code for the DLL.  You'll have to rebuild the DLL before you can use it. 
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 4 of 12
(5,232 Views)
I haven't modified one of the NI drivers before.  Are there any special settings to create the DLL, or do I just create a project with the C file in it and set the target to create a DLL.  I notice that the current driver DLL is ag5463x_32.dll.  Is there something special about the _32?
0 Kudos
Message 5 of 12
(5,229 Views)
Not really.  The _32 just means it has been compiled for a 32 bit target.  I'm not as proficient as I should be in CVI, so I'm not exactly sure how you need to set it up.  You may want to post that question to the CVI boards.

Good luck,
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 6 of 12
(5,226 Views)
The following steps will help you re-build the IVI driver DLL:
 
a)  Launch CVI
b)  Load the instrument driver fp file (Instrument>>Load... then select the .fp file)
c)  Select Instrument>>Edit....   This will bring up the "Edit Instrument" dialog.   Select "Edit Function Tree" button.
d)  Select Options>>Create DLL Project
e)  Provide a file name (default project name and directory is probably good) and Save
f)  You should see a dialog titled "Select Directory Structure".  You probably want to pick the VXIplug&play structure so that your files are dispersed in the proper VXIpnp directories (e.g., dll to the bin directory, etc.).  Select OK
g)  The next dialog asks if you want to load the DLL project.   Select "Yes".
f)  Select Build>>Configuration>>Release to create a release version of the DLL.
g)  Select Build>>Target Settings... to launch a Target Settings dialog.    Verify information in the dialog.   You probably want to change "where to copy DLL" to be "VXIplug&play directory".  The reset of the defaults should be good.   Or, rather, I recommend not changing the rest of the defaults.   Select OK.
f)  Select Build>>Create Release Dynamic Link Library.
 
That should do it.  If you need to make an edit to your .c file you should do so before building the DLL.  I recommend rebuilding the DLL without modifications first, just to make sure everything compiles without errors.  Then rebuild with your edits.
0 Kudos
Message 7 of 12
(5,206 Views)
Already did it and got the DLL to work successfully.  However, the code change did not fix the error on the scope.
0 Kudos
Message 8 of 12
(5,201 Views)
Make sure that you copied the DLL you built to both the VXIPNP\bin and the IVI\bin directories, because the DLL is installed to both locations by default. Since both directories are in the system path, either DLL can get loaded first.
 
If that doesn't work, try replacing "viWrite (io, "*ESR?\n", 6, VI_NULL);" with "viPrintf (io, "*ESR?\n");
 
z_haider
0 Kudos
Message 9 of 12
(5,189 Views)

As pointed out in an earlier post, you need to be sure to copy the DLL to both the IVI and VXIpnp directory.  If not, it is possible your application is still linking to the old DLL.  

Maybe you should search your hard disk for the DLLs and make sure that only the updated ones exist -- just to be sure.

0 Kudos
Message 10 of 12
(5,162 Views)