LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Ivi : logical name sent to specific init function instead of rsrc descriptor

Hello,
I am developping IVI drivers for one of our devices. I have used CVI (5.0)  iviscope templates.
When I directly call specific driver functions, I can acquire and display data without any problem. I call xxxx_InitWithOptions function and give as parameter the resource descriptor and it works.
But when I use IviScope class driver function "IviScope_Init" with a logical name, I have the following error : "Insufficient location information or the  requested device or resource is not present on the system".
When I run the programme step by step, I can clearly see that the resource descriptor sent to the specific driver is actually the logical name.
But if I give a bad logical name, the program is able to tell me that it does'nt belong to the configuration store list of logical names.

I thought that maybe the configuration store was badly configured, so I tried to access configuration store's data through functions such as :
    -IviConfig_Initialize
    -IviConfig_Deserialize
    -IviConfig_GetDriverSessionItemByName
    -IviConfig_GetSessionHardwareAssetReference
I can access the resource descriptor, so the problem doesn't seem to come from here.

Am I supposed to make those function calls in the driver I have written or is it done by IviScope_Init as I think ?
If it is done by IviScope where can my problem come from ?

Thank you very much for your help
0 Kudos
Message 1 of 20
(4,402 Views)
Hi Pak,
  I tried a small piece of code in cvi 7.1 :

#include "iviScope.h"
#include <userint.h>
#include <cvirte.h>

int main (int argc, char *argv[])
{
 ViChar msg[1024];
 ViStatus err;
 ViSession scopeHandle;
 if (InitCVIRTE (0, argv, 0) == 0)
  return -1;    /* out of memory */
  err = IviScope_init ("SampleScope", VI_TRUE, VI_TRUE, &scopeHandle);
  if (err!=0) {
   IviScope_error_message (scopeHandle, err, msg);
   MessagePopup("Error",msg);
  }
  err = IviScope_close (scopeHandle);
  if (err!=0) {
   IviScope_error_message (scopeHandle, err, msg);
   MessagePopup("Error",msg);
  }
 return 0;
}

As long as SampleScope exists and is correctly setup, I don't get the error of ""

You say that if you give a bad logical name then you get a different error?

What versions of what software are you using?

I don't have a scope here to play with, but set up a simulated one using ni-scope 2.8.0f3

with NI-VISA 3.3, and the ivi compliance package 2.2. All running under windows XP.

A good starting point would be to look at an existing driver and see how it's been implemented there.

I also ran up ni-spy set to capture for the ivi-sope calls, and got the attached file (I exported so anyone can view it). The first 2 calls used the wrong name for the logical name.

Thanks

Sacha Emery

National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 20
(4,392 Views)
Hi Sacha,

If I give a bad logical name, I retrieve this error message :
   " The session name or logical name could not be resolve to a session or driver session"

So it seems that at this step, the driver accesses the configuration store successfully, since it can tell whether the logical name exists or not. The problem appears after that, when it tries to get the resource descriptor, since it only gets the logical name again.


The versions of the software I use are :
       Labview 5.0
       MAX 3.1.1
       IVI Compliance Package 2.2
       NI-VISA  3.1
   
    running on XP

I don't have  NI drivers toolset, so I can't use
ni-scope 2.8.0f3 but when I use my logical name and my driver in simulating mode, everything is OK of course.

Thank your for your help and advice, I'll try to find and existing driver to compare with.

David

Message Edited by pak on 07-13-2005 05:50 AM

0 Kudos
Message 3 of 20
(4,393 Views)
Hi,
  so as a simulation it works OK?
Can you attach screenshots of your setup in MAX?
Have you got the logical name and the Driver Session name the same?
Under the Driver Session, what is the actual descriptor for the device? e.g. GPIB0::5::INSTR
If you're using a Visa Alias for the descriptor name, what is the alias showing up as?
Under the Advanced section in MAX, what are your hardware assets?
 
I'm also a little confused. You started out saying CVI 5.0, and now it's LabVIEW?
Can you attach your code so far?
 
