PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

What's this visa attributes?

I want to initialize my PXI system automatically in my application.But I am not familiar with visa API,so I tried to learn how to use visa API.Firstly,when I write some codes,they didn't work.they are copied below:

status=viOpenDefaultRM(&defaultRM);
status=viFindRsrc(defaultRM,"?*",&findList,&numInstrs,desc);

Using these codes,the program can only find serial ports and parallel port,it can not find the PXI resources.So I used the NI SPY to get some information. From the captured result, I found the MAX used 3 lines of codes between the above two lines of codes,they are copied below:

status=viOpenDefaultRM(&defaultRM); status=viGetAttribute(defaultRM,VI_ATTR_RSRC_IMPL_VERSION,&version);
status=viGetAttribute(defaultRM,0x3F
FF0190,&iUint);
status=viSetAttribute(defaultRM,0x3FFF0190,32792);
status=viFindRsrc(defaultRM,"?*",&findList,&numInstrs,desc);

In these codes,I don't know which attribute 0x3FFF0190 represents,even after I searched the visa.h file.
Can you tell me why the previous codes can not find PXI resources and What attribute 0x3FFF0190 represents?
Thank you !
0 Kudos
Message 1 of 3
(3,253 Views)
Zhang:

What kind of PXI resource are you trying to get access to?

In particular, you should use only 1 driver for any given plug-in card. If you are trying to use an NI PXI/PCI card (such as a DAQ card) then you really shouldn't be using VISA to try to program it.

If you have some other vendor's card, then you need to register the card with NI-VISA by using the VISA Driver Development Wizard. There is a good tutorial at the following URL:

http://zone.ni.com/devzone/conceptd.nsf/webmain/ADF3152837E2B4A486256B5600642AC7?opendocument

The attribute you see in NI Spy when you run MAX is an undocumented attribute that lets MAX show all PXI devices in the system, regardless of which NI driver is controlling it. That's why it's called "PXI System" and no
t "PXI Devices", because it's really a physical system-wide view of your entire PXI system.

Note that if your device isn't showing up in MAX today, then it's simply a matter of your device not being registered with VISA. Once you use the wizard as described above, it will show up in viFindRsrc without you having to set any special attribute.

Dan Mondrik
National Instruments
0 Kudos
Message 2 of 3
(3,253 Views)
Thanks for your answer!
0 Kudos
Message 3 of 3
(3,253 Views)