Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling Multiple GPIBs in C#

Solved!
Go to solution

I think that it may be more efficient to just use VISA calls to identify all of your GPIB resources, and then rename them something specific and always reference each instrument by that specific name.

 

LINK:

How do I Programmatically Determine Available Resources at Run-time?

http://digital.ni.com/public.nsf/allkb/FA9073730B255BE586256E54005B13C4

 

Can you determine anything specific about each instrument that you can ID them from? (ex. serial number you can access over VISA)

 

What functionality are you going for? Do you want to ID each instrument and then name them based on the instrument connected? Can you describe your application more in depth?

0 Kudos
Message 21 of 31
(1,931 Views)

I don't think I can use visa calls - it is a 488.2 which runs off the NationalInustruments.NI4882.dll not the visaNS.dll or visa32.dll. The goal is to not have to keep track of any names or serial numbers - a technician needs to be able to plug in up to 12 GPIBs to our system and not have to keep track of each respective GPIB - hence why I want to programmitcally reset the ID's each time my program is initiated. As of now we are just stacking our devices on one GPIB all referenced to board 0. we would like the capability to have separate GPIBs for each device though and not have to reset configuration data through VISA MAX (too complicated for our not so tech savy technicians). My job is to make it is easy and fool proof as possible.

0 Kudos
Message 22 of 31
(1,929 Views)

The 488.2 calls are very similar to VISA calls. I might suggest trying to use that to clear the names of your devices. I've attached the user guide below. The clear call for a device in 488.2 is normally "ibclr" as well. 

 

488.2 User Manual

http://www.ni.com/pdf/manuals/370428v.pdf

 

488.2 Quick Reference Guide

http://www.ni.com/pdf/manuals/370497d.pdf

 

Are all your GPIB instruments the same? Why would you want them to re-enumerate and not be specific?

 

Spencer | NI

0 Kudos
Message 23 of 31
(1,920 Views)

I am already calling IBCLR, Clearing devices is not the issue or solution. I need to clear the board ID  that is  stored somewhere in the Windows Registry. The system configuration API seems like the way to go but I do not see the functions needed when I create a System Configuration session in my program. I have read those manuals countless times, the answer is not there. I want to reset the board IDs because we sometimes have 12 different GPIBs plugged into one computer and the board IDs save permanently so if you mix up the cables later, nothing will work. The only solution is to either reset it through VISA MAX or physically label each GPIB to keep track of the board ID's. Neither of these are acceptable I need to programmittcally reset the ID's. How does the VISA MAX program access the windows registry to clear the stored plug n play data?

0 Kudos
Message 24 of 31
(1,913 Views)

I have been talking with one of my colleagues here who is talking with you in a very similar thread. It appears that you have to explicitly install support for .NET in the System Config to have access to the API. Hopefully the steps outlined in that thread are helpful. 

 

Otherwise another option is to just create a LabVIEW EXE and utilize the System  Config API in that environment and run the EXE whenever you need to clear the registries. 

 

In the future please do limit your posts to a single forum post per issue, this helps keep the forums organized. 

 

Spencer R | NI

0 Kudos
Message 25 of 31
(1,899 Views)

I have installed .Net support the API, I just don't see the full function list for System Config. The posts were originally for two different things but then came down to the same issue.

0 Kudos
Message 26 of 31
(1,897 Views)

If you have successfully installed the support you should have examples at this file location...

 

C:\Users\Public\Documents\National Instruments\MStudioVS2012\DotNET\Examples\SystemConfiguration

 

There is an example named "ResetAllDevices"

 

Spencer R | NI

0 Kudos
Message 27 of 31
(1,890 Views)

I have that example. Reset all devices does not reset the  board ID's. That example resets all devices in the device class - the board class is what needs to be reset.

0 Kudos
Message 28 of 31
(1,887 Views)

Hi hwalke,

 

Have you seen this other forum post? It may have the call you're looking for:

 

Quote:

These particular commands were the only ones I've found from the NI 488.2 API, however, there is a text-based solution that does the board reset.

 

There is a function from Measurement Studio "Board.Reset" which resets the board and places all its software config parameters in their preconfigured state.


http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Resetting-and-self-test-of-GPIB-controller-bo...

Jorr-El
Systems Engineer
Testeract: Automated Test Specialists
0 Kudos
Message 29 of 31
(1,874 Views)

When I try to follow that link I get an error stating:

 

"An invalid set of parameters has been specified in the url."

0 Kudos
Message 30 of 31
(1,863 Views)