<aside> đź’ˇ THE STARTING POINT

WAGO - OPC UA.json

</aside>


  1. Implement the timestamp node to ask for the WAGO values once every second.

    Untitled

  2. The build all the functions according to the flow above w.r.t. the following picture and connect them all to the OPC UA Client

    Untitled

  3. Connected to the OPC UA you need a function for clearing null values again and defining the different topics:

    var payload = msg.payload
    msg.payload ={}
    
    if (payload === null) {
        msg.payload[msg.browseName] = 0;
        msg.payload["timestamp_ms"] = Date.now();
    } else {
        msg.payload[msg.browseName] = payload;
        msg.payload["timestamp_ms"] = Date.now();
    }
    
    msg.topic='ia/raw/dccaachen/warping/'+msg.browseName
    
    return msg;
    
  4. To finalize just another simple MQTT-OUT node is necessary.

    Untitled

<aside> 💡 This is just the basic flow. You may need some extras like hysterises or filters on value changes. Also you may need the “kill flow” to restart PLCs in case they can’t connect.

Kill flow for OPC UA.json

</aside>