Secondary Beam Line

Secondary Beam Line Control System:Secondary Beam Line
Client/Server Dialog

Secondary Beam Line TCP/IP programming interface between client and server: A list of all currently existing commands is given in table 1. They are heavily used by the programs Optima, Setpoint etc. (See available programs.) The most useful commands for an eventual user are at the beginning of the table. They allow to read from or write to devices of the secondary beam line from a data acquisition system. A sample program in C and a sample program in Fortran for test purposes are available. The last 3 commands represent a "mini ftp" facilitating backups under Windows 3.1x. They are not needed anymore under Windows XP, because Microsoft network supports all these functions.


     In table 1 below the following variable names are used:

     XYZ is a device name existing in file DEVICE.LIS
     nnn, mmm ... are integer numeric values (encoded as string)
     n.m represents a floating numeric value (encoded as string)
     [list] is a list of device names and numerics and looks like:

              XYZ nnn n.m LF
              XYZ nnn n.m LF
              ..
              XYZ nnn n.m

     LF       means:  line feed character ( \n )
     [3par]   means:  low= nnn hi= nnn scale= n.m
     [4par]   means:  XYZ nnn n.m nnn
     [7par]   means:  XYZ nnn mmm a.b c.d e.f ddd
     [17par]  means:  list of all 17 parameters
     [6rates] means:  all six counting rates (as strings)
     f        means:  camac F parameter
     N,A,F    means:  standard camac N, A and F parameters
     sta      means:  returned status of camac transfer
     sn, n    means:  station number of 6-fold scaler
     s1, s2   means:  numbers of scaler channel 


Table 1:
Action Send Receive (ok) on Error
SockTimeOut (* TOUT nnn *TOUT* nnn -
ReadAllDevices RALL *RALL* [list] *RALL* 0
ReadAllDacs ALLD *ALLD* [list] *ALLD* 0
WriteDAC WDAC XYZ nnn *WDAC* XYZ= nnn *WDAC* error
WriteDAC&Wait (** WDAW XYZ nnn *WDAW* XYZ= nnn *WDAW* error
ReadDAC RDAC XYZ *RDAC* XYZ= nnn *RDAC* error
ReadADC RADC XYZ *RADC* XYZ= nnn *RADC* error
DeviceName DEVN nnn *DEVN* nnn= XYZ *DEVN* error
ReadCamacDac RCAD XYZ f *RCAD* nnn *RCAD* error
WriteCamacDac WCAD XYZ f nnn *WCAD* nnn *WCAD* error
DoReadCamac RCAM N A F *RCAM* sta nnn *RCAM* error
DoWriteCamac WCAM N A F nnn *WCAM* sta *WCAM* error
DoControlCamac CCAM N A F *CCAM* sta *CCAM* error
DeviceParameter DEVP nnn *DEVP* [3par] *DEVP* error
DeviceParameter2 DEPA nnn *DEPA* [17par] *DEPA* error
DeviceParameter3 DEPB nnn *DEPB* [4par] *DEPB* error
ReserveCrate RESC *RESC* 1 *RESC* 0
FreeCrate FREE *FREE* 1 -
NewDeviceList NEWL *NEWL* 1 *NEWL* 0
GetPageIndex PIND nnn *PIND* mmm *PIND* error
GetNumberOfPages NPAG *NPAG* nnn -
ReadOnePage RPAG nnn *RPAG* nnn [list] *RPAG* 0
SwitchOnCombis SWON *SWON* nnn -
SwitchOnCombi SWCO XYZ *SWCO* XYZ 1 *SWCO* XYZ 0
SwitchOffCombi SWOF XYZ *SWOF* XYZ 1 *SWOF* XYZ 0
ClearScalers CLSC sn s1 s2 *CLSC* *CLSC* error
ReadScalers RDSC sn s1 s2 *RDSC* nnn mmm *RDSC* error
ReadClearAllScalers RCAS n *RCAS* [6rates] *RCAS* error
GetDirectory FDIR [mask[>f]] [dirlist] -
ChangeDirectory CDIR [S][C]XYZ *CDIR* XYZ *CDIR* error
GetFile FGET [@]XYZ file(s) in defdir *FGET* error


Table 1a: more details for Table 1.

* If a client program looses its TCP-IP connection to the server (because of a crash or some network-overload) the used server socket (1 out of 25) remains busy and has to be recycled after some time. Thus, low time-out values around 5 min are preferred in order to keep the amount of busy sockets low. So do not change the time-out value (given in minutes) without an urgent need. If your client program has to wait for a longer time and you wish to keep the connection to the server alive then you should send every 10 - 30 secs a dummy command (e.g. "test") which will reset the used server socket's time-out counter each time like any of the commands given in table 1.
** Waits after polarity changement until power supply is switched on again (only for Combis and Combi-likes). Time-out after 30 sec.


Secondary Beam Line In order to connect your computer to the provided server functions, you have to know the name of the server and the port identification. The server names as well as the names of the clients of the different areas are given in table 2. For the currently used port identification inform yourself at the respective area. The programs which need the CAMAC server have two parameters on the command line (1st: Server name, 2nd: Port ID, see properties of the shortcuts to these programs).

Table 2: List of the client and server PC names of the 2 Target Station M and the 5 Target Station E secondary beam line areas.

Section Area Client Server
Target Station M piM1 PC8289 -
piM3 PC8290 -
Target Station E µE1 PC8270 PC202
piE1 PC8268 PC130
piE3 PC8269 -
µE4 PC8288 PC451
piE5 PC8291 PC98


Secondary Beam LineSecondary Beam Line
Secondary Beam Line Control System: Home Page
Secondary Beam LineSecondary Beam Line Last updated by Urs Rohrer on 10-Feb-2006