Zynq board

Description

The ZynqManager class holds information on the current status of the Zynq in its public member variables. The majority of the member functions make use of socket programming to communicate with the Zynq board on the ZYNQ_IP and TELNET_PORT defined in the header file. The Zynq has several different operational modes, the key modes will be described here and for further details the reader is directed to the Zynq board documentation written and maintained by Alexander Belov (aabcad@gmail.com).

The Zynq data acquisition modes are documented here

In addition to the standard data acquisition, the Zynq can also provide S-curves. An S-curve is made by sweeping the ASIC thresholds whilst collecting data and can be used to fully characterise the PMTs, making it a powerful diagnostic tool. The ZynqManager::Scurve() takes an S-curve with the desired parameters which are passed from the configuration file by RunInstrument and DataAcquisition. S-curves can be requested from the main program by using the mecontrol -scurve command line argument.

As well as data acquisition the Zynq also handles the interface to the high voltage (HV) which is needed by the PMTs of Mini-EUSO. ZynqManager::HvpsTurnOn() is used to ramp-up the high voltage in safe steps to the desired operational level. Whenever the program is interrupted with CTRL-C (SIGINT), the ZynqManager::HvpsTurnOff() is called to ensure the HV is switched off before the program exits.

ZynqManager

class ZynqManager

class to handle the Zynq interface. commands and information are sent and received over telnet using socket programming. data from the Zynq board is placed on the FTP directory

Public Types

enum ZynqMode

the zynq acquisition mode options

Values:

enumerator NONE

basic modes

enumerator PERIODIC
enumerator SELF
enumerator IMMEDIATE
enumerator EXTERNAL
enumerator TA_TRIGGER
enumerator TRIGGER

compound modes

enumerator PERIODIC_IMMEDIATE
enumerator SELF_IMMEDIATE
enumerator PERIODIC_SELF_IMMEDIATE
enumerator PERIODIC_EXTERNAL
enumerator SELF_EXTERNAL
enumerator PERIODIC_SELF_EXTERNAL
enumerator IMMEDIATE_EXTERNAL
enumerator PERIODIC_IMMEDIATE_EXTERNAL
enumerator SELF_IMMEDIATE_EXTERNAL
enumerator ALL_TRIGGER
enum TestMode

the zynq test mode options

Values:

enumerator T_NONE
enumerator ECASIC
enumerator PMT
enumerator PDM
enumerator L1
enumerator L2
enumerator L3
enum HvpsStatus

the status options for the HV

Values:

enumerator OFF
enumerator ON
enumerator UNDEF

Public Functions

ZynqManager()

constructor initialises public members hvps_status, instrument_mode, test_mode and telnet_connected

int CheckConnect()

check telnet connection on ZYNQ_IP (defined in ZynqManager.h) and close the telnet connection after. has a timeout implemented of length CONNECT_TIMEOUT_SEC (defined in ZynqManager.h)

int GetInstStatus()

check the instrument status

int GetHvpsStatus()

check the HV status

int HvpsTurnOn(int cv, std::string hvps_dv_string, std::string hvps_ec_string)

turn on the HV. ramps up the dynode voltage in steps of 500 HV DAC <=> ~140 V

Parameters:
  • cv – the cathode voltage (int from 1-3)

  • hvps_dv_string – string of N_EC dynode voltage values (HV DAC from 0 to 4096).

  • hvps_ec_string – string of N_EC (each EC unit) comma-separated values, 1 <=> on, 0 <=> off to convert from HV DAC to voltage use (dv/4096 * 2.44 * 466)

int HvpsTurnOff()

turn off the HV

int HidePixels()

Hide the corrupted Pixels give in DeadPixelMask.txt

int Scurve(int start, int step, int stop, int acc)

take an scurve

int SetDac(int dac_level)

set the ASIC DAC on the SPACIROCs

Parameters:

dac_level – (0 - 1000)

int AcqShot()

acquire one GTU frame from the SPACIROCs

uint8_t SetZynqMode()

set the acquisition mode

Parameters:

input_mode – the desired mode to set

TestMode SetTestMode()

set the test acquisition mode

Parameters:

input_mode – the desired mode to be set

int SetNPkts(int N1, int N2)

set the number of packets for D1 and D2 required every 5.24 s

Parameters:
  • N1 – the number of packets for data level 1 (1 - 4)

  • N2 – the number of packets for data level 2 (1 - 4)

int SetL2TrigParams(int n_bg, int low_thresh)

set the configurable parameters of the L2 trigger

Parameters:
  • n_bg – the number of times above background level the threshold is set

  • low_thresh – the lowest possible value of the threshold

bool CheckScurve(int sockfd)

check the S-curve acquisition status and return true on completion

int InstrumentClean()

remove any files on the FTP server.

int Reboot()

Reboot the Zynq.

int SetMatrixDac10(const std::string &usb_mountpoint, bool debug)

Set the ASIC DAC10 values from a text file provided by the USB. Adapted from C. Giammanco’s script to use socket programming instead of netcat.

int Setup(std::string setup_script_path)

Performs the necessary Zynq setup following a reboot.

Public Members

uint8_t zynq_mode

stores the current zynq acquisiton mode

HvpsStatus hvps_status

stores the current HV status

bool telnet_connected

set to true if the telnet connection is successful

std::vector<int> ec_values

vector of EC values (0 <=> off, 1 <=> on)

Public Static Functions

static int ConnectTelnet()

connect via telnet to ZYNQ_IP. NB: leaves telnet open to be closed with a separate function

static int StopAcquisition()

static function to stop acquisition by setting the instrument to NONE

static std::string GetZynqVer()

get the Zynq version info

Private Functions

bool CheckTelnet()

check if the telnet socekt is responding as expected

Private Static Functions

static std::string SendRecvTelnet(std::string send_msg, int sockfd)

send and recieve commands over the telnet connection to be used inside a function which opens the telnet connection

Parameters:
  • send_msg – the message to be sent

  • sockfd – the socket field descriptor

static int SendTelnet(std::string send_msg, int sockfd)

send a command over the telnet connection does not wait for a reply, to be used with “reboot” command to be used inside a function which opens the telnet connection

Parameters:
  • send_msg – the message to be sent

  • sockfd – the socket field descriptor

static std::string Telnet(const std::string &send_msg, int sockfd, bool print)

wrapper for use of SendRecvTelnet() in more readable way

Parameters:
  • send_msg – message to send

  • sockfd – the socket file descriptor

  • print – if true, received message is printed returns the recieved telnet response

static int TelnetSendOnly(std::string send_msg, int sockfd)

wrapper for use of SendTelnet() in more readable way

Parameters:
  • send_msg – message to send

  • sockfd – the socket file descriptor returns 0 if successful