Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in IVI driver for Agilent 3458A

I am using V3.0 of the IVI driver for an Agilent 3458A DMM, which I found on this website.  The handle does not get released properly when I closed a session with the instrument and it keeps my custom Test Executive from also closing properly.
 
I recently downloaded V3.11, also found on this website and it has the same problem.
 
I am currently using NI GPIB V2.3, NI IVI Compliance Package V2.3 and LabWindows/CVI 6.0.
 
Any assistance would be greatly appreciated!
 
Thanks in advance!
0 Kudos
Message 1 of 7
(4,501 Views)
Hello cmelo,
        Are you using the IVI-DMM Class driver in your custom Test Executive?  Does the problem occur when you use the driver in simulation mode?

Could you please upgrade your versions of NI 488.2 (GPIB), NI-VISA, and ICP to the current versions and see if that "handles" the handle problem?  The current NI Device Driver CD is a great place to get all of the current versions.

If it does not, please post the minimum amount of code that reproduces the error so I can attempt to reproduce the problem on my end with my 3458A.

Cheers,

NathanT
0 Kudos
Message 2 of 7
(4,471 Views)

NathanT,

Thanks for the suggestion, but upgrading the versions of NI 488.2 (GPIB), NI-VISA, and ICP to the current versions does not correct my problem.

This appears to be something specific to the 3458A IVI driver itself.

In the hp3458a_InitWithOptions function, the call that if commented out allows the custon test executive to exit correctly is

checkErr( Ivi_GetInfoFromResourceName (resourceName, (ViString) optionString, newResourceName, newOptionString, &isLogicalName));

What I did in the experiment I ran, was comment out the above line and just copy the value of optionString to newOptionString and resourceName to newResourceName

Here's the snippet from my modified version:

//checkErr( Ivi_GetInfoFromResourceName (resourceName, (ViString) optionString, newResourceName, newOptionString, &isLogicalName));

strcat(newResourceName, resourceName);

strcat(newOptionString, optionString);

isLogicalName = VI_FALSE;

Doing this now allows the custom test executive to exit properly.

Could I trouble you to look into this?  Thank you very much in advance!

ChrisM

0 Kudos
Message 3 of 7
(4,280 Views)
Hello cmelo,
             Have you had a chance to look at the documentation for the "Ivi_GetInfoFromResourceName" function?  I will include it at the bottom of this post for your reference.  Your workaround is basically doing the same thing that the function should do when the resourceName is not a Logical Name.

             How are you closing the driver session?

How does the 3458 example code run?  Does it close properly?

When you don't comment out
"Ivi_GetInfoFromResourceName", what values are in the parameters before and after the function executes?

What are you passing as "resourceName"?

The issue might be in what the custom test executive is expecting from the driver, not in what the driver is returning.

Cheers,

NathanT


Documentation for your reading enjoyment:

This function returns the appropriate resource name and option string that Ivi_SpecificDriverNew function uses to create a new IVI session. The Resource Name can be an actual resource descriptor or a logical name or driver session name that the user configures with the IVI Configuration utility.

If the string that the user passes in the Resource Name parameter is an actual resource descriptor, this function returns the original resource descriptor and option string in the New Resource Name and New Option String parameters and returns VI_FALSE in the Is Logical Name parameter.

If the string that the user passes in the Resource Name parameter is a logical name or driver session name, this function returns strings in the New Resource Name and New Option String parameters based on the settings of the logical name or virtual instrument in the IVI Configuration Store. The function return VI_TRUE in the Is Logical Name parameter.

Example:

Ivi_GetInfoFromResourceName ("GPIB0::2::INSTR",

"Simulate=1",newRsrcString, newOptionString,&isLogicalName);

newRsrcString and newOptionString contain the same values you pass to the function, and isLogicalName is VI_FALSE.

Ivi_GetInfoFromResourceName ("SampleDMM", "",

newRsrcString, newOptionString,&isLogicalName);

newRsrcString and newOptionString now contain the resource descriptor from the IVI configuration and the option that tells the engine through the Ivi_SpecificDriverNew function that the initial session setup comes from the IVI configuration.

isLogicalName is VI_TRUE.

/*-------------------- Prototype ---------------------*/

ViStatus Ivi_GetInfoFromResourceName (ViRsrc Resource_Name, ViString Option_String, ViChar New_Resource_Name[ ],ViChar New_Option_String[],ViBoolean*Is_Logical_Name);




Message Edited by NathanT on 06-12-2008 12:24 PM
0 Kudos
Message 4 of 7
(4,244 Views)

Nathan,

I apologize but your reply has confused me somewhat.

Because the snippet of code I am executing doesn't use the IVI Configuration Store, commenting out the line of code works.  I believe the function call translates an IVI logical name to a VISA resource string, however, since I am passing in a VISA resource string, the call to the IVI Configuration Store API is not needed.

The snippet of code I am executing just performs an initialize, followed by a close.

I suspect that there some funny going on in COM land...the code actually executes in a COM Server.  On my machine, when I exit my custom test executive, the exectable file not only stays active (I can see this via the Task Manager), but it consumes 100% of the CPU Usage.

Thanks again for your assistance!

Chris

0 Kudos
Message 5 of 7
(4,124 Views)

Is there anyone else who may be able to help me with this problem?

 

Thanks in advance!

 

Chris

 

0 Kudos
Message 6 of 7
(3,913 Views)

Hello Chris,

         It would be great if you could answer the questions that I posed in my previous post.  If the instrument driver is not behaving properly after being modified, I recommend that you do an uninstall/reinstall of the instrument driver.  What development environment are you using?

 

Cheers,

 

NathanT

0 Kudos
Message 7 of 7
(3,897 Views)