diff --git a/confvirtualmot.c b/confvirtualmot.c
index ad6b8aa2..19bb2f3a 100644
--- a/confvirtualmot.c
+++ b/confvirtualmot.c
@@ -206,7 +206,7 @@ static int ConfCheckLimits(void *pData, float fVal, char *error, int errLen){
while(iRet != 0)
{
LLDnodeDataTo(self->motorList,&tuktuk);
- status = tuktuk.pDriv->CheckLimits(tuktuk.data,fVal,error,errLen);
+ status = tuktuk.pDriv->CheckLimits(tuktuk.data,tuktuk.value,error,errLen);
if(status != 1){
return status;
}
diff --git a/doc/manager/amor.htm b/doc/manager/amor.htm
new file mode 100644
index 00000000..ebfd8b92
--- /dev/null
+++ b/doc/manager/amor.htm
@@ -0,0 +1,113 @@
+
+
+
+There are some special command initializations for the reflectometer AMOR.
+ These commands are most likely not portable to other instruments because
+ they encompass the special geometry at AMOR and the AMOR development has
+ not fully matured. The following initialization commands are available:
+
+MakeAmorStatus creates a SICS command which is used by the AMOR status
+ display for displaying proceesed data, especially in TOF-mode. This module
+ provides the following commands:
+
Install the listener module for the accelerator divisions broadcast messages. This
+ creates a command sinq.
+
The Scan Command Header Description File
diff --git a/doc/manager/focus.htm b/doc/manager/focus.htm
new file mode 100644
index 00000000..e59607e5
--- /dev/null
+++ b/doc/manager/focus.htm
@@ -0,0 +1,47 @@
+
+
+Special FOCUS Initializations
+
+
+Special FOCUS Initializations
+
+These initailizations are special to the FOCUS instrument:
+
+- InstallFocusmerge datafile
+
- Installs the module which is responsible for merging focus data into
+ merged detector banks.
+
- MakeFocusAverager average hmc
+
- Installs the average command and the focusraw command into SICS which
+ are used by the FOCUS status client in order to display processed
+ histogram memory data.
+
+
+Special Internal FOCUS Support Commands
+
+
+- focusraw bankid
+
- Dumps in UUencoded form the content of the detector bank bankid. This is
+required in order to add the TOF-binning to the data and in order to handle
+ the virtual merged detector bank which is built from contributions of the
+ three physical detector banks.
+
- average start stop bankid
+
- Sums the detectors between start and stop of detector bankid into a
+ histogram. A standard display in the status client.
+
- focusmerge puttwotheta nxscriptmod bankname alias
+
- Writes two theta values for the detector bank bankname into
+ the file described by the nxscript module nxsciptmod to the
+ alias alias. A helper function for data file writing.
+
- focusmerge putmerged nxscriptmod alias
+
- Writes the virtual merged detector bank into alias in
+ nxscriptmod.
+
- focusmerge putsum nxscriptmod bankname alias
+
- Writes the summed counts for detector bank bankname under alias
+ into nxscriptmod.
+
- focusmerge putelastic nxscriptmod alias theoelastic
+
- Calculate the position of the elastic line and write it to alias in
+ nxscriptmod. If no elastic line can be calculated, the theoretical
+ elastic line, theoelastic, is used.
+
+
+
+
diff --git a/doc/manager/four.htm b/doc/manager/four.htm
new file mode 100644
index 00000000..28b09973
--- /dev/null
+++ b/doc/manager/four.htm
@@ -0,0 +1,97 @@
+
+
+Initialization for Four Circle Diffractometers
+
+
+Initialization for Four Circle Diffractometers
+
+This section describes how the modules which are special for a four
+ circle single crystal diffractometer are configured into SICS. The
+ following feautures are available:
+
+- MakeHKL theta omega chi phi
+
- MakeHKL creates the hkl command for the calculation of settings for a four
+circle diffractometer. The four parameters are the names of the motors
+driving the two theta, omega, chi and phi circles of the diffractometer.
+These motors must already exists before this command may succeed.
+
- MakeHKLMot hkl
+
- Creates the drivable H, k, l virtual motors using hkl, an
+ object created by MakeHKL for calculations.
+
- MakeDifrac tth om chi phi cter
+
- This command installs the Difrac subsystem into SICS. Difrac is a
+whole F77 package for controlling a four circle
+diffractometer. Afterwards Difrac commands are available in SICS with
+the prefix dif, for example dif ah calls the difrac ah command. Difrac
+is described in more detail elsewhere. The parameters are the four
+circle motors two theta, omega, chi and phi and the counter. This is no longer
+ maintained.
+
- MakeMesure name scanobject hklobject omega s2t fileroot datanumberobject
+
- MakeMesure installs the single counter four circle diffractometer
+measurement procedure into SICS. It will be accessible as object name
+afterwards. MakeMesure takes a lot of parameters:
+
+- scanobject
+
- The name of the internal scan object.
+
- hklobject
+
- The name of the object which does crystallographic calculations.
+
- omega
+
- The name of the motor driving omega.
+
- s2t
+
- The name of the two theta motor for use in omega two theta scans.
+
- fileroot
+
- The full path to the data file directory without final /
+
- datanumberobject
+
- The name of the SICS data number object for creating unique file
+numbers.
+
+ - MakeUBCalc name hklobject
+
- This installs a UB matrix calculation module with the name name
+ into SICS. The second parameter is a hklobject as created with MakeHKL
+ to which any calculated UB's can be transferred.
+
- MakeHklscan scanobject hklobject
+
- Installs the hklscan command which allows to scan in reciprocal space.
+Scanobject is the name of SICS internal scan object, hklobject the name of a
+ reciprocal space calculation object as configured with MakeHKL.
+
- MakeTRICSSupport
+
- Installs a command, tricssupport, which helps the TRICS status
+ display.
+
+
+
+Commands implemented by tricssupport:
+
+- tricssupport oldframe file idet nFrame
+
- Loads and sends the frame nFrame of detector idet from file file in
+ UUencoded form.
+
- tricssupport interest
+
- Enables this connection to receive notifications whenever a new frame
+ of data had been written
+
- tricssupport newframe
+
- Called from scripts. Triggers sending new frames to all registered
+ connections.
+
+
+There are also a lot of scripted command available for four circle
+ diffractometers. These may be copied from tricscom.tcl. These include:
+
+- four
+
- print the four all important angles
+
- tricsscan start step np
+
- Omega scan with a PSD
+
- psdrefscan file step np mode preset
+
- Read reflections from file, drive to them, do a omega scan with tricsscan
+ using the parameters specified.
+
- detscan start step np
+
- Do a detector calibration scan.
+
- phscan start step np
+
- Do a phi scan
+
- hklscan2d
+
- Scanning reciprocal space with the area detector
+
- scan2d
+
- Configure SICS for general scanning with the PSD. This is meant
+ to supersede many of the special scans above.
+
- scan1d
+
- Configure SICS for general scanning with the single detector.
+
+
+
diff --git a/doc/manager/gencom.htm b/doc/manager/gencom.htm
new file mode 100644
index 00000000..07dd82db
--- /dev/null
+++ b/doc/manager/gencom.htm
@@ -0,0 +1,243 @@
+
+
+Initialization of General Commands
+
+
+Initialization of General Commands
+
+This section gives details on the initialization of commands which are
+ common to many different instruments. The command set of SICS can be tailored
+ to cover many specific needs. Moreover this system allows to replace
+ functionality by other implementations suited to another users taste. This
+ is a list of common command initialization commands.
+
+- MakeRuenBuffer
+
- MakeRuenBuffer makes the RünBuffer system available.
+
- MakeBatchManager [name]
+
- Installs the new batch buffer management system. If no name is
+given, the default will be exe.
+
- MakeDrive
+
- MakeDrive creates the drive and run command.
+
- Publish name access
+
- The SICS server uses Tcl as its internal macro language. However, it
+was felt that the whole Tcl command set should not be available to all users
+from the command line without any protection. There are reasons for this:
+ careless use of Tcl may clog up memory, thereby grinding the system to a
+ halt. Invalid Tcl statements may cause the server to hang. Last not least,
+ Tcl contains commands to manipulate files and access the operating system.
+ This is a potential security problem when the server is hacked. However,
+ in order to make macro procedures available the Publish
+ command exists. It makes a Tcl command name available to SICS users with the
+ access code access. Valid values for access are: Internal, Mugger, User
+ and Spy.
+
- TokenInit tokenpassword
+
- This command initialises the token control management system with the
+token command. The single parameter tokenpassword specifies the password for
+the token force command.
+
- MakeOptimise name countername
+
- This command installs the Peak Optimiser into the SICS server. The Peak
+Optimiser is an object which can locate the maximum of a peak with respect
+to several variables. The arguments are: name, the name under which the Peak
+Optimiser can be accessed within SICS and countername, which is the name of
+an already configured SICS counter box.
+
- MakeO2T nam OM 2TM
+
- creates an omega 2Theta virtual motor
+with name nam for omega 2Theta scans. OM defines an omega motor, 2TM a two
+theta motor.
+
- MakeDataNumber SicsDataNumber filename
+
- This command makes a
+variable SicsDataNumber available which holds the current sequential data
+ file number. filename is the complete path to the file were this data
+number is stored. This file should never, ever be edited without good
+reason, i.e. resetting the sequential number to 0 at the beginning of a
+year.
+
- MakeXYTable myname
+
- Creates a XYTable object with the name myname. This object can store a
+ list of x-y values.
+
- MakeSinq
+
- Install the listener module for the accelerator divisions broadcast
+ messages. This creates a command sinq.
+
- MakeMaximize counter
+
- Installs a command max into SICS which implements a more efficient
+ algorithm for locating the maximum of a peak then scanning and peak or
+ center.
+
- MakeMaxDetector name
+
- Installs name into SICS which implements a command for locating
+ maxima on a two dimensional histogram memory image.
+
- MakeLin2Ang name motor
+
- Creates a virtual motor name which translates an input angle into a
+ translation along a tangent to the rotation axis. The distance of the
+ translation table can be configured as variable: name length once this
+ is established.
+
- MakeSWHPMotor realmotor switchscript mot1 mot2 mot3
+
- Creates switched motors mot1, mot2 and mot3 for real motor
+ realmotor. For switching the script switchscript is used. This
+ can be used when several motors are operated through the same
+ motor driver. This implementation is not completely general now.
+
+
+Monochromators
+
+A monochromator is represented in SICS through a monochromator object which
+ holds all the parameters associated with the monochromator and virtual
+ motors which drive wavelength or energy. The commands to configure such a
+ monochromator are:
+
+- MakeMono name M1 M2 M3 M4
+
- This command creates a crystal monochromator object. Such a
+monochromator object is necessary for the usage of the wavelength or energy
+variables. The parameter name defines the name of the monochromator object
+in the system. M1 and M2 are the names of the Theta and two Theta motors
+respectively. M3 is an optional parameter defining a motor for driving the
+horizontal curvature. M4 is an optional parameter defining a motor for
+driving the vertical curvature of the monochromator.
+
- MakeWaveLength nam mono
+
- creates a wavelength variable nam. The monochromator mono is used for
+adjustment.
+
- MakeEnergy nam mono
+
- creates a energy variable nam. The
+monochromator mono is used for adjustment.
+
- MakeOscillator name motor
+
- Installs a module name which oscillates motor between the software
+ limits of the motor. This is useful for suppressing preferred
+ orientation effects on powder diffractometers.name then supports the
+ commands: start, stop, status which are self explanatory.
+
+
+Reoccuring Tasks
+
+Sometimes it may be necessary to execute a SICS command at regular
+time intervalls. This can be achieved with the sicscron command:
+
+- sicscron intervall bla blab blab
+
- This command installs a reoccuring task into SICS. The first
+parameter is the intervall in seconds between calls to the SICS
+command. Everything behind that is treated as the command to execute.
+
+
+The SICS Online Help System
+
+SICS has a simple built in help system. Help text is stored in simple
+ASCII text files which are printed to the client on demand. The help
+system can search for help files in several directories. Typically one
+would want one directory with general SICS help files and another one
+with instrument specific help files. If help is invoked without any
+options, a default help file is printed. This file is supposed to
+contain a directory of available help topics together with a brief
+description. The normal usage is: help topicname . The help system
+will then search for a file named topicname.txt in its help
+directories.
+
+
+A SICS manager will need to configure this help system. A new
+directory can be added to the list of directories to search with the
+command:
+
+help configure adddir dirname
+
+The default help file can be specified with:
+
+help configure defaultfile filename
+
+Each of these command given without a parameter print the current
+settings.
+
+Aliases in SICS
+
+SICS knows three different kinds of aliases: object aliases,
+runtime aliases and command
+aliases. This is confusing but finds its explanation in the structure
+of SICS internals.
+
+Object Aliases
+
+An object alias is another name for a first class object installed
+into the SICS interpreter. For instance a second name for a motor. For
+instance the motor twotheta is quite often aliased to a4. Such an
+alias can be used like a normal SICS objects. Even in commands which
+access internal SICS interfaces like the drive command or
+others. Object aliases are installed into SICS with the SICSAlias
+command:
+
+- SicsAlias oldname newname
+
- This command installs newname as alias for the object oldname.
+
+SicsAlias can only be used within initialization scripts. SicsAlias is
+ considered deprecated and can be replaced with the superior runtime
+ aliases described below.
+
+Runtime Aliases
+
+Runtime aliases are full object aliases which can be configured into the
+ system at run time by a SICS manager.
+The syntax looks like this:
+
+- DefineAlias aliasname SICSobject
+
- This defines aliasname to be the alias for the SICS object SICSobject.
+ It is not needed that SICSobject already exists. If SICSobject is already
+ an alias, it is translated before definition.
+ Multiple translation is possible, depending on the order of definition.
+ When an alias is used, and it does not point to an existing object,
+ the behaviour is the same as if an unknown object would have been used.
+
- DefineAlias aliasname
+
- This command deletes the alias aliasname.
+
+
+Command Aliases
+
+Command aliases are shortcuts for lengthy commands. For instance one
+might want to define A4LL as a shortcut for "a4 softlowerlim". This is
+just to save typing or adapt SICS to MAD users who appear to have an
+unlimited memory for 2-4 letter acronyms. It is possible to redefine a
+SICS object with this for instance to define tt as an alias for
+temperature. However if one tries to use tt in a drive command it will
+fail because it is just a text replacement. A command alias can be
+installed into SICS at any time with manager privilege and the
+command:
+
+- alias shortcut bla bla bla ....
+
- This define shortcut as an alias for everything behind it.
+
+A shortcut may take parameters.
+
+The AntiCollision Module
+
+In some cases motors have to be drive in a coordinated way. For instance,
+ at TRICS, the chi motor may need to move first before omega can be
+ driven in order to avoid collisions. Or at the ECB instruments, only one
+ of eight motors in a rack can be driven at any given time. The anti collision
+ module now allows to implement this. Anticollisions pattern of
+ operation: Each
+ collaborating motor is registered with the anti collision module. When trying
+ to start such a motor, the anti collider just takes a note where it shoud go.
+ On the first status check, a program is called which has to
+ arrange the running of the motors into a sequence. This sequence then is
+ executed by the anti collision module. The program which arranges the
+ motors into a sequence is a configurable parameter and usually implemented
+ as a script in SICS own marco language. In the SICS initialization file this
+ requires the commands:
+
+- AntiCollisionInstall
+
- Creates the anitcollision module.
+
- anticollision register motorname
+
- Registers motorname with the anti collision module.
+
- anticollision script scriptname
+
- This command configures the script which is responsible for
+ arranging the sequence of operations.
+
+The script configured into anticollision is called with pairs
+ or motor names and targets as parameters, Example:
+
+sans2rack mot1 target1 mot2 target2 .....
+
+Within the anticollision script, the following command may be
+ used in order to define the sequence.
+
+- anticollision clear
+
- Clears the sequence list
+
- anticollision add level motor target
+
- Add motor with target to level in the sequence.
+
+
+
+
diff --git a/doc/manager/hwini.htm b/doc/manager/hwini.htm
index e0c92029..2272a232 100644
--- a/doc/manager/hwini.htm
+++ b/doc/manager/hwini.htm
@@ -10,20 +10,392 @@ Hardware is configured into the SICS system by executing special hardware
configuration commands from the server initialisation file. These commands
are described here. Much SICS hardware is hooked up to the system via RS-232
interfaces. The SICS server communicates with such devices through a serial
-port server program running on the instrument computer All such devices require on
+port server program running on the instrument computer.
+ All such devices require on
initialisation the following parameters:
- hostname The name of the instrument computer.
- port The port number where the serial port server program is
listening for requests. It is usually 4000.
-
- channel The number of the RS-232 interface on the Macintosh. 0 is
-the standard Macintosh modem port, 1 is the standard Macintosh printer port,
-2 is the first connector on the interface extension box. This leads to much
-confusion which can be healed with a simple rule: If a device is connected
-to the Macintosh serial port extension box, then its channel number is the
-interface number on the box plus one.
+
- channel The number of the RS-232 interface port
+ on the terminal server.
+
+Bus Access
+
+SICS and its internals cover many common usage cases. However there are always
+ situations where SICS has to be bypassed and commands to be sent to a
+ controller directly. This can happen in order to satisfy a special request or
+ as first step in the integration of a special piece of hardware into SICS. In
+ order to do such things the following facilities are available:
+
Direct Access to RS232 Controllers or TCP/IP Controllers.
+
+Both controllers listening on a TCP/IP port or RS-232 devices connected to a
+ terminal server can be directly accessed through the RS232 commands. The
+ first step in using this system is always to accounce the controller to SICS
+ using the command:
+
+MakeRS232Controller name terminalserver port
+
+in the SICS initialization file.
+For example:
+
+MakeRS232Controller hugo psts213 3004
+
+name is the SICS name for the controller, terminalserver is the name
+of the terminal server the device is connected to and port is the port
+number at which the terminal server publishes the RS232 channel to
+which the device is connected. This is usally the port number plus 3000.
+
+
+Now various commands are available for interfacing with the RS232
+controller. In the following description the SICS name of the
+controller is replaced by the symbol rs232name.
+
+- rs232name sendterminator
+
- prints the current terminator used when sending data to the device
+as hexadecimal numbers.
+
- rs232name sendterminator h1h2..hn
+
- sets the current terminator used when sending data to the device
+to the characters described by the hexadecimal numbers h1 to hn. The
+numbers are in the format 0xval, where val is the hex number.
+
- rs232name replyterminator
+
- prints the current terminator expected to terminate a response
+from the device as a hexadecimal number.
+
- rs232name replyterminator h1h2..hn
+
- sets the current terminator expected to terminate a response from
+the device to the characters described by the hexadecimal numbers h1
+to hn.
+The numbers are in the format 0xval, where val is the hex number.
+
- rs232name timeout
+
- prints the current timeout when waiting for a reponse from the
+device.
+
- rs232name timeout val
+
- sets the timeout for waiting for responses from the device. The
+value is in microseconds.
+
- rs232name send data data data
+
- sends the remainder of the line to the RS232 device and waits for
+a response terminated with the proper reply terminator specified. This
+commands waits at maximum timeout microseconds for a response. If a
+valid response is obtained it is printed, otherwise an error message
+occurs.
+
- rs232name write data data data
+
- writes the remainder of the line after write to the device without
+waiting for a response.
+
- rs232 available
+
- checks if data is pending to be read from the device.
+
- rs232 read
+
- reads data from the device.
+
+
+Accessing Serial Ports (Old System)
+
+In addition to the system describe above there is another system for accessing
+ serial ports which uses the SerPortServer program. The use of the system is
+ deprecated, new software should use the commands describe above. Nevertheless
+ the older sytem is described here for reference.
+
+
+Serial port access is implemented as an extension to the Tcl macro language.
+Essentially this is the same implementation as used in the program psish.
+ This section describes how to use serial port access. Several
+ steps have to be performed:
+
+- Install the serialport command into the SICS server. This requires two lines to be added to
+the server startup script:
+
+- SerialInit
+
- TclPublish serialport UserRights
+
+Where UserRights stands for one of the possible SICS user rights.
+ See documentation
+for TclPublish above.
+ - Each separate serial port will be represented by a name in the SICS server
+after it has been initialized. This name is also a command. These port names
+ live in the Tcl interpreter and must be made accessible with TclPublish.
+ For example for
+a port named p1 include this line in the server startup script:
+
+Replace User with the correct access code you want for a serial port. It is
+ recommended
+to restrict serial port access to SICS managers only.
+
- After starting the SICS server the command serialport is now available.
+
- Now a serial port can be initialized with a command like this:
+
+- serialport name1 SerPortServer.host port channel force
+
- Example: serialport p1 localhost 4000 5
+
+Such a command creates the command name1 and links it with serial port channel
+channel on the instrument computer (localhost) running the SerPortServer program . Port is the port number on which the
+ SerPortServer is listening for connections (usually 4000).
+The last flag force is optional. If something is there, the connection to that
+port is done on a separate socket of its own. This has to do with some
+feature of the software interface to the SerPortServer serial port server.
+This
+software interface tries to direct messages for multiple channels through one
+socket connection between the host and the Macintosh server. This is perfectly
+fine as long as none of the commands through this socket takes a long time
+to execute. However, if a RS-232 device takes a long time to respond, the whole
+socket is blocked. Fortunately, the serial port server runs a separate
+thread of execution for each different socket. By forcing a new socket it can
+be achieved that such a slow device is decoupled from the rest. Exactly this
+is achieved with the force flag.
+ - Once the port has been initialised (for example p1) it is ready to
+ operate.
+The port object allows to send data to the serial port and receive data from
+it. Furthermore some configuration is possible. The syntax is like this:
+
+- portname -tmo number
+
- Sets the timeout for the serial port. This is the maximum amount of time
+the serial port server waits for data to arrive from the RS-232 device.
+Increase this if a lot of
_BAD_TMO
error messages creep up.
+ - portname -sendterm string
+
- Sets the terminator which will be automatically added to the string
+ which is
+sent. Some RS-232 devices require special terminators in order to accept a command.
+The serial port implementation ensures that such a terminator is sent after
+each message. This command allows to configure this terminator. Please note,
+that the terminator string needs to be enclosed in quotes. An example:
+
+This sets the terminator to carriage return - line feed.
+
- portname -replyterm string.
+
- The serial port server expects the RS-232 device to send a terminator
+when it is done with sending answers. It even supports multiple lines to be
+sent as a reply. This expected reply terminator is set with this command.
+The string may may be four characters long. An example:
1\r\n
sets
+the expected terminator to one of \r\n
. One of them is expected.
+Thus the first character is the count of terminators to expect, followed by
+ the characters possible as terminators. This string must usually be quoted.
+ - portname blablalakjdl
+
- When none of the options -tmo, -replyterm, -sendterm, is found everything
+ after portname is sent to the RS-232 device. The reply from the RS-232
+ device is printed.
+
+
+The defaults set for the configuration parameters of the serial port connection
+are suited for the EL734, EL737 and ITC4 devices usually encountered at SINQ.
+ For other RS-232 devices consult the manuals hopefully delivered with the
+ device.
+The defaults are: 100 for timeout, 1\r\n
for the reply terminator and
+\r\n
for the send terminator.
+
+GPIB Controller Access
+
+GPIB is yet another bus system. Up to 30 devices can share the bus and
+transfer data on it. SICS likest to speak to GPIB devices through the
+National Instrument ENET-100 TCP/IP bridge. In order for this to work
+the National Instruments driver software must have been installed on
+the computer running SICS. SICS has to be compiled with the define
+HAVENI defined and the proper paths to the header file and library
+configured. Then an GPIB controller can be installed into SICS with the
+command:
+
+MakeGPIB name drivertype
+
+Name is the name under which the GPIB controller is addressable within
+SICS afterwards. drivertype is the driver to use for the GPIB
+device. Supported values are:
+
+- sim
+
- Simulation
+
- ni
+
- National instruments driver, see above.
+
+The GPIB controller supports a couple of commands for communicating
+with devices on the GPIB bus directly. Use with extra care because it
+is very easy to lock things up on the GPIB bus. In the following
+documentation of the command set it is assumed that a GPIB controller
+has been configured into the system under the name gpib. Please
+note, that managers privilege is required in order to be allowed to
+wrestle with this controller.
+
+- gpib attach controller-no gpib-address gpib-secondary timeout
+ eos eot
+
- This attaches the GPIB controller to a certain device at a certain
+ address for later communication. The return value is an integer
+ handle which will be used later on a s a handle devID when referring
+ to the connection. The parameters are:
+
+- controller-no
+
- The number of the GPIB controller on the computer. There may be
+more then one GPIB controllerinstalled on a given system. Usually this
+is 0.
+
- gpib-address
+
- The GPIB address of the device on the bus.
+
- gpib-secondary
+
- GPIB devices may have a seconadry address. This can be specified
+with this parameter. Usually this is 0.
+
- timeout
+
- The time to wait for answers on the GPIB bus. 13 is 10 seconds and
+ussually a good value.
+
- eot
+
- A parameter determining the termination mode on this
+connection. Consult NI documentation for this or leave at 0.
+
- eoi
+
- A terminator. Set to 1 or understand NI documentation for this
+parameter.
+
+ - gpib detach devID
+
- Breaks the connection described through devID. devID is the return
+value from attach.
+
- gpib clear devID
+
- Tries to clear the GPIB buffers for the conenction described
+through devID. Usually in vain.
+
- gpib send devID bal bla bla
+
- sends data to the device at devID.
+
- gpib sendwithterm devID string terminator
+
- Sends string to the device at devID. The terminator character
+identified through the integer terminator is automatically
+appended. Use this to send things which require a
+terminator. Terminators included in strings sent by send get messed up
+through Tcl!
+
- gpib read devID
+
- Reads data from the device at devID and returns it as a string.
+
- gpib readtillterm devID terminator
+
- Read from teh device devID unti the terminator character described
+through the interger terminator is read. Then return the data read as
+a string.
+
+
+Controllers
+
+For the same reason as stated above, it is necessary to represent controllers
+ within SICS. Controllers implement more then only device access but also
+ maintain common state or implement special behaviour.
+
+ECB Controllers
+
+ECB controllers are at the heart of the Risoe data aquisition
+system. These are essentially Z80 processors wired to the GPIB
+bus. Functions can be invoked in this processor by sending a function
+code followed by the contents of 4 8 bit registers. As a result the
+contents of the registers after the function call are returned. A ECB
+can be made knwon to SICS through the initialisation command:
+
+MakeECB name gpib-controller gbib-controller-number gpib-address
+
+The parameters:
+
+- name
+
- The name used as a token for this controller later on.
+
- gpib-controller
+
- the name of the GPIB interface to use. See above.
+
- gbib-controller-no
+
- The number of the GPIB board in the system
+
- gpib-address
+
- The GPIB address of the ECB on the GPIB bus.
+
+Once installed, the ECB controller understands a few commands:
+
+- ecb1 func funcode d e bc
+
- Invoke ECB function funcode with the registers d e b c.Returns the
+contents of the registers d e b c. Function codes and register
+contents are documented, if at all, in the ECB documentation. In fact, as
+ ECB documentation is not available, the only documentation on ECB is the
+ source code of tascom.
+
- ecb1 clear
+
- Tries, usually in vain, to clear the communications interface to
+the ECB.
+
- ecb1 toint char
+
- A helper function which converts the character char to an
+integer. Tcl does not seem to be able to do that.
+
+Siematic SPS Controllers
+
+Siematic SPS controllers are used at SinQ for handling all the things which
+fit nowhere else. Such as operating air cushions on some instruments,
+reading variables from ADC's, reading status of shutters or other parts of
+the instrument and the like. Those SPS units have an RS-232 connector and
+understand a simple ASCII command protocoll.
+ The Siematic SPS and its command protocoll are
+special to PSI and this section is probably of no interest to SICS managers
+ outside. The SPS basiaclly support three operations:
+
+- Push a button (Set a Digital I/O Bit).
+
- Read a status of instrument status packed into a bit (Read Digital I/O) .
+
- Read an ADC.
+
+This is so user unfriendly that the usage of the SPS will mostly be packaged
+into Tcl-macros.
+
+
+A SPS unit can be configured into the SICS server with the command:
+MakeSPS name macintosh port channel
+The parameters are: the name of the SPS in SICS, the serial port server
+computer, the port where the serial port server is listening and the
+channel number of the SPS unit at the serial port server computer. An
+example:
+MakeSPS sps1 lnsp25.psi.ch 4000 6
+configures a SPS unit at lnsp25.psi.ch at channel 5. The serial port server
+is listening at port number 4000. The SPS unit will be accessible as sps1 in
+SICS.
+
+
+After configuartion the following four commands are understood by name,
+shown with sps1 as example:
+
+- sps1 push byte bit
+
- Corresponds to pushing the button mapped to the bit bit in the byte
+byte.
+
- sps1 adc num
+
- Reads the value in the ADC num. num can be between 0 to 7 for a maximum
+of eight ADC's. Please note, that the values read are raw values which
+usually must be converted in some way to physically meaningful values.
+
- sps1 status bit
+
- Reads the status of the bit bit. bit can be in the range 0 - 128.
+
- sps1 stat2 byte bit
+
- Reads the status bit bit in status byte byte. Is equivalent to status,
+but adds some syntatctic sugar.
+
+For all conversion factors, for all mappings of bytes and bits, consult the
+electronician who coded the SPS.
+
+General Controller Object and Choppers
+
+Chopper systems are handled via a generic controller object. This basicly
+consists of two components: One object represents the actual
+controller. This basic object allows to query parameters only. Then
+there is for each parameter which can be controlled from SICS in this
+controller an adapter object. These adapter object are virtual motors
+which can be driven with the normal run or drive commands. Currently
+two drivers for this scheme exists: one for a simulated device, the
+other for the Dornier Chopper Controller at FOCUS. The first step when
+initializing this system is the installation of the general controller
+object into SICS. This is done with the commands:
+
+MakeChopper name sim
+MakeChopper name docho mac port channel
+
+The first command simply installs a simulated controller.
+The second command install a controller with a driver for the FOCUS
+Dornier Chopper system. Mac, port and channel are the usual Macintosh
+terminal server parameters which describe where the chopper controller
+is connected to through its RS-232 interface. After both commands the
+controller is available as command name within SICS.
+
+
+A drivable parameter at this controller is installed with a command
+similar to this:
+
+ChopperAdapter vname cname pname lower upper
+
+vname is the name under which the virtual motor will appear in
+SICS. cname is the name of the controller object installed into SICS
+with the commands in the previous paragraph. pname is the name of the
+drivable parameter in the controller. upper and lower are the upper
+and lower limits for this parameter. More then one of these commands
+can be given for each general controller.
+
+
+After this, the parameter can be modified by a command like:
+
+drive vname newvalue
+
Motors
@@ -41,12 +413,18 @@ El734 motor controller. The
parameters host, port, chan have the meanings defined above. no is the
number of the motor in the EL734 motor controller.