Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

*.inf file trouble with VISA

Hello:
 
I have a problem with the (*).inf file that provides the VISA Developer Driver Wizard. The file is OK and I put it in the root folder but when I connect the USB device, windows install its own driver because it said that is more convenient for the device. The device is a pendrive and I need to communicate with it using CVI/Labwindows. Maybe I can change some attribute in Windows to force other behavior in it. My Windows version is XP Professional.
 
I wait for your responses please. Sorry for my english.
 
Thank you.
 
0 Kudos
Message 1 of 5
(3,192 Views)
> The file is OK and I put it in the root folder but when I connect the USB device,
> windows install its own driver because it said that is more convenient for the device.
 
Device Driver's .INF files must be placed in C:/Windows/inf directory to make
the OS automatically find. 
 
Other way to enforce your .INF file rather than the default driver is,
go Control Panel | System | Hardware | Device Manager, show the
device's Property and then update its driver to your own.
 
Message 2 of 5
(3,175 Views)
Hello:

I do it and now the pendrive is a NI-VISA device. When i connect the pendrive to the PC, windows doesn't do anything. This is I wanted. Thank you, but now in my program the function viOpen said me:

"Insufficient location information or the requested device or resource is not present in the system".

The program is only for try to comunicate NI-VISA with the pendrive because it is the first step in my proyect. This the #includes and the main function:

#include <cvirte.h>       
#include <userint.h>
#include "comunicacionUsb.h"
#define NIVISA_USB                             //necesario definirlo antes de visa.h para que el preprocesador...
                                                              //...incluya ciertos #defines
#include "visa.h"                                     /*Herramienta para comunicarme con el puerto*/

static int principal;

int main (int argc, char *argv[])
{
   
    /*****Protocolo para establecer sesion*****/

ViStatus status;
ViSession defaultRM, instr;

/* Inicializando VISA */

status = viOpenDefaultRM(&defaultRM);                      //Debe ser la primera funcion de VISA en usar
if (status < VI_SUCCESS) {

/* Error Initializing VISA...exiting */

return -1;
}

/* Access other resources */

status = viOpen(defaultRM,"USB::0x0C76::0x0005::2::RAW",VI_NULL, VI_NULL, &instr);   //0x0C76 : IDVendor, 0x0005 : IDProduct

/* Use device and eventually close it. */

viClose(instr);
viClose(defaultRM);
return 0;
    /*****Fin del protocolo*****/

    if (InitCVIRTE (0, argv, 0) == 0)
        return -1;    /* out of memory */
    if ((principal = LoadPanel (0, "comunicacionUsb.uir", PRINCIPAL)) < 0)
        return -1;
    DisplayPanel (principal);
    RunUserInterface ();
    DiscardPanel (principal);
    return 0;
}

Thank you.
0 Kudos
Message 3 of 5
(3,167 Views)
> viOpen(defaultRM,"USB::0x0C76::0x0005::2::RAW",VI_NULL, VI_NULL, &instr);  
> //0x0C76 : IDVendor, 0x0005 : IDProduct
 
According to NI-VISA help, the integer number next to product ID (mode code) is the "serial number" - in your case it is "2".  Is it right?
 
I recommend to try NI-MAX to show up all the recognized instruments.  If your device is successfully hosted by NI's USB RAW device driver, the NI-MAX must show it and you can learn the correct VISA address that can be passed to viOpen().  I also recommend to see the Device Manager about your device if it is successfully working with NI USB RAW device driver.
Message 4 of 5
(3,162 Views)

Hello:

The problem has disappear. Is possible take the right parameter that carry viOpen from the "Measurement & Automation" program. In my case the correct parameter was USB0::0x0C76::0x0005::NI-VISA-0::RAW for the pendrive. The program don't show the execute time error. A curious thing is that VISA only load his driver for the device if you connect the device in the same port where you pushed it in the first time. If you don't do it , windows take the control on the device. But this port work normally with other devices.

Thank you. 

0 Kudos
Message 5 of 5
(3,148 Views)