Industrielle styresystemer - Wiki
...
After adding either, the topic must be set.
...
...
Topic | Datatype | Typical Values | Publisher | Description |
---|---|---|---|---|
/status | bool | 1 |
...
Setting up a WAGO PFC200 PLC requires some configuration.
The Wago is now configured to send MQTT data to the broker correctly.
To use MQTT with CODESYS, the WagoAppCloud library must be imported to the project. This can be done by:
A function block can then be created to simplify the use of the library:
Code Source: https://www.youtube.com/watch?v=UnhG15JFjao&t=822s&ab_channel=JugaadTech
This block can simply be added in a program like this:
Whenever the trigger gets a rising edge, it will publish the message to the broker.
/status | bool | PLC | Should be published at the start of every update so CDP can detect loss of connection. Value should always be 1. |
...
Topic | Datatype | Typical Range | Publisher | Description |
---|---|---|---|---|
/sensor/water/ec | float | 0-30 | PLC | Water EC measurement. |
/sensor/water/ph | float | 5-7 | PLC | Water PH measurement. |
/sensor/water/temp | float | 10-40 | PLC | Water temperature measurement. |
/sensor/air/temp | float | ? | PLC | Air temperature measurement. |
/sensor/air/humidity | float | ? | PLC | Air humidity measurement. |
/sensor/air/co2 | float | ? | PLC | Air CO2 measurement. |
Topic | Datatype | Typical Range | Publisher | Description |
---|---|---|---|---|
'/state/valve/tank1/ebb' | bool | 0, 1, 2 | PLC | Light state, 0 Tank 1 drain/ebb valve state. 0 = auto, 1 = off, 1 2 = on. |
'/state/valve/tank2/ebb' | bool | 0, 1, 2 | PLC | Light Tank2 drain/ebb valve state. 0 = auto, 1 = off, 1 2 = on |
'/state/valve/tank1/flow' | bool | 0, 1, 2float | PLCTime | until light 1 toggles on or off, given in hours.Tank1 fill/flow valve state. 0 = auto, 1 = off, 2 = on |
'/state/valve/tank2/flow' | bool | 0, 1, 2float | PLCTime until light 2 toggles on or off, given in hours. | Tank2 fill/flow valve state. 0 = auto, 1 = off, 2 = on |
'/state/valve/threeway' | bool | 0, 1, 2 | PLC | Three-way valve state. 0 = auto, 1 = to reservoir (stirring), 2 = to tank1/2 |
'/state/pump' | bool | 0, 1, 2 | PLC | Pump state. 0 = auto, 1 = off, 2 = on |
Topic | Datatype | Typical Range | Publisher | Description |
---|---|---|---|---|
/system/light1/state | bool | 0, 1 | PLC | Light state, 0 = off, 1 = on. |
/system/light2/state | bool | 0, 1 | PLC | Light state. 0 = off, 1 = on |
/system/light1/timeRemaining | float | 0-24 | PLC | Time until light 1 toggles on or off, given in hours. |
/system/light2/timeRemaining | float | 0-24 | PLC | Time until light 2 toggles on or off, given in hours. |
/system/tank1/state | bool | 0, 1 | PLC | Tank 1 current state. 0 = ebb, 1 = flow |
/system/tank2/state | bool | 0, 1 | PLC | Tank 2 current state. 0 = ebb, 1 = flow |
/system/tank1/timeRemaining | boolfloat | 0, 1-24 | PLC | Time remaining of tank 1 state. Given in hours. |
/system/tank2/timeRemaining | boolfloat | 0, 1-24 | PLC | Time remaining of tank 2 state. Given in hours. |