Multi-ZeroMQ IO Interface

class larpix.io.multizmq_io.MultiZMQ_IO(config_filepath=None, miso_map=None, mosi_map=None)[source]

The MultiZMQ_IO object interfaces with a network of Bern LArPix v2 modules using Igor’s ZeroMQ communications protocol.

This object handles the required communications, and also has extra methods for additional functionality, including system reset, packet count, clock frequency, and more.

By default, when creating a MultiZMQ_IO object, the io/default.json configuration will attempt to be loaded unless otherwise specified. The path relative to the pwd is checked first, followed by the path of the larpix-control installation.

send(packets)[source]

Function for sending larpix packet objects

Parameters:packetslist of larpix Packet objects to send via IO
Returns:None
start_listening()[source]

Function for starting read communications on IO

Returns:None
stop_listening()[source]

Function for halting read communications on IO

Returns:None
decode(msgs, address, **kwargs)[source]

Convert a list ZMQ messages into packets

encode(packets)[source]

Encode a list of packets into ZMQ messages

empty_queue()[source]

Process any awaiting messages from all ZMQ connections. Will continue to read until the hwm is reached or there are no more awaiting messages.

Returns:2-tuple containing a list of received packets and the full bytestream
reset(addresses=None)[source]

Send a reset pulse to the LArPix ASICs.

Parameters:addresseslist of daq board addresses to reset, if None reset all addresses
set_clock(freq_khz, addresses=None)[source]

Set the LArPix CLK2X freqency (in kHz).

Parameters:
  • freq_khz – CLK2X freq in khz to set
  • addresseslist of daq board addresses to change frequency, if None modifies all addresses
set_testpulse_freq(divisor, address)[source]

Set the testpulse frequency, computed by dividing the CLK2X frequency by divisor.

Parameters:
  • divisor – test pulse frequency divisor
  • address – daq board addresses to change test pulse freq
get_packet_count(io_channel, address)[source]

Get the number of packets received, as determined by the number of UART “start” bits processed.

Parameters:
  • io_channel – IO channel to check
  • address – address of daq board
ping(addresses=None)[source]

Send a ping to the system.

Parameters:addresseslist of daq board addresses to ping, if None ping all addresses
Returns:dict with one entry per address. Value is True if first two bytes of the response are b’OK’.
cleanup()[source]

Close the ZMQ objects to prevent a memory leak.

This method is only required if you plan on instantiating a new MultiZMQ_IO object.