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 が編集しています。