Developping

Danger

Work in progress

Commands are sended to Pyrame using: bindpyrame.sendcmd(host,port,function,argList) in the python GUI file.

Parameter

Function

Value

Type

host

The IP address of the virtual machine

192.168.56.101

String

port

Module port

MATIS: 9760
IdeFX: 9761
PEPITA: 9762

Integer

function

Name of the function

"my_awesome_function"

String

argList

List of arguments

"arg1", "arg2" ....

String

Caution

Because the PEPITA ASIC is not available at this time (february 2020), we use Idefx for illustration purpose. PEPITA will use same functions.

You have to call register_operation(idefx_id,asicMode,asicAddress,regName,regValue,regMode) to perfom register oprations. The following table gives the argument specifications, it is the argList of the sendcmd command. In case of PEPITA, idefx_id is replaced by pepita_id.

Parameter

Value

Type

idefx_id

The id defined in init_idefx

String

asic_mode

0 for mono ASIC; 1 for multi ASICs

String

asic_address

0 (ASIC#0) to 7 (ASIC#7), 8 (ALL ASICs)

String

regName

The target register name

String

regValue

The value to be written in the register

String

regMode

Operation mode: Write, Read or W/R

String

regLoop (not yet used)

Loop operation, 0: no loop, 1: loop

String

Exemples

#Init and power on MATIS

import bindpyrame

ipVM = "192.168.56.101"
conf_string_matis="matis(bus=tcp(host=192.168.0.10))"

retcode,res = bindpyrame.sendcmd(ipVM,9760,"init_matis","matis",conf_string_matis)
print(retcode,res)

retcode,res = bindpyrame.sendcmd(ipVM,9760,"power_on_matis","matis")
print(retcode,res)
#Switch the multiplexer to channel 2 (ASIC).

import bindpyrame

ipVM = "192.168.56.101"

retcode,res = bindpyrame.sendcmd(ipVM,9760,"set_multiplexer_channel_matis","matis","2")
print(retcode,res)
#Read a register (peaking time, TPEAK).
#res is always a binary string

import bindpyrame

ipVM = "192.168.56.101"

retcode,res = bindpyrame.sendcmd(ipVM,9761,"init_idefx","idefx","matis")
print(retcode,res)

retcode,res = bindpyrame.sendcmd(ipVM,9761,"register_operation_idefx","idefx",
"0","0","TPEAK","0","Read")

print("Default code for TPEAK is 15")
print(int(res,2))