HAICU Interlock Watchdog frontend
Frontend to communicate with the Arduino-based HAICU interlock watchdog
Loading...
Searching...
No Matches
HAICU fearduino_wd

This is the MIDAS/TMFE frontend equipment for an Arduino-based watchdog over TCP.

The frontend manages ODB settings for arming/disarming the watchdog and configuring a 64-bit channel mask. It periodically polls the device for triggered channels and publishes readback + per-channel variables to ODB.

Full documentation here.

Requirements

Confirmed to run on standard Linux DAQ systems (Ubuntu 22.04 and similar).

Requires cmake >= 3.10.

Requires a working MIDAS installation (TMFE framework) and the MIDASSYS environment variable to be set.

Submodules

No external communication libraries are required.

TCP communication is implemented directly in this repository (SimpleTcpClient).

Compilation

If MIDASSYS is configured correctly, a full build should work via

mkdir build
cd build
cmake ..
make

Usage

The frontend executable is fearduino_wd.

It registers the equipment as ARDUINO_WD and polls the watchdog at a fixed period. Connection and control are performed via ODB settings under /Equipment/ARDUINO_WD/Settings.

This frontend uses TCP only (host/port are configured in ODB).

./fearduino_wd

Protocol

Device-side protocol notes:

  • Commands are ASCII lines terminated with CRLF.
  • Replies are line-based and end with an END line.

Commands used by the frontend:

  • ARM / DISARM : Arm/Disarm specific pins
  • MASK 0x%08X%08X (MaskHi then MaskLo) : Mask the unmonitored pins
  • CLEAR : Clear all triggered pins
  • TRIGGERED : Find the triggered pins

ODB Structure

ODB layout (relative to /Equipment/ARDUINO_WD/):

Settings

  • Settings/Host (string) - hostname or IP of the watchdog (default: watchdog01)
  • Settings/Port (string) - TCP port (default: 5000)
  • Settings/Armed (int 0/1) - arm/disarm request
  • Settings/MaskLo (DWORD) - channel mask bits 0..31
  • Settings/MaskHi (DWORD) - channel mask bits 32..63
  • Settings/Clear (int 0/1) - write 1 to request CLEAR (frontend resets to 0 after successful clear)

Readback

  • Readback/Status (string) - connection/state summary (Connected, ARMED, DISARMED, error text, etc.)
  • Readback/TriggeredPins (string) - human-readable summary, e.g. CH3 PIN12; CH9 PIN7

Variables

All arrays are length 64 (channels 0..63):

  • Variables/Triggered (int[64]) - 1 if channel currently triggered else 0
  • Variables/TriggeredPin (int[64]) - pin number for the channel or -1 if not triggered
  • Variables/FirstMS (DWORD[64]) - first trigger time (ms) reported by device
  • Variables/LastMS (DWORD[64]) - last trigger time (ms) reported by device

Notes

  • The frontend reconnects automatically when Settings/Host or Settings/Port changes, or when the TCP connection drops.
  • After reconnect, ARM/MASK are re-applied to restore device state.
  • Receive operations use a socket timeout to avoid blocking indefinitely.