- Python 3.7
The module uses setuptools in order to install and configure all packages.
- (Optional) Create a virtual environment and activate it
- python -m venv env
- (windows) /env/Scripts/activate.bat
- Install everything using setup.py
- pip install -e .
- Use within virtual enviroment
If you choose not to use virtual enviroment, you might need to edit the import statements of the module!
string ip
- host IP for tcp/ip (ex. 192.168.0.XXX)int port
- TCP port number for tcp/ip (ex. 502)int slave_id
- unit or slave Modbus identification number for the device (ex. 0)
vaemConfig
holds the arguments for the newVAEM
object- Creates a new
VAEM
driver object (ip
,port
,slave_id
) and attempts to connect - Initializes the device and configures the valves using the given array of opening times
- While loop that repeatedly opens and closes valve 1
- Reads the status of the
VAEM
after opening the valve - Waits one second between opening and closing, vice versa
- Checks if there is an error and clears it if true
- Sets the
TcpClient
with the given host ip and port fromconfig
- Attempts three times to connect to the client
- Throws an error if the code was not able to connect to the device
- Sets the operating mode to
OpMode1
using a write operation - Clears any errors on the device using a write operation
(constructFrame
builds the message to be sent to the device and transfer
sends it)
- configureValves(valveOpeningTimes: dict);
- openValve(self);
- closeValve(self);
- readStatus();
- clearError();
- saveSettings();
Name | GitHub | |
---|---|---|
Milen Kolev | milen.kolev@festo.com | @MKollev |