Unfortunately we can only directly support the latest Major version and one version back (so that's cvi 6.0 and LabVIEW 6i), although we'll do what we can to help. What operating system are you running on?
 
Thanks

Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 4 of 20
(4,380 Views)
Hi,

The simulation works fine. And it also works fine when I directly use the specific drivers by calling prefix_function() functions.

I gave the same name for  logical name, driver session name, software module name and hardware assets name.

The actual descriptor is VXI0::8::INSTR.

I have only one driver asset as you will see in the screen shot. The name is the same as the logical name and the descriptor is the one given above.

Sorry it was a mistake, I meant Labwindows/CVI 5.0 .

The operating system for the device is XP, but sometimes I use 2000 for simulation or tests on the configuration store.

The code I use when trying to initialise the device is the following :

int main(int argc, char *argv[])
{
    ViSession vi;
    ViInt32 function_card;
    ViStatus error;
    ViString error_message;
    error_message = malloc(256);
   
    error = IviScope_init ("bu3430", VI_TRUE, VI_TRUE, &vi);
    if(error != 0){
        IviScope_error_message(VI_NULL,error,error_message);      
        MessagePopup ("error on initialisation", error_message); 
    }
   
    IviScope_close(vi);
   
}

Thank you,

David


0 Kudos
Message 5 of 20
(4,380 Views)
Hi,
  do you have the source code for the specific drivers? Maybe you can get an idea of what's going on from those. If you downloaded them, can you point me to the link please?
Since I don't have the hardware here it's going to be difficult to investigate.
The link is made through VISA. Which version are you using?
I've gone through our internal databases, and the only links I'm picking up are when the device isn't able to communicate through the VISA layer.
It's possible the prefix_function() functions are going directly to the VXI layer
 
Also, this error will occur if you try to open a VISA session to a VXI instrument before you run resman. I suggest you cycle the power to your VXI chassis then run resman in Measurement and Automation Explorer by right clicking on VXI System and selecting Run VXI resource manager. It is a good idea to refresh the view at this point by selecting View>>Refresh.
 
Thanks
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 6 of 20
(4,367 Views)
Hi,
Sorry, in fact I made a mistake, we don't use the NI version of VISA. Does it make any difference ? Is it possible that some extended NI-VISA features are used and that it prevents me from using Signal Express and IVI drivers with our device and specific driver ?

Concerning the specific drivers, I didn't download them, I wrote them.

Thank you,

David
0 Kudos
Message 7 of 20
(4,357 Views)

Hi,

 it's certainly possible that the third party VISA is an issue. Are you using agilent visa then?

I can't really do a lot here now without the hardware to play with. The principle you're following is sound enough though

Sorry.

Maybe someone else out there has a similar setup?

Can you use the method you first outlined instead of going through the base class driver level?

Thanks

Sacha Emery

National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 8 of 20
(4,345 Views)
Hi again,
I don't use agilent visa either.

The problem is that I want to use my device with Signal Express. And Signal Express uses base class drivers.

So I can't use the first method which consists in using prefix_function() functions.

Thank you for your help.

David
0 Kudos
Message 9 of 20
(4,344 Views)

Hi,

  I had an e-mail from a colleague in the US with some ideas on this thread and I was wondering if you could answer them for me?

------------------------------------------

The fact that he’s not using NI-VISA is a red herring – if the VISA version were an issue, then the specific driver wouldn’t work when accessed it directly.

From what I read in the thread, he can successfully pass a resource descriptor to the specific driver, and he gets and error when he passes a logical name to the class driver. But there’s a crucial piece of information missing here: Can he use a logical name or driver session directly with his specific driver? If the answer is yes, then there’s a problem with how the class driver and specific driver are interacting. But I don’t think that’ll be the result. My hunch is that he simply hasn’t associated the HardwareAsset element with the DriverSession. This can be confirmed if he sends us a copy of his IviConfig file from <C:\program files\ivi\Data\IviConfigurationStore.xml> - I can’t get all the information I would need from the screen shots.

--------------------------------------------------------

Thanks (and thanks Glenn for helping out with this)

 

Sacha Emery

National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 10 of 20
(4,319 Views)