Starting and using TDUControl » History » Version 8

Version 7 (Thomas Dealtry, 01/30/2015 04:24 AM) → Version 8/21 (Thomas Dealtry, 01/30/2015 04:39 AM)


h1. Getting help

Email Tom Dealtry -

h1. Overview

The following are instructions on how to communicate with the NOvA timing distrubution unit (TDU). The TDU distributes timing information throughout the system, handles synchronisation between boards, and includes automatic propagation delay calculation & compensation.

There are various ways to communicate:

* Through lbnerc & daqinterface (coming soon)
* Booting up an xmlrpc server & commuicating through this
* Communicating with the TDU directly

h1. Communication with the TDU

The following will get Python 2.7.8, and set the environment (the code lives in lbnerc, located at /data/lbnedaq/tdu/lbnerc/)
(Note when the feature/tdu branch is merged into the develop branch, the normal fireup instructions at will work)

source /data/lbnedaq/daqarea/lbne-artdaq-base/setupLBNEARTDAQ
cd /data/lbnedaq/tdu/
source fireup_tdu

h2. Communication via xmlrpc server

List of commands (to be expanded)

All 'get', 'do', and 'read' commands return an error code with a common numbering scheme. 'get' commands also return additional information.

h2. 'get' commands

* <code>get_status()</code>
Returns [error_code, ready_to_do]. When ready_to_do is True, the control register can be modified (i.e. a 'do' command can be performed)

h2. 'do' commands

* <code>do_ping()</code>
ping the TDU

* <code>do_time_sync()</code>
Perform a time synchronisation (this calls <code>get_status()</code> internally)

* <code>do_delay_calc()</code>
Perform a propagation delay calculation (this calls <code>get_status()</code> internally)

* <code>do_send_sync_pulse()</code>
Send a sync pulse (this calls <code>get_status()</code> internally)

* <code>debug_do_write_control_reg(data_to_or)</code>
Write the control register to perform a none standard operation (this calls <code>get_status()</code> internally)

h2. 'read' commands

* <code>read_tdu_id()</code>
Read out the TDU version & ID numbers

* <code>read_tdu_status()</code>
Read out the TDU's current operating conditions (current, voltage, temperature, fan status, FPGA status)

* <code>read_gps_status()</code>
Read out the GPS status (faults, timeouts, sat count, etc. + current UTC time)

* <code>read_error_registers()</code>
Read out the error registers

* <code>read_control_reg()</code>
Read out the control register

* <code>debug_read_all_registers()</code>
Read out all the registers. Also comes with some hints on what the 'default' for normal operating conditions is.

h2. Other commands

* <code>close_socket()</code>
Safely close the connection to the TDU

* print_log
Will be made private

h2. Error codes

100-120 Wrong number of bytes received
-200/-201 Invalid register/data on receive
+200/+201 Invalid register/data on send
300 Cannot perform a 'do' command (get_status() returns ready_to_do=False after 10 attempts including 2 seconds of sleep)
301 Not ready to sync (TDU status error)
302 Not ready to sync (GPS status error)
400 Error found in error registers

h1. List of TDU IP addresses (to be expanded)

* Master:
* Slave:

h1. Using the NOvA GUI (TDUControl) - OLD & BROKEN

To start TDUControl, use the following steps:

# log into the <code>lbnedaq</code> account on <code>lbne35t-gateway01</code>
# <code>source /data/lbnedaq/novadaq/setup/</code>
# <code>TDUControl -m</code>
# enter the IP address of the Master TDU into the GUI (

Alternatively for steps 3 & 4, you can run <code>TDUControl -m -t</code>