licel_tcpip¶
class for interacting with the ethernet controller
- class Licel.licel_tcpip.EthernetController(ip: str, port: int)¶
- BufferSize = 0¶
Buffer size to receive MPUSH data
- MPushStartFromConfig(shots: int, Config)¶
Starts the MPUSH acquisition mode from configuration. Internally this function will:
Get the timestamp endianness
Get hardware information for each active transient recorder in Config.
Calculate the expected number of bytes to be received.
Generate the MPUSH command depending on the Config.
Sends the generated MPUSH command to the controller.
- Parameters:
shots (int) – number of shots to be acquired
Config (Licel.licel_acq.Config()) – system configuration
- Returns:
ethernet controller response
- Return type:
str
- MPushStop()¶
stops the push/mpush mode. Internally it sends a
SLAVE
command. for more information: https://licel.com/manuals/ethernet_pmt_tr.pdf#TCPIP.SLAVE :raises Exception: if the stop command is not executed.- Returns:
Controller response.
- Return type:
str
- Tr¶
alias of
TransientRecorder
- configureHardware(Config)¶
Configure the active transient recorders hardware as specified in config.
currently configuers following parameters : - Threshold mode
Pretrigger
Discriminator level
Frequency divider
Input range
Max shots
Block global trigger.
- Parameters:
Config (Licel.licel_acq.Config()) – holds the acquisition configuration information
- Returns:
None
- exceptedByte = 0¶
number of byte expected to be received for a complete data set
- getCapabilities() str ¶
- Get the available subcomponents of the ethernet controller like:
TR - for controlling transient recorder
APD - for APD remote control
PMT - for PMT remote control
PMTSPI - for controller PMT high voltage module via SPI
TIMER - for the trigger timing controller
CLOUD - for transient recorder controller cloud mode
BORE - Boresight alignment system
- Returns:
ethernet controller subcomponents
- Return type:
str
- getID() str ¶
Get the identification string from the controller
- Returns:
ethernet controller identification number
- Return type:
str
- getMilliSecs() str ¶
Requests the millisecond timer value of the controller
- Returns:
millisecond timer value of the controller
- Return type:
str
- killSocket() None ¶
Method to be used when controller is not responding. This will attempt to connect on the controller
kill port
and asks the controller to close all it’s open connection. This should act as a soft reset and we will be able to established a new connection with the controllerused internally in the reconnect mechanisms.
- Raises:
Socket.timeout – if unable to connect to kill port.
- Returns:
None
- listInstalledTr() TransientRecorder ¶
attempts to communicate with transient recorder with adresse 0 .. 15 and lists all installed transient recorders.
- Raises:
RuntimeError – if no transient recorder is detected
- Returns:
dictionary containing information about installed Transient recorder
- Return type:
{‘TR0’: ‘(not)installed’, ‘TR1’: ‘(not)installed’, ‘TR2’: ‘(not)installed’, ‘TR3’: ‘(not)installed’, ………………….. ‘TR15’: ‘(not)installed’}
- multiplyBinwidth(multiplier)¶
Multiply the the transient recorder base binwidth by
multiplier
. This will reduce the range resolution by actually reducing the sampling rate of the transient recorder before the data summation. multiplier possible value are between 0, 1, 2 ,4, 8, 16, 32, 64, 128.- Parameters:
deviceNumber (int) – transient recorder adresse
multiplier – possible value are 0, 1, 2 ,4, 8, 16, 32, 64, 128.
int
- openConnection() None ¶
Open connection to the command socket
- Raises:
TimeoutError – attempted connection but controller did not respond. Possible causes, controller is not connected to network or controller is already connected to other device
- Returns:
None
- openPushConnection() None ¶
Open connection to the push socket
- Raises:
TimeoutError – attempted connection but controller did not respond. Possible causes, controller is not connected to network or controller is already connected to other device
- Returns:
None
- pmt¶
alias of
photomultiplier
- recvPushData() None ¶
read push/mpush data from the ethernet controller push port.
used for reading push/mpush from transient recorder.
fills
self.pushBuffer
. If after a certain time not data is recived, checks if counterpart is still reachable by sending*IDN?
on the command socket.- Raises:
ConnectionResetError if the counter part closes the connection
- Raises:
socketTimeout if counter part is unreachable
- Raises:
ConnectionError if error is written.
- selectTR(numTR: int) str ¶
select transient recorder to communicate with.
- Parameters:
numTR (int) – transient recorder adresse between 0 .. 15
- Returns:
select numTR executed
orDevice ID ``numTR` is currently not supported
- Return type:
str
- shutdownConnection() None ¶
close connection to the command socket
- Returns:
None
- shutdownPushConnection() None ¶
close connection to the push socket
- Returns:
None
- totalnumBins = 0¶
holds the total number of bins to be read.