SPEC Client/Server Mode at G-line

Introduction

SPEC client/server mode is a new development by Gerry Swislow to allow SPEC to
operate motors and scalers controlled by a remote computer to be accessed by a local
computer in a transparent mode, i.e. without the user actually "feeling" that these devices
do not reside in the local computer. This mode will be very relevant for G-line where
the whole control system is based on local industrial PC's in the hutches and optics cave
and control PC's outside at the control desks. Eventually we want to be able to run SPEC
on the control PC's with full access to the hutch PC and the optics PC for each station.
 

Server

In the definition of client/server mode, the  server is the computer controlling the hardware directly.
In our case this is an industrial PC with the PCI boards interfacing motors and scalers. Requirement for
a server computer is SPEC beta version "spec5.02.02" and starting SPEC in server mode:

fourc -S <port number>

The default port number is 6789. It can be any number above 2000 (to stay clear of ports used
by the operating system). Otherwise SPEC will be configured the usual way. As an example we
provide the set-up used in the G2 hutch:
 

Motor and Counter Device Configuration (Not CAMAC)

 MOTORS        DEVICE   ADDR  <>MODE  NUM                                 <>TYPE
    YES                         POLL    4              Oregon Micro Systems PCIx
    YES                         POLL    4              Oregon Micro Systems PCIx
     NO
     NO
     NO
     NO
     NO
     NO

SCALERS        DEVICE   ADDR  <>MODE  NUM                                 <>TYPE
    YES                                 9        Am9513 Counter/Timer PCI Boards
     NO
     NO
     NO
     NO
     NO
     NO
     NO
 

motor parameters for the first 4 motors (standaed SPEC):

Number: <>Controller        0:     OMS   1:     OMS   2:     OMS   3:     OMS
Unit/Channel                       0/0          0/1          0/2          0/3
Name                               tth           th          chi          phi
Mnemonic                           tth           th          chi          phi

Steps per degree/mm              10000       -40000       -40000       -10000
Sign of user * dial                  1            1            1            1
Backlash [steps]                  2000        -4000        -4000        -1000
Steady-state rate [Hz]           10000         5000        10000        10000
Base rate [Hz]                    2000          500         2000         2000
Acceleration time [msec]           250          250          250          250
Motor accumulator                59412      -146398     -3800000     -2598866
Restrictions                      NONE         NONE         NONE         NONE

Dial = accumulator / steps
  High limit                  120.0000      30.8072     200.0000    1000.0000
  Current                       5.9412       3.6599      95.0000     259.8866
  Low limit                   -10.0000      -4.1928      60.0000   -1000.0000
User = sign * dial + offset
  Offset                        0.0588      -0.5099       0.0000    -259.8866
  `High' limit                120.0588      30.2972     200.0000     740.1134
  Current                       6.0000       3.1500      95.0000       0.0000
  `Low' limit                  -9.9412      -4.7027      60.0000   -1259.8866

Number of motors                     8     Type ? ancd H for help, ^C to quit
 

scaler configuration (standard SPEC):

Scaler (Counter) Configuration

Number        Name  Mnemonic  <>Device  Unit  Chan   <>Use As  Scale Factor
     0     Seconds       sec    AM9513     0     0   timebase          1000
     1         mon       mon    AM9513     0     1    monitor             1
     2       Imono     Imono    AM9513     0     2    counter             1
     3          I0        I0    AM9513     0     3    counter             1
     4       diode     diode    AM9513     0     4    counter             1
     5          I1        I1    AM9513     0     5    counter             1
     6         det       det    AM9513     0     6    counter             1

Number of counters                   7     Type ? and H for help, ^C to quit
 
 

Client

The client computer also has to run SPEC version "spec5.02.02". SPEC is invoked the usual way, e.g.

fourc

All the client/server protocol is set up with the config editor. As an example we continue with the G2
SPEC setup:
 

Motor and Counter Device Configuration (Not CAMAC)

  MOTORS        DEVICE   ADDR  <>MODE  NUM                                 <>TYPE
    YES  g2hutch:6789                  8                     SPEC Motor (TCP/IP)
     NO
     NO
     NO
     NO
     NO
     NO
     NO

SCALERS        DEVICE   ADDR  <>MODE  NUM                                 <>TYPE
    YES  g2hutch:6789                   7             SPEC Timer/Counter (TCP/IP)
     NO
     NO
     NO
     NO
     NO
     NO
     NO

notes:
- the format in the DEVICE column is <remote computer>:<port number>
- the port number has to agree with the port number provided to the server on start-up
- the server computer can be specified by either its IP address or its name on the nameserver
- each server computer needs a separate entry in the motor or scaler configuration
 

motor parameter menue for the first 4 motors :
 

Number: <>Controller        0: SPEC_M2   1: SPEC_M2   2: SPEC_M2   3: SPEC_M2
Unit/Channel                       0/1          0/2          0/3          0/4
Name                               tth           th          chi          phi
Mnemonic                           tth           th          chi          phi
Steps per degree/mm               2000         2000         2000         2000
Sign of user * dial                  1            1            1            1
Backlash [steps]                    50           50           50           50
Steady-state rate [Hz]            2000         2000         2000         2000
Base rate [Hz]                     200          200          200          200
Acceleration time [msec]           125          125          125          125
Motor accumulator                59412      -146398     -3800000     -2598866
Restrictions                      NONE         NONE         NONE         NONE

Dial = accumulator / steps
  High limit                  120.0000      30.8072     200.0000    1000.0000
  Current                      29.7060     -73.1990   -1900.0000   -1299.4330
  Low limit                   -10.0000      -4.1928      60.0000   -1000.0000
User = sign * dial + offset
  Offset                        0.0588      -0.5099       0.0000    -259.8866
  `High' limit                120.0590      30.2975     200.0000     740.1135
  Current                      29.7650     -73.7090   -1900.0000   -1559.3195
  `Low' limit                  -9.9410      -4.7025      60.0000   -1259.8865

Number of motors                     8     Type ? and H for help, ^C to quit
 

notes:
- unit numbers refer to the server computers specified in the Motor and Scaler Configuration
- channel numbers start with 1 (different from the usual SPEC standard).
- motors are recognized by their mnemonics, hence motors with identical names on two servers
  have to be renamed.
 

scaler configuration  menue:

Scaler (Counter) Configuration

Number        Name  Mnemonic  <>Device  Unit  Chan   <>Use As  Scale Factor
     0     Seconds       sec   SPEC_SC     0     1   timebase    1
     1         mon       mon   SPEC_SC     0     2    monitor    1
     2       Imono     Imono   SPEC_SC     0     3    counter    1
     3          I0        I0   SPEC_SC     0     4    counter    1
     4       diode     diode   SPEC_SC     0     5    counter    1
     5          I1        I1   SPEC_SC     0     6    counter    1
     6         det       det   SPEC_SC     0     7    counter    1

Number of counters                   7     Type ? and H for help, ^C to quit
 

notes:
- all scale factors should be set to 1  (the proper choice of scale factors is done on the
  server computer)
- only one timebase is defined.
- (use of scalers on servers other than the server providing the timebase is not quite worked out,
   unless there is hardware gating between separate PC's)