Back: Device configurations Forward: 6.3 Handling of several instances of fsc2   FastBack: 6. Device Functions Up: 6. Device Functions FastForward: 7. Other Modules         Top: fsc2 Contents: Table of Contents Index: Index About: About This Document

6.2 Using two (or more) devices of the same type

What if you need to use e.g. two digitizers simultaneously? When the names of the functions for accessing both the digitizers are identical how does one specify which one to use for a command? Actually, it's quite simple. In the DEVICES section the two digitizers will be listed as

 
tds754a;         // first digitizing oscilloscope
lecroy_wr;       // second digitizing oscilloscope

If now a curve from the first digitizer is needed one simply uses the normal way to fetch it, i.e. the usual function name:

 
curve1 = digitizer_get_curve( );

And to get a curve from the second only "#2" needs to be appended to the function name:

 
curve2 = digitizer_get_curve#2( );

and fsc2 will automatically know that now the second of the digitizers from the list of devices is meant.

Of course, if there are three digitizers listed in the DEVICE section you would append "#3" to the function name for the third one etc. (You can also append "#1" to the name of the function for the first digitizer, but that's optional.)

In situations where only the module of the second of two similar devices defines a function (e.g. because the first device doesn't has the necessary capabilities) the function can be used with and without appending the "#2" to the function name. To remind you about this a short message is printed out when the module gets loaded.

The only situation were it's a bit more complicated is the case where two identical devices are to be used simultaneously. Due to limitations not only of fsc2 but already to the way the libraries used for accessing e.g. the GPIB bus work you can't simply list the same device twice in the DEVICES section and then use them as outlined above. Instead, two device modules with different names have to be created for these identical devices and made known to the program. Fortunately, there's a Perl script that can automatically "clone" a module for an already existing device, please see one of the following chapters (see Cloning Devices) on how this can be done.


Back: Device configurations Forward: 6.3 Handling of several instances of fsc2   FastBack: 6. Device Functions Up: 6. Device Functions FastForward: 7. Other Modules

This document was generated by Jens Thoms Toerring on September 6, 2017 using texi2html 1.82.