Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I detect MXI2 card programatically with VB or VC++

How do I detect MXI2 card programatically in VB or VC.
0 Kudos
Message 1 of 4
(3,290 Views)
Sunil,

A National Instruments PCI-MXI-2 and/or VXI-MXI-2 can be detected programatically a number of ways. The most fundamental and portable, and best code practice, is to use VISA functions detect and identify all VXI modules, including the controller (in this case, MXI-2). A "VISA Find Resources" function will provide a list of all controllers and instruments on the system. All VXI devices will be found with a VISA resource of the form "VXIx::LA::INSTR", where "x" is the system number (typically 0) and LA is the device's logical address. After you retrieve the list of all VXI devices with a "VISA Find Resources", you can then use "viGetAttributes" to read manufacturer and model from the instruments for specific identification.

This method uses the VXI and
VISA standards, so it will work not only with MXI-2, but any other controller you choose to use in the future, even if it is a non-National Instruments controller. This portability is one of the major advantages to using VISA.

You can download VISA from the ni.com web page at the following link:

http://digital.ni.com/softlib.nsf/display?ReadForm&lookup=NI-VISA&view=current&node=132060_US

When you install VISA, you will have a an examples directory (for example, c:\vxipnp\Win95\NIVisa\Examples). In this Examples directory are examples for C, VB4, and VB5. One of the "General" examples is a VISA Find Resources Example. You could easily modify this example to detect manufacturer and model of the found devices.

Regards,
Greg Caesar
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,290 Views)
thanks Greg for your reply but could you please let me know what is device id and vendor ID for MXI2 card

thanks
sunil
0 Kudos
Message 3 of 4
(3,290 Views)
Sunil,

The model and manufacturer code of any device can be determined fairly easily in a number of ways:

(1) From Measurement and Automation Explorer (MAX), Goto the menu "Tools" and select "NI-VXI". From here, the entries "VXI Manufacturer Names" and "VXI Model Names" are listed. For all NI hardware, the Manufacturer Code is 0xFF6. For the PCI-MXI-2, the model code is 0xFEC. For the VXI-MXI-2, the code can be either 0xFEA or 0x0EA.

(2) Method two is to use the lookup table itself. The tables of manufacturer and model codes are in the text files "mfnameid.tbl" and "model.tbl" in the VXI/tbl directory of your VXI installation.

Regards,
Greg Caesar
National Instruments
Applications Engineer
0 Kudos
Message 4 of 4
(3,290 Views)