LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

viFindSrc() Returns only 2 of 14 PXI Devices

Solved!
Go to solution

I can see 14 PCI/PXI devices in NI-MAX.  However, when I try to verify the devices with the code below only two devices are returned.  I have added three extra lines of viFindSrc() code to try to find the correct combination.  All four return two PXI devices.

 

   //~~~~~~~~~~~~~~~ Find All PXI/PCI Based Test Station Instruments ~~~~~~~~~~~~~
   //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
   // First we will need to open the default resource manager.
   ReturnCode = viOpenDefaultRM (&hResMan);
   
   if(ReturnCode < VI_SUCCESS)
   {
      sprintf(ErrMsg,"%s","Function: FindInstruments() --> viOpenhResMan()\n\n");      
      ChkForErr(ReturnCode);      
   }     
    
   // Find all of the PXI/PCI based instruments (that use a VISA based device driver)
   // This will return a list of instruments that are shown in NI-MAX as part of the
   // initial station configuration (PXI/PCI/GPIB).
   // Note: The initial station configuration is read upon power-up and booting of the
   // station PC. The station, PXI chassis and all GPIB instruments must be powered on
   // FIRST before the PC is powered on.

   ReturnCode = viFindRsrc (hResMan, "?*PXI?*INSTR", &FindList, &NumInstrs, InstrDescript);
//   ReturnCode = viFindRsrc (hResMan, "PXI[0-9]?*INSTR", &FindList, &NumInstrs, InstrDescript);
   ReturnCode = viFindRsrc (hResMan, "?*PXI[0-9]*::?*INSTR", &FindList, &NumInstrs, InstrDescript);
   ReturnCode = viFindRsrc (hResMan, "PXI?*INSTR", &FindList, &NumInstrs, InstrDescript);

   if(ReturnCode < VI_SUCCESS)
   {
      sprintf(ErrMsg,"%s","Function: FindInstruments() --> viFindRsrc(PXI/PCI)\n\n");      
      ChkForErr(ReturnCode);
   }  

0 Kudos
Message 1 of 2
(2,840 Views)
Solution
Accepted by topic author herbertwatson

I found the solution on ni.com.  See “Setting VISA to Recognize All of the PXI Devices in a PXI System”.

http://digital.ni.com/public.nsf/allkb/B9BEB4A3C383BF4486256FCE0008EA72

0 Kudos
Message 2 of 2
(2,832 Views)