01-07-2009 11:01 AM
Hi,
I am developing a C++ application to control various PXI instruments, one of which is a PXI-4065 DMM. Instead of hard-coding the resource names that will be used to initialize each instrument driver, I am using viFindRsrc to create a list of devices that are connected to the PCI bus. I search through the list using viOpen, viFindNext, and viGetAttributes to find each device. My program works, but the PXI-4065 DMM is not returned by FindRsrc. Does anyone know why or have a workaround?
Thank you!
01-08-2009 01:39 PM
Hi danzimmer,
I've been looking into your issue and have a few questions for you:
If you are using an alias, you may want to try changing the alias name to the actual connect sting name to find it that way. Referencing a previous Discussion Forum, "You might want to use viFindRsrc in conjunction with viParseRsrcEx to match the resource name with an alias if it exists. So, use one of the regular expressions in viFindRsrc to narrow down the resources you are interested in. Then call viParseRsrcEx and compare returned aliases to the one you are trying to match."
Thanks!
aNItaB
Applications Engineer
National Instruments
01-08-2009 03:58 PM
Hi Anita!
Thanks for your reply.
I am using NI-VISA 4.4.1 and the NI-DMM 2.9 instrument driver. These are all the latest versions and are supposed to be compatible with our DMM.
The system does not have an alias set up for any of the PXI devices, including the DMM. The name of the DMM in MAX is PXI1::13::INSTR.
I am debugging my code on a PXI system that has a PXI-4060 DMM and two NI PXI switch modules. My application will eventually run on a system that has a PXI-4065 DMM, but the system is still being assembled. I developed my C code on a different machine and debugged much of it with a DMM set up in simulation in MAX. When my program runs on the development machine, viFindRsrc returns 3 devices (COM1, COM3, and LPT1). I assumed that viFindRsrc didn't see the DMM because the hardware wasn't actually installed - it was set up in simulation through MAX. When my program runs on the system with the PXI chassis, viFindRsrc returns 4 devices (the two NI switch modules, COM1, and LPT1). Now I'm wondering if viFindRsrc didn't return the DMM on my development machine because of a different issue unrelated to it being set up in simulation. Do you know where viFindRsrc gets the data that is returned? Understanding how the function works might shed some light on why it returns the two PXI switches but not the DMM.
Thank you very much for your help!
Dan
01-09-2009 05:25 PM
Hey Dan,
I was able to reproduce this, and it seems it's expected behavior. The viFindRsrc works by calling the NI-VISA driver which then calls the associated VISA aliases. There is a function in LabVIEW called the niModInst Get Installed Device Attribute which will display your DMM. I am still looking into what the associate C++ code is for this VI and will get you some more information. Have a great weekend!
aNIta
01-15-2009 01:35 PM
Hi Anita,
Were you able to find any more information on this issue? I don't understand why this would be expected behavior. In my very humble opinion, viFindRsrc should find any device that can be accessed by VISA, and clearly NI's DMM can be accessed by VISA. Why is this expected behavior?
Thank you very much!
Dan
01-16-2009 05:16 PM
Hi Dan,
I think this discussion forum exactly answers your questions: http://forums.ni.com/ni/board/message?board.id=232&message.id=7435&requireLogin=False. Scroll down to about the 6th post to where pBerg replies. Let me know if you have more questions after going through that. Have a great weekend!!
aNIta