12. Cloning Devices
Unfortunately, the names of devices listed in the DEVICES
section
must all be different. This is due to limitations of the way shared
libraries are handled and, as far as devices are concerned that are
controlled via the GPIB bus, to certain requirements of the GPIB
libraries. Thus, if two or more exactly identical devices are to be used
simultaneously additional shared libraries with different names for these
devices have to be created.
Fortunately, this is such a simple process that it can be done via a script (at least as long as the modules are written following the conventions discussed in the next chapter). There are basically three or four steps:
-
cd
into the `utils' subdirectory offsc2
s main directory. - Run the script `clone_device'.
- Re-make fsc2 and reinstall.
- Update the GPIB configuration file if necessary.
The script `clone_device' is a Perl script thus you'll need Perl
installed to be able to run it. The script resides in the utils
subdirectory of fsc2
s main directory and can only be run from
within this directory. It asks for the name of the device to be cloned
(i.e. the name of the device of which two or more are to be used
simultaneously), a new name for the device and finally for another name
that is going to be used in warnings, error messages, and, if
applicable, in the GPIB configuration file.
Lets assume you have use two lock-in amplifiers of type sr510
and
thus need a second device module that will be invoked by the name
sr510_b
. Here is a complete example of what you'll have to expect
when running the script (together with the answers):
jens@crowley:~/fsc2/utils > clone_device This program allows you to automatically create a new device module from an already existing module. This is necessary only in cases where two identical devices must be used simultaneously. You will have to enter the name of the device you want to clone in exactly the same way as it would appear in the DEVICES section of an EDL program. Do you want to continue [y/n]? y Name of the device module you want to clone : sr510 Please enter the name for the new module : sr510_b Also a device name (to be used in error messages and possibly in the GPIB configuration file) is needed. Please enter a new device name (the old name is SR510) : SR510_B Thanks, that were all the required informations... Everything worked out well. Now you simply have to re-make fsc2 (just cd back to the main directory and type 'make' and, when this succeeds, become root and type 'make install'). If the device is controlled via the GPIB bus you still have to update the GPIB configuration file manually (usually, it's /etc/gpib.conf). Just copy the section for the old device, replace the device name by `SR510_B' and change the GPIB address to the one of the new device. If the device is accessed via the serial port you will have to edit its configuration file ('sr510_b.conf' in the 'config' directory) to set the serial port it's attached to *before* you compile and install the new module. |
When you have run the script you will have to cd
back from the
`utils' subdirectory to fsc2
s main directory (just type
cd ..
) and recompile, using the make
command. After a
successful run of make to compile the new device module you still have
to install it. To do so you must become root
(type "su" and then
enter the root password) and, still from fsc2
s main directory,
run make install
.
For devices controlled via the GPIB bus will have also to edit
(still with root
privileges) the GPIB configuration file (which
usually is `/etc/gpib.conf') and copy the entry for the cloned
device. In this copy change the device name to the one you had entered
while running the script (i.e. in the example SR510
) to the new
device name SR510_B
and finally set the GPIB address entry
correctly.
For devices attached to the serial port you must change the serial port
setting in the configuration file for the device (the configuration
files for all devices are in the `config' subdirectory below
fsc2
s main directory and the file name is identical to the device
name and has the extension .conf
) before you compile
and install the new module.
This document was generated by Jens Thoms Toerring on September 6, 2017 using texi2html 1.82.