In the previous months I prepared the PLCnext Technology exhibition wall for the showroom in our Polish Phoenix Contact subsidiary and I would like to show it to the community.
I made the applications with as many technologies as I was able to, that’s why I used MQTT, OPC UA, Node-RED, Google Home etc.
These four example tasks can be demonstrated:
- LEDs lighting up after activating the PLC’s input 0
- Voice message about changing the state of the switches connected to the PLC’s inputs
- Command “Hey Google, blink” causes the LEDs on the panel to change for a moment to the opposite state and return to their original state
- Command “Hey Google, check the state” causes that you can hear a summary of the current state of the PLC’s inputs
And here’s how it looks like:
Front side Back side
Hardware and software used:
- AXC F 2152
- AXL F DI8/1 DO8/1 1H
and on the PLC’s Linux:
- node.js
- node-red
- node-red-contrib-google-home-notify – google mini voice messages
- node-red-contrib-opcua – OPC-UA communication
- node-red-admin – Node-RED security
- pm2 – node-red autostart
- Raspberry Pi
The Mosqitto application is running on the Pi, which acts as an MQTT broker.
- Google Home Mini speaker
- Sonoff Wifi Relay
Sonoff relay equipped with AFE firmware Firmware, which adds, among other things, the MQTT communication client.
- Router with Wifi access point and GSM modem
The router creates a Wifi network for all equipment and the GSM modem for Internet connection
Task 1: LEDs lighting up after activating the PLC’s input 0
Concept
- Switching on the “input 0” switch gives a signal to the PLC’s digital input.
- The program in the FBD language writes the state of the input to the xLight variable, which is shared by the OPC UA server running on the controller.
- Node-RED running on the PLC’s Linux asks the OPC UA server about the state of the variables every second.
If the xLight variable changes its value, Node-RED sends a MQTT message to the broker (running on Raspberry Pi). - MQTT client running on Sonoff Wifi Relay reads the MQTT broker state and turns on or turns off the LEDs on the panel.
Staging
see below: Task 1 & 2 combined
Task 2: Voice message about changing the state of the switches connected to the PLC’s inputs
Concept
- The change of state of one of the three switches gives a signal to the appropriate input of the controller.
- The FBD language program writes the states of inputs to the corresponding variables provided by the OPC UA server.
- Node-Red asks the OPC UA server every second about the state of the variables.
If a change is detected, it is interpreted by Node-Red flow and google-notify module.
The corresponding message is sent to the Google Home Mini to be read.
Staging
(Task 1 & 2 combined)
Task 3: Command “Hey Google, blink” causes the LEDs on the panel to change for a moment to the opposite state and return to their original state
Concept
- The query is interpreted by the IFTTT service and its result is sent to Node-RED.
- Node-RED via OPC UA sends information to the FBD program, which blinks the LEDs in the same way as described at Task 1.
Staging
Task 4: Command “Hey Google, check the state” causes that you can hear a summary of the current state of the PLC’s inputs
Concept
- The query is interpreted by the IFTTT service and its result is sent to Node-RED.
- Node-RED processes this information in a similar way as described at Task 2.
Leave a Reply
You must be logged in to post a comment.