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.