DragonFly IV Real Ink Status
This script is designed to perform automated monitoring and alerting for liquid levels in tanks.
What does the script do
- Reading Data: The script connects to a programmable logic controller (PLC) and retrieves values for the weight of two tanks and the status of various sensors and valves. It also reads a minimum value stored in a separate file.
- Data Processing: The script checks the retrieved values against predefined thresholds to determine if any tank is running low on liquid. If a tank's liquid level falls below a certain threshold, an alert is triggered.
- Alerting: When a tank's liquid level is low, the script sends an alert message using the Twilio service. The message includes information about the tank and the current liquid level.
- Data Logging: The script logs the date, time, and tank readings to a CSV file. The CSV file serves as a record of the liquid levels over time.
- Schedule: The script uses the schedule library to run the data retrieval and logging task at regular intervals. By default, the task is scheduled to run every 20 seconds, but this interval can be adjusted as needed.
Note: In order to use this script, you need to have the necessary dependencies installed, such as pyads, csv, datetime, schedule, and twilio. Additionally, you need to provide the appropriate account SID, authentication token, and phone numbers for the Twilio service.
How to use the tool
To use the ink weight measurements tool, follow these steps:
- Open the command prompt (CMD) on your computer.
- Navigate to the directory where the tool is located. Use the cd command followed by the path to the tool's directory.
- Once you are in the tool's directory, enter the following command in the command prompt: python.exe ink_weight_measurements.pyw
- Press Enter to execute the command and start the tool.
- Keep the command prompt window open while the tool is running. Do not close it.
- The tool will connect to a programmable logic controller (PLC) and retrieve ink weight measurements from specified tanks.
- It will check if the ink weight falls below a certain threshold and send alert messages if necessary.
- The alert messages will be sent using the Twilio service to designated recipients. The messages will notify them about the low ink weight and may include additional information as configured.
- The tool will continuously monitor the ink weight measurements and perform the necessary actions based on the configured thresholds.
- To stop the tool, you can close the command prompt window or press Ctrl+C in the command prompt.
Please refer to the accompanying readme.doc file for detailed instructions on configuring the tool according to your specific requirements.