VISA Instrument. Use VISA READ functions to read your instruments or using the (VISA) Read driver for the instrument. If your instrument drivers use the GPIB nomenclature you may want to consider either converting to VISA format or trying to obtain a newer driver from the vendor or NI website. Each instrument must have a unigue GPIB address. Follow connectivity guidelines for GPIB cables. No more than three cables connected on any instrument and keep the cables as short as possible, especially if you are using relatively large number of instruments.
The reason you carry a single VISA session through the VI is to reduce demands on memory. Each open VISA session takes up memory quickly. In particular true if they are not closed. This is a 'memory leak' condition that will eventually cause you to run out of memory and lock up either the application or the PC, or both. You would want to set up a 'While loop' (wire a F Boolean constant to the exit so it will execute only once) with a Case structure(..0,1..) using shift register to return VISA session to TypeCast(4X)function to determine validity of seesion, non-zero refnum returns indicate an active session. If the refnum returned is Zero, you should wire the inside of that case(..0) using the left shift register to a Visa Close and then use a new VISA Open. Note: in that case 0 do not wire the error to the VISA Close, but to the VISA Open. This will prevent a VISA Close error the first time you run the VI. As long as you follow the above rule for opening and closing, you do not have to individually open or close sessions for a given instrument. The VISA session refnum is the same for all instruments connected. By using a loop sequencer to check the validity of the refnum you will increase the throughput of your VI's.
The same is true for the error wire. You should use a left to right programming technique where possible in the VI flow. Construct sub VI's to handle each step of your overall application. You are then able to connect the Sub-VI's in the main VI using the error wires to predict the flow of the program. It helps to keep your instructions from executing at unexpected times and also allows for better debug tracing. This is just programming technique you will learn as you go.
Also, VISA is a standard for instrument connectivity. If you choose you may use the older GPIB commands, but additional functionality is then prohibted. VISA is the common format used by Alliance Instrument Vendors for setting up instrument drivers today. This allows for easier implemntation of various vendors instruments as well as open I/O connectivity to other standards, i.e serial,etc.
Hope that helps. See the example below, requires LabVIEW 6.0 or higher.
TRaper