# TOPSI Command Summary

## Most Used Commands

drive mot1 NewVal mot2 NewVal ....
  Drives motors. Followed by pairs of motor names and new values.
scan clear
  Clears current scan parameters.
scan list
  lists current scan parameters.
scan var name start step
  Defines a variable (motor) to be scanned. The name of the variable, a start value and a stpe width need to be given. More then one scan variable can be specified.
scan np num
  Sets the number of scan points.
scan preset val
  Sets the Preset value for the scan. Without a parameter, inquires the current value.
scan mode val
  Sets the count mode for the scan. Without a parameter, inquires the current value. Possible values are Timer or Monitor.
scan run
  Executes the scan.
cscan var center delta np preset
  does a scan center scan for variable var around center. delta is the step width to use, np is the number of points to collect at each side, preset is the preset to use.
sscan var1 start end var2 start end .... np preset
  simplified scan command. Scans variables var1, var2 .. from the respective start values to the end values. Using np points and a preset of preset.
FileEval filename
  Runs the batch file specified as argument filename.

## Driving

drive mot1 NewVal mot2 NewVal ....
  Drives motors. Followed by pairs of motor names and new values.
run mot1 NewVal mot2 NewVal ....
  Runs motors.

Known motors are: OmegaA, A1, TwoThetaM, A2, MonoX, MonoY, MonoChi, MonoPhi, CurveM, Table, A3, TwoThetaD, A4.

## Counting

counter SetMode mode
  Sets the mode of the counter. Possible parameters for mode are Timer and Preset.
counter GetMode
  Prints the current counting mode of the counter.
counter SetPreset val
  Sets a new preset for the counter
counter GetPreset
  Prints the current value of preset.
counter SetExponent val
  Sets a new expoenent for the preset in monitor mode.
counter GetExponent
  Prints the current value of exponent.
counter Count preset
  Starts counting with the preset value specified.
counter GetCounts
  Inquires the last counts measured.
counter GetMonitor n
  Gets the last value measured in monitor n.

## Scan

scan clear
  Clears current scan parameters.
scan list
  lists current scan parameters.
scan var name start step
  Defines a variable (motor) to be scanned. The name of the variable, a start value and a stpe width need to be given. More then one scan variable can be specified.
scan NP num
  Sets the number of scan points.
scan Preset val
  Sets the Preset value for the scan. Without a parameter, inquires the current value.
scan Mode val
  Sets the count mode for the scan. Without a parameter, inquires the current value. Possible values are Timer or Monitor.
scan run
  Executes the scan.
cscan var center delta np preset
  does a scan center scan for variable var around center. delta is the step width to use, np is the number of points to collect at each side, preset is the preset to use.
sscan var1 start end var2 start end .... np preset
  simplified scan command. Scans variables var1, var2 .. from the respective start values to the end values. Using np points and a preset of preset.

## Rünbuffer

Buf new name
  New buffer name
Buf copy name1 name2
  copies buffers.
Buf del name
  deletes buffer.

Buffers created with Buf new name are installed as command name and understand:

NAME append bla bla .......
  Append text to buffer
NAME del iLine
  Deletes line.
NAME ins iLine bla bla ....
  Inserts text after line.
NAME print
  prints contents of buffer to screen.
NAME save file
  Saves buffer to file.
NAME read file
  Read buffer contents from file.
NAME run
  Executes contents of buffer.

There can be a stack of Rünbuffers.

RuLi add buffer
  Adds an buffer to the stack.
RuLi list
  Lists the stack.
RuLi del line
  Deletetes buffer from stack.
  RuLi ins iLine name
  Inserts name after iLine.
RuLi run
  Executes Stack.
RuLi batch
  Executes stack permanently. New buffers may be added.

## General commands

Success
  wait for the last operation to finish.
wait time
  wait for time to pass....
Dir
  lists all objects in the system.
config Rights username password
  changes authorisation to that of the user identified by username, password.
FileEval filename
  executes batch file filename.

## LogBook

LogBook file name
  sets log file name
LogBook on
  switches logging on
LogBook off
  closes LogBook
LogBook
  lists current logging status

## Variables

Each variable can be inquired by just typing its name. It can be set by typing the name followed by the new value. Currently available variables are:

- Title
- User
- comment1
- comment2
- comment3
- User
- adress
- phone
- email
- sample