Nicolas Berger, 10/06/03 Trigger Slow-Monitoring : How it works, how to run it ----------------------------------------------------- I. How to use it ---------------- 1. What it does The current version of the trigger slow-monitoring is designed to monitors the fiber-optic connections of the TSFi boards. The monitored quantities are as follows : - GLINK ready flag (RDY) - GLINK synchronization flag (SYNC) - optical fiber signal-detect flag (SIGDET) - Optical power in the fiber (OPTPOW) - Operating voltage (VREG) The first 3 quantities can be either true (value = 0V) or false (value = +5V). (the choice of true and false is unfortunate, since absence of signal -- e.g. in the case of a missing board in the slot -- is interpreted as "OK".) The last 2 can have any value between 0 and 5 V. 2. How to use it The monitored quantities are published on EPICS monitoring panels. The panels come in 2 flavors : "Full Detail" and "Light Version". The full-version panels show the raw voltages as described above, while the light-version ones use EPICS LEDs and a gauge for the optical power reading. The panels come in 2 versions, one for the new TSF boards and one for the old. This is necessary since the old and new TSF are read out differently for slow-monitoring. For IR2 this is also necessary since both sets of TSF will have to be monitored simultaneously for the parallel commisioning period. The panels can be accessed from the EPICS main window as follows : Right-click on the TRG button in the subsystems list, and select "L1 TSF Mon". This pops up a display from which you can access the 4 panels described above. II. How it works, and how to maintain it ------------------------------------------ 1. Where the code is The slow-mon code runs on the dch-mon IOC, so most of the code can be found in /nfs/bbr-srv01/u1/babar/boot/apps/dch-mon/ In particular, dch-mon/cmd contains all the startup scripts to initialize the IOC, including CANbus support. dch-mon/db/ contains the database files which register the trigger monitoring lines. And establish the correspondence between EPICS line names and hardware addresses in the DCCs. The code for the panels themselves are in /nfs/bbr-srv01/u1/babar/boot/apps/trg-mon/dl 2. Hardware setup The TSF boards are located in 21-slot Wiener crates, with a DCC board in slot 5 and up to 16 TSF's in slots 6-21. Each board is connected through the backplane to a TSFi board to which the optical fiber is connected. The DCC is connected to the CANbus and performs the monitoring by constantly scanning the boards. TSFi quantities are relayed through the TSF and made available to the DCC on 8 ports. The mapping between these ports and the monitored quantities is different for the old and new TSFs, and is given as follows : Qty Port (Old TSF) Port (New TSF) RDY 2 2 SYNC 3 0 SIGDET 4 1 OPTPOW 5 3 VREG 6 4 The DCC addresses the boards using an identifier in the range [0..2047], given a follows : Slot Address Slot Address 1 1029 9 1285 2 1030 10 1286 3 1031 11 1287 4 1280 12 1536 5 1281 13 1537 6 1282 14 1538 7 1283 15 1539 8 1284 16 1540 If there are multiple crates on the CANbus, the addresses above are valid for crate 0, and addresses on other crates are obtained by adding 8 times the crate number to the ones above. The DCC makes the monitored quantities available on the CANbus, where they can be read out by EPICS. 3. EPICS Setup The monitored quantities are read from CANbus and published on the EPICS Channel Access network by dch-mon. The main source of information for this are the .db files in the db/ subdirectory of the ICO EPICS directories. These contain lists of records, which associate a canbus address with an EPICS channel. The format is o EPICS Line TRG::TSFNEW:TSF: TSFOLD:TSF: where n is the slot number and the quantity identifier. o CANbus Address "@can/200:. 0xff" where n is the CANbus bus number (0-3), the slot address as given above, the port as given farther above. 200 gives the timeout (in seconds) For example, for reading the optical power from an old TSF in slot 4 on bus 0, one would use "@can0/200:1280.5 0xff". For IR-2, the setup is as follows : all the slow-mon is on bus 0, and the TSF are distributed as follows : crate 0 : Old TSFY crate 2 : Old TSFX crate 3 : New TSFY crate 5 : New TSFX the channels for this setup, taking into account both crate number and new/old readout is defined in the following files : dch-mon/db/trg-tsfy-old-ir2.db dch-mon/db/trg-tsfx-old-ir2.db dch-mon/db/trg-tsfy-new-ir2.db dch-mon/db/trg-tsfx-new-ir2.db 4. Teststand setup The teststand is setup in a similar way. The IOC used is physically dch-proto, but running the code in the trg-proto directory. As in IR-2, there are 4 panels, located in /nfs/bbr-srv01/u1/babar/boot/apps/trg-proto/dl There are 4 scripts to launch the panels in this directory, named epicsTestStandOld epicsTestStandOldLight epicsTestStandNew epicsTestStandNewLight They should be run from a machine that "sees" the IOC, such as dali. For the teststand, there is only one crate, but it may contain either old or new TSF. EPICS channels for both cases are defined, each published in a separate EPICS panel -- depending on what is actually in the crate, one set of channels will give nonsense. It is up to the user the look at the right panel! ------------------- - Nicolas