The original temperature monitoring application provided by the magnet vendor was a proprietary software solution that ran on a Windows 2000 PC. A USB-to-serial multiplexer provided enough serial ports for the computer to communicate with six LakeShore temperature monitors. The software queried the monitors for temperature data and transmitted the results to the PLC over Ethernet. The primary disadvantage of this system was the necessity of running a Windows 2000 PC in the hall during beam operations. It was found that this system was unstable under such circumstances and tended to fail frequently. The computer's size and location was such that shielding with lead was infeasible. It was decided to procure a new system that would hopefully be less crash prone in the high radiation environment of the hall.
The new monitoring application uses a single board computer
(SBC) implementing the PC/104
bus interface. This SBC has an AMD processor, a CompactFlash
"hard drive", a pair of Ethernet ports, and a variety of serial
ports. It is about the size of a small, thick hardcover novel.
The SBC runs a distribution of Linux (TSLinux)
developed by the manufacturer. This choice of hardware and
software offered a cheap, off-the-shelf solution to interfacing
six serial devices with the PLC. The small size will make it
easy to add additional radiation shielding. The SBC is named
g0-pc104.
The following hardware was procured for the new temperature monitoring application:
The following pair of tables describe the location and purpose
of the various serial and ethernet ports available on
g0-pc104.
| Serial Port | Enclosure Location | Board | Port | IRQ | Device |
|---|---|---|---|---|---|
| /dev/tts/0 | Front | SBC | COM1 | ? | - |
| /dev/tts/1 | Front | SBC | COM2 | ? | Console Login |
| /dev/tts/5 | N/A | Bottom TS-SER4 | COM A | 5 | N/A |
| /dev/tts/6 | N/A | Bottom TS-SER4 | COM B | 5 | N/A |
| /dev/tts/7 | Front | Bottom TS-SER4 | COM C | 5 | - |
| /dev/tts/8 | Rear | Bottom TS-SER4 | COM D | 5 | - |
| /dev/tts/9 | Side | Top TS-SER4 | COM A | 7 | - |
| /dev/tts/10 | Side | Top TS-SER4 | COM B | 7 | - |
| /dev/tts/11 | Rear | Top TS-SER4 | COM C | 7 | - |
| /dev/tts/12 | Rear | Top TS-SER4 | COM D | 7 | Spare LS-218 Temperature Monitor |
| Ethernet Port | Enclosure Location | Hostname | IP Address | Netmask | Network | Gateway | Interface To |
|---|---|---|---|---|---|---|---|
| /dev/eth0 | Front | g0-pc104.jlab.org | 129.57.168.33 | 255.255.252.0 | 129.57.168.0 | 129.57.168.1 | Public JLab network |
| /dev/eth1 | Front | 192.168.2.10 | 255.255.255.0 | 192.168.2.0 | Private PLC network |
The temperature monitoring application consists of two
separate executables: smsTempServ and
smsPLCServ. The former program communicates with a
single LS-218 temperature monitor via serial interface. It
queries the monitor for all 8 channels of temperature
information simultaneously and outputs the result into a FIFO
pipe. The latter program reads the data in the FIFO pipe and
transmits it to the PLC over Ethernet. The entire application
is started using the TempMon.sh shell script and
requires the input file TempService.ini.
This file stores the temperature curves and other initialization
information for the temperature monitors and the PLC. The
source code for this application is available in a
tarred-gzipped archive (version 1.1).
Communications with the PLC occur via the H4-ECOM ethernet
controller connected to the PLC. This controller utilizes a UDP
protocol to transmit and receive information. It was necessary
to acquire a copy of the Ethernet SDK source
code from the H4-ECOM's manufacturer Host Engineering. The
provide MS Windows binaries for the SDK directly on their web
site, but you must e-mail them a request for a source copy of
the SDK that can be compiled on other platforms. They also
provide a Zip archive of changes someone else made to the SDK to
make it compile under Linux (Linuz.zip).
With a copy of the original SDK and the Linux patches I was able
to compile a library that handled the communications with the
PLC. The Linux patches provided did allow access to Ethernet
interfaces other than /dev/eth0 in those machines
with more than NIC. Only one file had to be
modified to allow for this case.
Software development took place on a Linux desktop; static binaries were generated and installed on the SBC.