09-27-2012 09:32 AM
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);
}
Solved! Go to Solution.
09-27-2012 12:49 PM
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