pylablib.devices.Lumel package
Submodules
pylablib.devices.Lumel.base module
- class pylablib.devices.Lumel.base.LumelRE72Controller(conn, daddr=1)[source]
Bases:
GenericModbusRTUDevice
Lumel RE72 temperature controller.
- Parameters:
conn – serial connection parameters for RS485 adapter (usually port, a tuple containing port and baudrate, or a tuple with full specification such as
("COM1", 9600, 8, 'N', 1)
)daddr – default device Modbus address
- get_reg(address, kind='auto')[source]
Get value of a register at the given address.
kind is a register kind and can be
"int"
(2-byte signed integer),"uint"
(2-byte unsigned integer),"float"
(4-byte float), or"auto"
(either signed integer or float depending on the address).
- get_measurementf()[source]
Return measurement value as a floating point number.
The result is returned in the current display units.
- get_setpointf(setpoint=None)[source]
Get setpoint value as a floating point number.
The result is returned in the current display units. setpoint specifies the setpoint kind and can be
None
(current), 1, or 2.
- get_outputf(output=1)[source]
Get output value in percents.
output specifies the output channel and can be 1 or 2.
- get_measurementi()[source]
Return measurement value as an integer number
The result is returned in the current display units. For temperature units (C and F) this value is degrees multiplied by 10, while for the physical units (A, V) this relation is determined by the decimal point position.
- get_setpointi(setpoint=None)[source]
Get setpoint value as an integer point number.
The result is returned in the current display units. For temperature units (C and F) this value is degrees multiplied by 10, while for the physical units (A, V) this relation is determined by the decimal point position. setpoint specifies the setpoint kind and can be
None
(current), or an integer from 1 to 4.
- set_setpointi(value, setpoint=None)[source]
Get setpoint value as an integer point number.
The result is returned in the current display units. For temperature units (C and F) this value is degrees multiplied by 10, while for the physical units (A, V) this relation is determined by the decimal point position. setpoint specifies the setpoint kind and can be
None
(current), or an integer from 1 to 4.
- Error
alias of
ModbusError
- apply_settings(settings)
Apply the settings.
settings is the dict
{name: value}
of the device available settings. Non-applicable settings are ignored.
- close()
Close the backend
- get_device_variable(key)
Get the value of a settings, status, or full info parameter
- get_full_info(include=0)
Get dict
{name: value}
containing full device information (including status and settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_full_status(include=0)
Get dict
{name: value}
containing the device status (including settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- get_settings(include=0)
Get dict
{name: value}
containing all the device settings.include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
- is_opened()
Check if the device is connected
- lock(timeout=None)
Lock the access to the device from other threads/processes (isn’t necessarily implemented)
- locking(timeout=None)
Context manager for lock & unlock
- mb_get_default_address()
Get device address used by default in Modbus methods
- mb_get_device_id(daddr=None)
Get Modbus device ID (function 17)
- mb_read_coils(address, quantity=1, daddr=None)
Read Modbus one-bit discrete coils with the given starting address and quantity
- mb_read_discrete_inputs(address, quantity, daddr=None)
Read Modbus one-bit discrete inputs with the given starting address and quantity
- mb_read_holding_registers(address, quantity, daddr=None)
Read Modbus two-byte holding registers with the given starting address and quantity
- mb_read_input_registers(address, quantity, daddr=None)
Read Modbus two-byte input registers with the given starting address and quantity
- mb_scan_devices(daddrs='all', timeout=0.1, func=1, payload=b'')
Scan for devices on the bus by sending a specified command and waiting for the reply.
daddrs is a list of addresses to check (
"all"
means all addresses from 1 to 247 inclusive) timeout is the timeout to wait for each device reply. func and payload specify the message to send (by default, ‘read coil’ command with no arguments, which should always return and error) Since the addresses are polled consecutively, this function can take a long time (~25s for the default settings).
- mb_set_default_address(daddr)
Set device address used by default in Modbus methods
- mb_using_address(daddr)
Context manager for temporary using a different default device address
- mb_write_multiple_coils(address, value, quantity=None, daddr=None)
Write multiple Modbus one-bit discrete coils with the given starting address and quantity.
value is a bytes object with the bit values listed LSB first.
- mb_write_multiple_holding_registers(address, value, daddr=None)
Write a multiple Modbus two-byte holding registers at the given address.
value is a bytes object with the values listed LSB first.
- mb_write_single_coil(address, value, daddr=None)
Write a single Modbus one-bit discrete coil at the given address
- mb_write_single_holding_register(address, value, daddr=None)
Write a single Modbus two-byte holding register at the given address
- open()
Open the backend
- set_device_variable(key, value)
Set the value of a settings parameter
- unlock()
Unlock the access to the device from other threads/processes (isn’t necessarily implemented)