In this article, you will learn:

  • How to use machine triggers to change state of the machine
  • The full list of actions that you can use in Machine Triggers

Once you have set up attributes and machine types, you are ready to update the history of a machine based on the value of OPC fields.

In other words, you will want to create a history like this for every machine:

This guide will show you how to build the history above. In the machine history, every row in the table is defined by a change in state of the machine. You can see the different states on the far left column.

Here is how the data flows into machine triggers:

  1. An OPC field shares an output
  2. That output is mapped to an attribute on the page for that individual machine
  3. The attribute is used in machine trigger logic

Updating the State of the Machine

On the page for each individual Machine Type, you can define multiple Machine Triggers that will update the state of the machine (or any field).

Here's an example of machine states for one type of machine:

To create a machine trigger, click the "+" sign in the top right of the "Machine Triggers" section.

Then, you will need to add an "If" statement to define when the state should be updated. There are two types of "if" statements:

  1. Based on the value of the last output from a specific OPC field
  2. Time-based i.e. "in the last 5 seconds"

Here's an example of the first condition:

IF

  • "Machine Attributes" "spindle" ">" "Static Value" "Number" "100" "since last output"

THEN

  • "Set Activity History" field: "State" value: "Enum" "Running"

For every machine that has this type, this trigger will look at the last value of an OPC field that is tied to the "spindle" attribute. If that value is greater than 100, the machine will enter the "Running" state (or continue being in that state)

Here's an example that uses timing:

IF

  • "Machine Attributes" "spindle" ">" "Static Value" "Number" "100" "in last" "30 seconds"

THEN

  • "Set Activity History" field: "State" value: "Enum" "Running"

In the last 30 seconds, if the spindle value was ever greater than 100, then the machine state will change to "Running". 

This trigger is evaluated every second. Within a second of the value rising above 100, the machine state will change to "Running" and stay there until 30 consecutive seconds pass without a value greater than 100 (30 consecutive values)

Changing The Value of a Field (ie Defect Count, Part Count)

By changing the state, you automatically add a new row to the Activity History for each machine. But, you can also update each individual field for the machine and group it with that particular status.

For example, you might have a machine trigger that updates the machine status between "Running", "Idle" and "Stopped". 

Then, you might have a separate trigger that updates the "Part Count" when an OPC field changes its value.

You can update the "Part Count" field just like you might update a variable in the Trigger Editor in the App Builder.

Here are the different fields you can update:

  • State
  • Downtime Reason
  • Program
  • Ideal Run Rate
  • Defect Count
  • Part Count

These fields are automatically updated:

  • Start Time
  • End Time
  • Duration

There are two actions in a machine trigger that can update these fields:

  • Set Activity History: Similar to "Data Manipulation "Store" in the Trigger Editor. Set the value of any field.
  • Increment Field: Similar to "Data Manipulation" "Increment Value" from the Trigger Editor. Increase a numerical field.

In the following example, "part_counter" is a boolean attribute that would be updated when the machine finished a part and updated the resulting OPC field.

IF

  • "Machine Attributes" "part_counter" "Is True" "since last output"

THEN

  • "Increment Field" field: "Part Count" value: "Integer" "1"

This would update the "Part Count" field for the current status that the machine is in and it would be immediately reflected in the Activity History.

Technical Details of Machine Triggers

These are the options for "Downtime Reason":

  • Maintenance
  • No Operator
  • Setup
  • Material
  • Changeover
  • On Break
  • On Lunch
  • Team Meeting
  • Tooling
  • Other

Further Reading

Did this answer your question?