Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple instruments with identical channels

Perhaps I should ask a more basic question:
(Using Labwindows/CVI on a PC) I have multiple identical instruments, each of which has multiple channels. I need to address the channel separately from which device it is actually attached to. Say that I have 2 instruments with 3 channels each - I would ideally like to be able to treat this in my application software as 6 separate logical devices. What's the best way to do this? Can I do this through the IVI logical-names mechanism, with IVI keeping track of whether the proper device driver is already open and being addressed?
0 Kudos
Message 1 of 5
(3,475 Views)
The best approach will be different depending upon whether if your instrument has the GPIB secondary address architecture, and how your app accesses the instruments such as through IVI driver or directly through VISA.
 
If the instrument, each of which has three channels, has GPIB secondary address architecture, and if your app directly access them thorough VISA GPIB addresses, it will be easy.  You can accesses 6 separate GPIB address such as through "GPIB0::1::1::INSTR" .. "GPIB0::2::3::INSTR", VISA resources.  Each of them has independent VISA session handle.  However this approach requires your instrument has GPIB secondary address architecture and recently this type is very rare.
 
Hereafter, the case for the instrument does not have secondary address architecure.
 
If you access your instruments through IVI driver, then you will have two IVI sessions for two instrument sets.  Then your app will have to manage 6 pairs of [IVI session and channel name or number].  Below is an example for 6 combinations of each channel.
 
vi1, "Channel1" -- ch1
vi1, "Channel2" -- ch2
vi1, "Channel3" -- ch3
vi2, "Channel1" -- ch4
vi2, "Channel2" -- ch5
vi2, "Channel3" -- ch6
Normally the IVI driver for your instrument must have channel separated functions, therefore they will accept IVI session and channel name string on the parameters.  A simple way is you write a wrapper helper functions that accept your own struct type, containing ViSession (for IVI) and const char* (for channel name) as in the struct data members.
 
If you access your instruments through direct VISA, then you will have two VISA sessions for two instrument sets.  Then your app will have to manage 6 pairs of [VISA session and channel name or number].  The combination will be almost the same as IVI case, but you will have to specify a channel by using instrument specific commands.  If the instrument is SCPI language based, the command can be at a parameter such as "FREQ 400HZ, @1", or use "INSTRument:NSElect 1;:FREQ 400HZ", or "CHANnel 1;:FREQ 400HZ", etc. You will have to check your instrument manuals.  The above struct approach can be applied to this case too.  Anyway can wrap these factors in your helper functions.
 
 

このメッセージは 03-16-2007 01:23 PMに Makoto が編集しています。

0 Kudos
Message 2 of 5
(3,451 Views)

Thank you. The point being, then, that I will have to make a "ChannelHandler" wrapper that keeps track of which instrument a given channel is actually on (e.g. I give it "channel1" through "channel6" and it keeps track of which is on instrumentA and which on instrumentB); this is not done inherently by IVI. I had started to do this by making another "channel" instrument driver that would call the driver for the actual instrument, but thought that I would check to make sure that it wasn't already handled in some other way.

Paul

0 Kudos
Message 3 of 5
(3,439 Views)

Oh, and the instrument doesn't have GPIB secondary addressing.

 

0 Kudos
Message 4 of 5
(3,437 Views)
An IVI instrument driver always handles one VISA address (or one Logical Name) associated with one instrument.  Therefore 6 channels in 2 instrument sets have to be handled by 2 IVI instrument sessions.  IVI does not provide any tools that can treat these 6 channels from one IVI session, because they must be controlled through 2 different VISA IO sessions. 
 
The only exception is when you use IVI-COM driver instead of IVI-C.  If the instrument driver is IVI-COM based and provide channel-based driver architecture, the driver must have channel based COM interface such as IAgilentN5700Output interface (this is an example of Agilent N5700 driver having multiple OUTPUT channel design). Then you will have 6 interface pointers of the same type for each of 6 channels, then you can store them in an array variable, each element of the array can be accessed with the same function call without handling IVI sessions.
 
However, IVI-COM is bit hard to handle from inside CVI environment because it is pure C language, not C++.
0 Kudos
Message 5 of 5
(3,427 Views)