Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

detect multiple board

Hi,
I am using Measurement Studio in a VC++ app.
To create a CNi4882Board object, I can do:
NI::CNi4882Board gpib_board("GPIB0")

but that means, I have to hardcode "GPIB0" in my app. I want to detect/get
the logical GPIB interface names (like "GPIB0" or "GPIB1") from somewhere.
I do not know how to do this. The purpose of this is to auto-detect gpib
interfaces and devices connected to the interfaces at run-time from my app.

The other problem is related. To create an NI::CNi4882Device object, I have
to supply the "board number" for this device. How do I get the board
number?
I can do:
NI::CNi4882Device(NI::CNi4882Address(nGpibAddress), 0,
NI::CNi4882::TimeoutValue::t10s, true, 0)

but it is only for devices connected to board "0".


I have observed that the logical board ("GPIB0") and the board number (0)
are configured in the "Measurement and Automation" app supplied by NI. Is
there any way to communicate with this app and extract the info?

Your help is much appreciated.
Best regards,
Saayan
0 Kudos
Message 1 of 5
(3,025 Views)
Hi,

The bus number is always going to be the number in the interface name (GPIB0 -> 0, GPIB5 -> 5, etc).

The GPIB.INI file in the WINNT\System32 directory is the file used by the driver to store the interface settings. You could use this file to determine if the interface is valid (or get a list of interface numbers to test).

It is usually better to have some mechanism to allow the user input the interface number or name (something like command line arguments).

DiegoF.
National Instruments.
0 Kudos
Message 2 of 5
(3,025 Views)
Hi,
Thanks a lot for your reply. I am using XP Professional - unfortunately could not locate the GPIB.INI in the system directory (windows\system32)and the whole system - searched case-insensitive the entire hard-drive.

Maybe because I am using the .NET version of Measurement Studio or XP, the GPIB.INI is not used. Could not find anything in the registry either .... maybe it is storing settings in serialized files? The win2K machines have the GPIB.INI in winnt\system32 directory - I checked on a win2K machine.

The reason for not letting the user input the interface number or name in the app is that, the information would be duplicated from MAX and I would really like to avoid the redundancy.

Any help about this is much appreciated.

Thanks again
,
Saayan
0 Kudos
Message 3 of 5
(3,025 Views)
Hi,

That is strange, since it is the NI-488.2 driver that installs the GPIB.INI file. The driver is the software that actually manages the hardware, so it is necessary even if you are using the Meaasurement Studio ActiveX controls.

Check on the Measurement & Automation Explorer (MAX) under software for the version of the NI-488.2 driver.

DiegoF.
National Instruments.
0 Kudos
Message 4 of 5
(3,025 Views)
Hi,
Please see below an excerpt from the nireport.sif file generated from MAX. Perhaps that might be useful ..
Thanks,
Saayan


NI Software Information:
CVI Run-Time 6.10.1.2
ComponentWorks
3D Graphs Controls 6.0.590
DataSocket Controls 4, 0, 3, 367
User Interface Components 6.0.594
IVI Engine 1.83
Measurement & Automation Explorer 2.1.3.15
NI Spy Version 1.4
NI-488.2 Software Version 1.60
NI-PAL Software Version 1.5.6f0
NI-VISA 2.5.2
NIGpvx32.dll 2.5.2 (Build 1)
NIPassportRegEdit.dll 2.5.2 (Build 1)
NIvisaic.exe 2.5.2 (Build 1)
NiVi488.dll 2.5.2 (Build 1)
NiViAsrl.dll 2.5.2 (Build 1)
NiViEnet.dll 2.5.2 (Build 1)
NiViGpvx.dll 2.5.2 (Build 1)
NiViPxi.dll 2.5.2 (B
uild 1)
NiViSv32.dll 2.5.2 (Build 1)
NiViVxi.dll 2.5.2 (Build 1)
viic_ext.dll 2.5.2 (Build 1)
visa32.dll 2.5.2 (Build 1)
visaconf.dll 2.5.2 (Build 1)
0 Kudos
Message 5 of 5
(3,025 Views)