Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CspmIT/mas-agua-front/llms.txt

Use this file to discover all available pages before exploring further.

Overview

PLC Profiles define connections to Siemens programmable logic controllers (LOGO 7, LOGO 8, S7-1200) and map PLC memory bytes and bits to InfluxDB fields.

Accessing PLC Configuration

Navigate to Configuration > Perfil PLC to manage PLC profiles.

Supported PLC Models

LOGO 7

Siemens LOGO! 7 series

LOGO 8

Siemens LOGO! 8 series

S7-1200

Siemens S7-1200 series

Creating a PLC Profile

1

Open PLC Modal

Click Crear Perfil de PLC to open the configuration form.
2

Configure Basic Settings

topic
string
required
MQTT topic for publishing PLC data (minimum 3 characters)
influx
select
required
Target InfluxDB bucket:
  • Sensors_Morteros_Interna - Mas Agua Morteros
  • Sensors_Externos - Mas Agua Externos
  • externos - Energia Externos
3

Configure PLC Connection

PLCModel
select
required
PLC model:
  • LOGO_7 - Siemens LOGO! 7
  • LOGO_8 - Siemens LOGO! 8
  • S7_1200 - Siemens S7-1200
ip
string
required
PLC IP address (valid IPv4 format, e.g., “192.168.1.100”)
serviceName
string
required
Service name (single word, no spaces, minimum 3 characters)
rack
number
required
PLC rack number (positive integer)
slot
number
required
PLC slot number (positive integer)
4

Define Memory Points

Specify byte ranges to read from PLC memory:
  1. Enter Inicio (start byte)
  2. Enter Fin (end byte)
  3. Click Agregar puntos
  4. Repeat to add multiple ranges
Example: Points {0, 10} and {20, 25} will read bytes 0-10 and 20-25.
5

Map Variables to Bits

For each variable:
byte
select
required
Byte number (from configured point ranges)
bit
select
required
Bit position (0-7) within the byte
type
select
required
Data type:
  • BOOL - Boolean (1 bit)
  • BYTE - Unsigned byte (8 bits)
  • INT - Signed integer (16 bits)
  • UINT - Unsigned integer (16 bits)
  • FLOAT - Floating point (32 bits)
  • STRING - String data
  • LONG - Signed long (32 bits)
  • ULONG - Unsigned long (32 bits)
  • DOUBLE - Double precision (64 bits)
field
string
required
InfluxDB field name for this variable
6

Save Profile

Click Crear perfil to save the configuration.

Example Configuration

{
  "topic": "plc/water_treatment",
  "influx": "Sensors_Morteros_Interna",
  "PLCModel": "S7_1200",
  "ip": "192.168.1.50",
  "serviceName": "WaterTreatmentPLC",
  "rack": 0,
  "slot": 1,
  "points": [
    {"startPoint": 0, "endPoint": 10},
    {"startPoint": 20, "endPoint": 25}
  ],
  "vars": [
    {
      "byte": 0,
      "bit": 0,
      "type": "BOOL",
      "field": "pump_running"
    },
    {
      "byte": 2,
      "bit": 0,
      "type": "FLOAT",
      "field": "pressure"
    },
    {
      "byte": 6,
      "bit": 0,
      "type": "INT",
      "field": "flow_rate"
    }
  ]
}

Profile Status Management

PLC profiles have three states:

Status 0: Inactive

  • Profile configured but not collecting data
  • Can be edited or deleted
  • Toggle switch to activate

Status 1: Active

  • Profile actively reading PLC data and reporting to InfluxDB
  • Cannot be edited or deleted (must deactivate first)
  • Toggle switch to deactivate

Status 2: Pending Upload

  • Profile created but service files not uploaded to server
  • Click Subir to complete deployment

Managing Profiles

Activate Profile

Activating a profile starts data collection and InfluxDB reporting immediately.
  1. Locate profile with Status = Inactive
  2. Click the status toggle switch
  3. Confirm activation

Deactivate Profile

Deactivating stops data collection from the PLC.
  1. Locate active profile
  2. Click the status toggle switch
  3. Confirm deactivation

Edit Profile

  1. Ensure profile is inactive (Status = 0)
  2. Click Editar button
  3. Modify configuration
  4. Click Editar perfil
Active profiles must be deactivated before editing.

Delete Profile

  1. Ensure profile is inactive
  2. Click Eliminar button
  3. Confirm deletion
You cannot delete active profiles. Deactivate first.

Validation Rules

The form enforces these validation rules (from src/modules/ProfilePLC/schemas/varsPLC.js:17):
topic
  • Minimum 3 characters
  • Must be string
influx
  • Must be one of: Sensors_Morteros_Interna, Sensors_Externos, externos
PLCModel
  • Must be one of: LOGO_7, LOGO_8, S7_1200
ip
  • Must be valid IPv4 address (regex validated)
  • Example: 192.168.1.100
serviceName
  • Minimum 3 characters
  • Single word (no spaces)
  • Alphanumeric characters only
rack
  • Positive integer
  • Numeric value required
slot
  • Positive integer
  • Numeric value required
points
  • startPoint must be ≤ endPoint
  • Both must be positive integers

Byte and Bit Allocation

Constraints

  • Maximum bits available = (total bytes in ranges) × 8
  • Each byte has 8 bits (0-7)
  • Bit positions within a byte cannot be reused

Bit Availability

The interface shows only available bits for each byte:
// Byte 5 with bits 0, 2, 4 already used
// Available bits: 1, 3, 5, 6, 7
If all bits in all bytes are allocated, the Agregar variable button becomes disabled.

API Endpoints

EndpointMethodPurpose
/plc/createPOSTCreate new PLC profile
/plc/editPOSTUpdate existing profile
/plc/listGETGet all profiles
/plc/service/:idGETGet specific profile details
/plc/activate/:idGETActivate profile
/plc/deactivate/:idGETDeactivate profile
/plc/delete/:idGETDelete profile files

Troubleshooting

  • Verify PLC IP address is reachable
  • Check rack and slot numbers match PLC hardware
  • Ensure firewall allows connection on required ports
  • Verify profile status is Active (Status = 1)
  • Check correct InfluxDB bucket is selected
  • Validate topic and field names
  • Profile must be deactivated first
  • Check profile status in the table

See Also

  • Variables - Create variables from PLC data
  • Alarms - Set alerts on PLC values

Build docs developers (and LLMs) love