Stop causes can be registered automatically based on a PLC tag. In this example we use Kepware but it can be any other service which provides data using the MQTT interface.

Prepare the MQTT Client

To prepare this feature we must configure an MQTT client which can publish to the topic “plc/event/[Client Id]”, where Client ID is replaced with the client id. Eg. “plc/event/12345678abcde”.

<aside> ⚠️ Kepware IoT Gateway has a limitation that it cannot share the client between two topics. Hence the Client ID needs to be unique for “plc/input/[client id]” and for “plc/event/[client id]”. Other system which can publish using the same client do not need this. Client ID is provided by [email protected] on request.

</aside>

In Kepware this is done by adding a new MQTT Agent.

Untitled

Select type MQTT Client. Name the Agent Factbird Event.

Untitled

In agent properties configure following:

Untitled

Identify stop cause tags

Once the agent is configured we are ready to identify the stop cause tags. A stop cause tag can either be a boolean, number or string. All values are evaluated as strings. There are two common ways of structuring your stop cause tags.

  1. Use a tag which is unique for a specific stop cause. Eg. a tag name could be EmergencyStopBelt1 and the value can be true/false depending on weather the stop cause is present or not.

  2. Use a tag which values are unique for a specific stop cause. Eg. a tag name could be StopsMachine1 and the values would have a lookup table to correlate to a stop cause.

    Tag name Value Stop Cause
    StopsMachine1 error1 No Power on belt
    StopsMachine1 error2 Door is open
    StopsMachine1 3 Emergency Stop

<aside> 💡 When planning large scale implementations in kepware be aware that the IoT Gateway is limited to max 500 tags per Agent. Hence option 2 scales much better when dealing with many tags per Kepware installation.

</aside>

Now add the tag or tags that represent a stop cause event to the IoT Gateway Agent.

Ensure that Publish is set to “Only on Data Change”.

Untitled

<aside> ⚠️ Forgetting to set Publish is set to “Only on Data Change” for event signals can incur a significant cost.

</aside>

Map tags to stop causes in Factbird

Create the stop causes in Factbird that you want to map the tag to. See Add new stop causes and categories.

Next navigate to Sensor Settings for the sensor which you want to register stops on. In sensor settings click on left menu Stops Mapping.

Here you can configure the mapping between event tags and stop causes.j