Title: Source Controller software
1Source Controller software
- Ianos Schmidt
- The University of Iowa
2System
HE
HO1,2
HO0
HO 1,-2
HE-
HB
HB-
HF
HF-
Services Air drivers Electric drivers
Total 10 16
2 3?
2 3?
0 2
3 3
0 0?
0 0?
3 3
0 2
0 0?
Air supply pressure switches
Crate of controller boards
Crate of controller boards
DIM Client(s)
Power supplies 5V,18V,24V
Local control laptop
DIM Server
RS-485 links
RS-232 directly to individual boards.
3Software diagram
Tools for testing, configuration and programming
of controllers. Controller source code.
Laptop
Run Control
Control PC
RS-232
DIM Server
RS-485
DIM clients
DIM clients
DIM client
Database ?
Controller boards
Local disk
- Config. info
- Tube maps
- Source code
Local tools for configuration, testing,
and compiling code
Config. info Tube maps Source code
Controller code and settings in flash memory
4Controller software
- Each controller board contains a Philips 89C51RB2
microcontroller. The code for these is written
in the native 8051 compatible assembly
language. - The Assembly code is complied using ASM51, and
the controllers are programmed using either
WINISP or Flash Magic programming tools. All of
these tools are free, and operate under Windows. - The programming interface is non-proprietary
and fully documented allowing the option to
implement a custom programmer on any platform in
the future if necessary. - This code provides all functionality to operate
the Purdue wire source drivers, and to provide a
standard interface, regardless of driver type,
via RS-232 or RS-485 to the DIM server. - Information that describes the specific hardware
and related behaviors is stored in a block of
flash memory which is transferred to RAM at boot
up. These values can be modified and resaved, or
default values can be restored via the serial
interface. Generally speaking these parameters
will only need to be changed if the driver
hardware or control electronics are changed.
5DIM Server
- The DIM server communicates with the controller
boards via RS-485, and produces a set of DIM
services and commands specific to each controller
board. There is one additional information
service that consists of the status words from
each of the drivers. - Each controller is uniquely identified by its
address and associated with information stored in
either a file or a local database. This data set
consists of the following information for each
driver - Driver name
- Driver type (Electric Driver, Air Driver,
Monitor, None). - Default tube map.
- Port number
- State (locked, Enabled,)
-
- Board addresses are determined by the slot
numbers in the crates. Each slot also holds the
connector from a specific source driver control
cable, thus the controller address is associated
with specific driver locations on the
experiment.
6DIM Service information
- COMMAND SERVICES
- Command name Format
Parameter1 Parameter2 - 1. "CMS/HCAL/RSRC_ServerSubname/DEV/INIT
I2 Index Reel - 2. "CMS/HCAL/RSRC_ServerSubname/DEV/GO"
I2 Index Reel - 3. "CMS/HCAL/RSRC_ServerSubname/DEV/SCAN"
I2 Index_from Index_to - 4. "CMS/HCAL/RSRC_ServerSubname/DEV/STOP"
- 5. "CMS/HCAL/RSRC_ServerSubname/DEBUG"
I2 Device(0 means all) level(0-3) - Information services.
- --------------------
- 1. "CMS/HCAL/RSRC_ServerSubname/STATUS"
I16 - Contains status words (see lower) for all the
16 drivers - 2. "CMS/HCAL/RSRC_ServerSubname/DEV/STATUS"
I - Service sends the structure SrcInfo
- typedef struct
- int message_counter
7Server log file
- The DIM server writes a local log file for each
driver which contains an entry for each change in
status. For changes in controller status an
entry consists of all controller state
information.
Sample from log file
100300 254 160 0000 0010 884 2 0 107
0000 0000 0000 0000 0000 0000 100304 254
160 0000 0011 583 2 48 107 0000 0000 0000
0000 0000 0000 100305 254 160 0000 0010
634 2 56 107 0000 0000 0000 0000 0000
0000 100315 254 160 0000 0000 5 2 0
24 0000 0000 0000 0000 0000 0000 100444
Command SCAN recived with parameters 7
7 100444 254 160 0000 0110 6 2 5 78
0000 0000 0000 0000 0000 0000 100445 254
160 0000 0000 0 2 0 78 0000 0000 0000
0000 0000 0000 100445 254 160 0000 0010
0 2 0 105 0000 0000 0000 0000 0000
0000 100446 254 160 0000 0000 0 2 0
107 0000 0000 0000 0000 0000 0000 100446
254 160 0000 0101 0 2 37 80 0000 0000
0000 0000 0000 0000 100447 254 160 0000
0000 0 3 0 78 0000 0000 0000 0000 0000
0000 100447 254 160 0000 0101 0 3 47
78 0000 0000 0000 0000 0000 0000 100449 254
160 0000 0000 0 4 0 78 0000 0000 0000
0000 0000 0000 100449 254 160 0000 0101
0 4 53 78 0000 0000 0000 0000 0000
0000 100450 254 160 0000 0000 0 5 0
78 0000 0000 0000 0000 0000 0000 Mon Jul 19 add
comm status reel ind I V Errors0
Errors1 Warnings 100450 254 160 0000 0101
0 5 36 78 0000 0000 0000 0000 0000
0000 100451 254 160 0000 0000 0 6 0
78 0000 0000 0000 0000 0000 0000 100452 254
160 0000 0101 0 6 42 78 0000 0000 0000
0000 0000 0000 100453 254 160 0000 0000
0 7 1 78 0000 0000 0000 0000 0000
0000 100503 254 160 0000 0001 3 7 44
105 0000 0000 0000 0000 0000 0000 100618
254 160 0100 0001 6534 7 0 107 0000 0000
0000 0000 0000 0100
8Tube maps
- Tube maps from files or a database will be used
to provide specific information about the tubes
that are connected to the drivers. Which map to
use can be specified from a DIM client, otherwise
the default specified in the configuration data
will be used. - Each entry is associated with the index number
from the related driver. - A tube map contains the following information
- Global
- Map title
- Driver type
- First and last tube number
- Optional default settings for the driver
(parameter overrides) - Tube specific
- Tube number.
- Tube name (ie. HE1, sector 2, slice 1, layer
5) - Tube status (skip, ok, warn, test)
- Maximum length
- Start of detector/area of interest
- (Optional settings such as motor voltage/speed
for extend/retract, in/out of detector)
9DIM clients
- A Visual source controller client is under
development using Borland tools. This provides
an easy to use graphical interface that allows
use all the available DIM services and commands.
Ultimately this will be implemented in PVSS. - Run control contains a client for merging the
source controller data with DAQ data. Run
control also provides sequence files to automate
the sending of DIM commands. - The run control DIM interface will have to be
updated to use tube map and configuration
information.
10Miscellaneous Other software
- Controller test program for sending raw serial
commands to a controller card. This is to be
used while the laptop is directly connected to
the RS-232 connector on the front of a controller
card. - When connected in this way the controller is
automatically dropped from the RS-485 buss
allowing maintenance and testing of individual
cards while the other cards are in operation, or
for testing cards individually outside of the
crate. - Tool for setting controller parameters and saving
them to flash memory. Although this will rarely
need to be done it is tedious to do using the raw
serial commands. - DID (Dim display) Tool part of the DIM package
for testing DIM servers. - Borland BCB for building code.
11Status
- Controller code
- First version of Air driver code has been written
and basic functionality tested. More work is
needed before it is ready for use. - Electric driver controller code version 1 was
completed last fall but needs to be modified to
reflect changes made in the air driver code. - Geiger counter, speed readout, and possibly speed
control have yet to be implemented. - DIM server
- Recently ported to work with Borland tools. The
Server can work on both windows and Linux
platforms, and can be complied in both Microsoft
Visual C and Borland. - DIM server code is presently operational but use
of the configuration and tube map information has
yet to be implemented. - DIM clients
- Visual client under development. Work with PVSS
needs to be started. - Run control interface needs to be reviewed and
modified to use tube maps. - Database
- Need to establish interface to CMS databases if
necessary. Work not yet started.