Articles in this section

Register stop causes using PLC tags

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

 

Prepare the MQTT Client

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

 

⚠️ 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 submitting a support request.

 

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

Untitled.png

 

Select type MQTT Client. Name the Agent Factbird Event.

Untitled (1).png

In agent properties, configure the following:

Untitled (2).png

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 a string. All values are evaluated as strings. There are two common ways of structuring your stop cause tags.

  • Use a tag that is unique for a specific stop cause. E.g... a tag name could be EmergencyStopBelt1, and the value can be true/false depending on whether the stop cause is present or not.

  • Use a tag whose 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

 

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.

 

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 (3).png

 

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

 

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 on 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

  • Mapping tag is the [Client Id*]-[tag name]*, eg. 12345678abcde-StopsMachine1
  • Value is the value of the tag, which should trigger a stop registration.
  • Stop Cause can be selected from a list of created stop causes.
  • Priority allows to overwrite an already registered stop. Manual registered stops have priority over automatic stops. 1 is the highest priority.
  • Buffer determines the number of seconds a mapping maintains its association before a stop occurs. This is handy when the machine sends a stop code slightly before the counting sensor detects a stop. The buffer should always be the minimum stop duration from stop settings.

 

Untitled (4).png

 

 

Troubleshoot automatic stop registration

When troubleshooting automatic stop cause registration, it can be difficult to observe what causes the issue. Hence, please follow this step guide.

  • Identify the exact timestamp a stop cause registration was triggered. This is often done on the PLC or by monitoring in Kepware. Make sure the timestamp is in UTC.

  • Verify in Factbird that there is an actual stop covering that timestamp identified in step 1. Please remember that the timestamp is in UTC and Factbird is displayed in your local timezone.

    • If Factbird has no stop at the timestamp and there is no stop within the timestamp + buffer it is not supposed to register the stop. You may want to tune your stop finding, see

      Configuring the stops finder

  • Verify that the mapping tag and value match what is sent. Both the mapping tag and value are case sensitive.

  • If none of the above have resolved the issue, please submit a request for additional support, including the mapping tag, value, timestamp, and which sensor this is configured on.

Was this article helpful?
0 out of 0 found this helpful