Controller¶
isort:skip_file
- class lvmecp.controller.controller.Module(plcname, config, name, mode, channels, description, *args, **kwargs)[source]¶
Bases:
object
Defines modules connected with an PLC.
- Parameters
plcname (str) – A plc name connected with the module.
config ([]) – The configuration defined on the .yaml file under /etc/lvmecp.yml
name (str) – Module name
mode (str) – Modbus memory type coil/register
channels (int) – Number of elements in the module
description (str) – An explanation of the module
- config_get(key, default=None)[source]¶
Read the configuration and extract the data as a structure that we want. Notice: DOESNT work for keys with dots !!!
- Parameters
key –
The tree structure as a string to extract the data. For example, if the configuration structure is
- ports;
- 1;
desc; “Hg-Ar spectral callibration lamp”
You can input the key as “ports.1.desc” to take the information “Hg-Ar spectral callibration lamp”
- class lvmecp.controller.controller.PlcController(name, config, log)[source]¶
Bases:
object
Talks to an Plc controller over TCP/IP.
- Parameters
name (str) – A name identifying this controller.
config ([]) – The configuration defined on the .yaml file under /etc/lvmecp.yml
log (SDSSLogger) – The logger for logging
- config_get(key, default=None)[source]¶
Read the configuration and extract the data as a structure that we want. Notice: DOESNT work for keys with dots !!!
- Parameters
key –
The tree structure as a string to extract the data. For example, if the configuration structure is
- ports;
- 1;
desc; “Hg-Ar spectral callibration lamp”
You can input the key as “ports.1.desc” to take the information “Hg-Ar spectral callibration lamp”