From 75bd73be687c3d8cfa2492aaeb6d908d29050ae8 Mon Sep 17 00:00:00 2001 From: Miguel Date: Thu, 17 Jul 2025 12:30:51 +0200 Subject: [PATCH] Adaptado Memoria de Evolucion --- .cursor/rules/reglas.mdc | 6 ++++++ .doc/MemoriaDeEvolucion.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .cursor/rules/reglas.mdc create mode 100644 .doc/MemoriaDeEvolucion.md diff --git a/.cursor/rules/reglas.mdc b/.cursor/rules/reglas.mdc new file mode 100644 index 0000000..23bfabf --- /dev/null +++ b/.cursor/rules/reglas.mdc @@ -0,0 +1,6 @@ +--- +alwaysApply: true +--- +You can use .doc\MemoriaDeEvolucion.md to obtain a context of the latest modifications and concepts about this project. I would like that with the important knowledge and important decisions acquired in each modification you add them to MemoriaDeEvolucion.md maintaining the style that we already have of simple text without too much code and a summarized semantic. + +The aplication comments and variables must be in english. \ No newline at end of file diff --git a/.doc/MemoriaDeEvolucion.md b/.doc/MemoriaDeEvolucion.md new file mode 100644 index 0000000..0537fa6 --- /dev/null +++ b/.doc/MemoriaDeEvolucion.md @@ -0,0 +1,32 @@ +### Objective +Create a python script with flask to do logging and do streaming to plotjuggler of live data from a PLC S7-315 of Siemens. The web gui must allow me to configure the connection data with the PLC and activate the connection. Then Also it must allow me to configure the UDP gateway for doing streaming to PlotJuggler. Also it must allow to create the list of variables to do polling to the PLC. + +### Application Description + +**PLC S7-315 Streamer & Logger** is a web application developed in Python with Flask that enables real-time communication with Siemens S7-315 PLCs for data acquisition, logging, and streaming. + +#### Main Features: + +1. **PLC Connection**: Configuration and management of TCP/IP connections with S7-315 PLCs using the snap7 library +2. **Variable Management**: Dynamic configuration of variables for polling (real, int, bool, dint) with DB, offset, and type specification +3. **UDP Streaming**: Real-time data transmission to PlotJuggler via UDP with timestamped JSON format +4. **Logging**: Automatic data logging to local file with high-precision timestamps +5. **Web Interface**: Complete control panel for system configuration and status monitoring + +#### Technical Architecture: + +- **Backend**: Flask with threading for asynchronous streaming +- **PLC Communication**: snap7 client for S7 protocol +- **Streaming**: UDP socket for PlotJuggler transmission +- **Logging**: Python logging system with persistent file +- **Frontend**: HTML/CSS/JavaScript for user interface + +#### Operation Flow: + +1. PLC parameter configuration (IP, rack, slot) +2. UDP destination configuration (host, port) +3. Variable definition for monitoring +4. PLC connection and validation +5. Streaming start with configurable interval +6. Continuous data transmission to PlotJuggler and local logging +