At start-up the SSRL dhs attempts to connect to the mysql database to determine what its configuration is (i.e. what it is controlling).
The following subsections describe the steps for configuring a simple beam line.
mysql> grant select on * to dhs@blctlxx.slac.stanford.edu; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.42 sec)
mysql> select * from DCSS where BeamlineID=12; +----+---------------------------+---------------+---------------+------------+----------+ | id | HostName | ListeningPort | MemoryMapFile | BeamlineID | beamline | +----+---------------------------+---------------+---------------+------------+----------+ | 12 | blctlxx.slac.stanford.edu | 14242 | database.dat | 12 | bl-xx | +----+---------------------------+---------------+---------------+------------+----------+ 1 row in set (0.02 sec)
HostName: Name of the host computer that DHS will run on
privateNode: This is the hostname for which a network based piece
of hardware should reconnect to if it needs to make an independent socket
connection back to the DHS for some reason. The Galil DHS uses this to
send asynchronous messages back to the DHS when the shutter opens during
an oscillation. For many computers this field could be the same as the
HostName, but on SSRL machines (which often have two network interfaces), it
is important to be specific.
BeamlineID: Should be the same as the BeamlineID entry in the
DCSS table.
LocalDatabaseFileName: This is the name of a file which will be
created automatically by the DHS on start-up if it does not exist. It
is a memory mapped file which will store motor positions if controlling
a motion controller. For DHS's that only control detectors or other devices
without persistent state, the file still gets generated but doesn't really do
anything.
AutoFlushPeriod: Specifies how often the LocalDatabaseFileName
should be updated to disk in ms.
DevicePollPeriod: Specifies in ms how often to poll and update to DCSS
a moving motor.
WatchdogKickPeriod: The galil is running a script which will stop
all motors if it does not receive a 'kick' from the DHS every 5(?) seconds. This
value tells the DHS how often to 'kick' the watchdog.
InstanceName: This should be the name of the controlled device which
will be specified at the command prompt when starting dhs. For example, the
dhs program could be starting like this: ./dhs detector.
mysql> select * from DHS where BeamlineID=12; +----+---------------------------+-------------+------------+-----------------------+-----------------+------------------+--------------------+--------------+ | id | HostName | privateNode | BeamlineID | LocalDatabaseFileName | AutoFlushPeriod | DevicePollPeriod | WatchdogKickPeriod | InstanceName | +----+---------------------------+-------------+------------+-----------------------+-----------------+------------------+--------------------+--------------+ | 32 | blctlxx.slac.stanford.edu | | 12 | blxxDetector.dat | 5000 | 5000 | 500 | detector | +----+---------------------------+-------------+------------+-----------------------+-----------------+------------------+--------------------+--------------+ 1 row in set (0.00 sec)
id field of the
Controllers table will be used in entries in the ControllerID
field of the device specific tables.
If the DHS is responsible for only one device the table may look like this:
mysql> select * from Controllers where DHS_ID=32; +----+--------+ | id | DHS_ID | +----+--------+ | 35 | 32 | +----+--------+ 1 row in set (0.00 sec)
If the DHS is responsible for more than one devices, the table may look like this:
mysql> select * from Controllers where DHS_ID = 32; +----+--------+ | id | DHS_ID | +----+--------+ | 35 | 32 | | 36 | 32 | | 37 | 32 | +----+--------+ 24 rows in set (0.00 sec)
mysql> select * from CCD where ControllerID=35; +----+--------------+--------------------------+-------------+----------+-------+--------------------+-----------------+----------------------+--------------+-------------+-------------+-----------------------+-----------------------+--------------------------+--------------------------+--------------------+--------------------+-----------------------+-----------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------------+----------------+------------+ | id | serialNumber | HostName | CommandPort | DataPort | Chips | DarkImageDirectory | DarkRefreshTime | CalibrationDirectory | ControllerID | BeamCenterX | BeamCenterY | NonUniformitySlowFile | NonUniformityFastFile | NonUniformitySlowBinFile | NonUniformityFastBinFile | DistortionSlowFile | DistortionFastFile | DistortionSlowBinFile | DistortionFastBinFile | PostNonUniformitySlowFile | PostNonUniformityFastFile | PostNonUniformitySlowBinFile | PostNonUniformityFastBinFile | darkExposureTolerance | writeRawImages | j5_trigger | +----+--------------+--------------------------+-------------+----------+-------+--------------------+-----------------+----------------------+--------------+-------------+-------------+-----------------------+-----------------------+--------------------------+--------------------------+--------------------+--------------------+-----------------------+-----------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------------+----------------+------------+ | 9 | 0 | blcpu3.slac.stanford.edu | 8041 | 8042 | 1 | ./darkimages/ | 7200 | ./ | 35 | 94.0000 | 94.0000 | NONUNF | NONUNF | NONUNF | NONUNF | CALFIL | CALFIL | CALFIL | CALFIL | POSTNUF | POSTNUF | POSTNUF | POSTNUF | 0.10 | N | N | +----+--------------+--------------------------+-------------+----------+-------+--------------------+-----------------+----------------------+--------------+-------------+-------------+-----------------------+-----------------------+--------------------------+--------------------------+--------------------+--------------------+-----------------------+-----------------------+---------------------------+---------------------------+------------------------------+------------------------------+-----------------------+----------------+------------+ 1 row in set (0.00 sec)