Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how does an application using the VISA calls detect the instruments connected to it

I read that an application using the viFindSrc() returns a list of the number devices connected to it through instrument descriptors.
1)I want to know how the instruments conneced to the system on which the application is running gets information regarding the instruments connected to it.
2)who assigns the resource names to these instruments
 
is the discovery of these instruments done through some broadcast mechanism when the application starts
0 Kudos
Message 1 of 3
(3,277 Views)
Hi Ejv,

There are a couple of ways this function works. You may need to call another function after viFindSrc() if you're using LabWindows/CVI. The following Knowledge Base has that information.

http://digital.ni.com/public.nsf/websearch/2D29FC7DFC93D6D986256D25006B1069?OpenDocument

As far as how this is done, it's doing the same thing that happens when you refresh in MAX. It gets a list of all available ports, and then queries the ports to see if it detects an instrument (or multiple instruments) connected to that port. You will get back an array of the available VISA resources. The resource names are assigned by the VISA driver. You could add VISA aliases in MAX so you could call those aliases instead of the names assigned by the VISA driver.

The broadcast is done when the viFindSrc() is called, not at the beginning of the application. This would allow you to connect a different instrument to a COM port and then send the viFindSrc() again. I hope this information is helpful for you.

Regards,
Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 2 of 3
(3,259 Views)
If I recall correctly, the enumeration of instruments on GPIB ports is done by sending an *IDN? query to each address. All instruments that comply with IEEE 488.2 must respond to this query with a string identifying the instrument. This string must be in a particular format that includes the manufacturer's name, the model number of the instrument, the serial number and a revision. Older instruments that comply with IEEE 488.1 may or may not reply to this query but if they do not, it is still possible to use the hardware handshaking on the GPIB to determine if a listener is present.
 
This all becomes a bit trickier on other interfaces such as RS-232, etc. Fortunately, many instruments will recognize the *IDN? query even when they are not IEEE 488.2 compliant or do not use GPIB as an interface.
Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 3 of 3
(3,243 Views)