VXI and VME

cancel
Showing results for 
Search instead for 
Did you mean: 

using SMIP with Agilent Slot 0 and NI VISA

I am using VXI-Tech SM8001, 8101 and 8003 in an agilent 6-slot chassis with an E1406 agilent slot 0- controller. Software-wise I am using VXI-tech plug-n-play driver dll called from LAbVIEW 6.1.
From time to time I keep getting an error saying that "The given session or object reference is invalid". Upon investigating a little further with NI SPY I found that this is in response to a viGet Attribute call that queries the LADDR for each module and returns with "". It also seems like for some reason either the resource manager session shuts down or the instrument handle gets lost. Any suggestions?
0 Kudos
Message 1 of 8
(6,744 Views)
We have seen similar issues to this before, and debugging the situation will require meticulous inspection of a NI-Spy file from the driver operation. Typically if an attribute is returned as being invalid, the session you are communicating with is not the session type you expected. So, in the case of an invalid VXI Logical Address, you may be requesting this from a serial port session, for example. Look through the Spy file, and check out all viClose calls and viOpen calls. Resource Manager closings will recursively close sessions below the Resource Manager, and a VISA session ID that has been closed could be opened to a diferent type of instrument further along in the program. You may want to use VISA Interactive Control to help troubleshoot as well. It can hel
p check for valid resources in the system.

Ryan Tamblin
Applications Engineer
National Instruments
0 Kudos
Message 2 of 8
(6,744 Views)
Thanks for your response, Ryan. We have carefully gone through the NI SPY listings in different ciscumstances and have seen some viClose calls come through intermittently. However, we have not been able to trace the origin of these calls, especially since there is no portion of the code that explicitly calls them. This sounds funny but this is exactly what we see. In a unique instance we have seen unsolicited viFindRsrc, viGetDefaultRM and a bunch of viGetAttribute calls come through. Could it be some kind of branching within the VISA level in response to unhandled or error conditions?
0 Kudos
Message 3 of 8
(6,744 Views)
There are situations where LabVIEW does initiate code on its own. For instance, I have seen LabVIEW run viFindRsrc, which is its response to a LabVIEW front panel having a VISA resource present on it. This action populates the drop down list on the VISA resource object. Also, LabVIEW automatically handles opening and closing sessions to the Resource Manager, but only in response to VISA Opens and Closes to particular VISA sessions. I have not seen an instance where a session closes on its own. If you can isolate this behavior to a small, simple, representative piece of code, I would be happy to take a look at the VI.

Ryan Tamblin
Applications Engineer
National Instruments
0 Kudos
Message 4 of 8
(6,744 Views)
Hello Ryan, I have a question originating from your previous response. You wrote "There are situations where LabVIEW does initiate code on its own....LabVIEW automatically handles opening and closing sessions to the Resource Manager, but only in response to VISA Opens and Closes to particular VISA sessions." In our code, the only "closes" we perform once we open the sessions are "Close LV Object Reference" and "Automation Close - Closes an automation refnum". My question is, does LabVIEW close Default Resource Manager sessions when these calls are executed? If so, why are they intermittent and not consistently closing the sessions? (Evident from NI Spy through a series of repeated runs)
0 Kudos
Message 5 of 8
(6,744 Views)
The functions you reference both affect other VI's or programs, so whther or not they close a VISA session depends on how you are using them. As I said before, the best way to debug this is to isolate where the problem is occurring and try to reduce the code down to a simple example.

Ryan Tamblin
Applications Engineer
National Instruments
0 Kudos
Message 6 of 8
(6,744 Views)
The way I use "Close LV Object Reference" is:
I have a generic wrapper that invokes all my instrument Initialize functions (see attachment). I use the Open LV Object Reference to open a reference to the incoming instrument Initialize Function (VI). This functions gets all its parameters from TestStand. Then I execute the respective Initialize VI and then I close the LV Object reference that I opened for that VI.

I use the Close Automation Refnum (see 2nd attachment) when I parse the instrument info to and from TestStand. Here, I use the sequence context as a Property Object and this refnum that I open, is closed at the end using the Automation Close function.

When I do this with all the other instruments in my
system, I do not lose my sessions and the Spy file does not see a viClose during the run. But when I run my VXI instrument initialize it INTERMITTENTLY sees viClose and when it does, it ALWAYS closes all the open Default Resource Manager sessions and this is when the invalid session error pops up.
0 Kudos
Message 7 of 8
(6,744 Views)
You may have misunderstood what supporting examples I was asking for, as the files you have attched are on too large a scale for us to analyze in a timely fashion. In other words, I can not help you debug your code. If you feel there is an inconsistency in what our NI-VXI driver or LabVIEW software is doing, you will have to isolate where the problem is occurring and show us this behavior in a very small, representative example VI. I can not even fully open the code you previously attached, as not all the supporting VI's are present. If you can isolate where the problem is taking place, and create an example that reproduces the problem, we will be able to help you.

Ryan Tamblin
Applications Engineer
National
Instruments
0 Kudos
Message 8 of 8
(6,744 Views)