AnsweredAssumed Answered

viFindRsrc retun..........nothing

Question asked by gerardpuducul on Dec 21, 2011
Latest reply on Dec 21, 2011 by hognala
Hi all,

I try to use VISA with C++;

I want to scan for instrument so i try to use viFindRsrc.

ViChar buffer [VI_FIND_BUFLEN];
  ViRsrc pGPIB_Descriptor=buffer;
  ViFindList GPIB_list;
  ViUInt32 pnumber_of_equip;
  int status;

  viOpenDefaultRM (&defaultRM);
  status = viFindRsrc(defaultRM,"GPIB?*INSTR",&GPIB_list,&pnumber_of_equip,pGPIB_Descriptor);


viFindRsrc return 0 equipment find and the status is equal to -1073807302.

if i try to access to an equipement with this kind of code :

viOpen (defaultRM, (char *)GPIB_Add.toStdString().c_str() , VI_NULL,VI_NULL, &vi);

  /* Initialize device */
  viPrintf (vi, "*RST\n");

  /* Send an *IDN? string to the device */
  viPrintf (vi, "*IDN?\n");

  /* Read results */
  viScanf (vi, "%t", &buf);

all work great and I success to read the IDN

With vifind32 all my equipement are found without problem.

Anyone can help me?