This article will show you some examples of common ways to use Triggers in Tulip. This assumes you already have a solid understanding of what Triggers are and the role they play in manufacturing apps.

If not, we recommend taking a minute to review, "What are Triggers?"

You should also read the overview of variables.

1. Save barcode and auto advance to the next step

This is often used in the first step of an app beginning with work instructions or quality checks. 

By starting the app with this step, you can associate additional information like quality inspection results with this barcode when an operator completes the app. 

WHEN

  • "Device" "Barcode Scanner" outputs at "this station"

THEN

  • "Data Manipulation" "Store" data: "Device output" "data" location: "barcode"
  • "Go To Step" "Next"

2. Check before Advancing Steps

In this trigger, the operator cannot continue onto the next step unless a condition is met. 

In the example below, the only way the operator can advance is if the scanned barcode is 7 digits long. 

If it is not, the app will stay on the same step and show an error message. This could be useful as a poka-yoke for the desired barcode. For example, you could use it when a work order ID is always 7 digits but it's located next to other barcodes that are different lengths.  

WHEN

  • "Device" "Barcode Scanner" outputs at "this station"

IF

  • "Device Output" "data" "Matches Regular Expression" "Static Value" "text" "^\d(7)$

THEN

  • "Data Manipulation" "Store" data: "device output" "data" location: "barcode"
  • "Go To Step" "Next"

ELSE 

THEN

  • "Show Error" "Static Value" "text" (message)

3. Run Connector Function to an External Database

When an event occurs (button pressed, step opened, barcode scanned, etc.) you can send data in the app to an external database using a connector function. Or, you can retrieve data from an external database with a connector function.

In the example below, the Order Details, such as a shipping address, are retrieved from an external database based on the Order Number that was scanned from the barcode scanner. Notice that the trigger also auto-advances to the next step after the barcode is scanned.

WHEN

  • "Device" "Barcode Scanner" outputs at "this station"

THEN

  • "Run Connector Function" connector: "Example Database" "Order Lookup Multiline" barcode: "Device Output" "data" and save result as: "Variable" (your variable here)
  • "Go To Step" "Next"

4. Using a footpedal to advance to Next Step

The goal of Tulip is to seamlessly collect data behind the scenes of apps that currently exist. 

Clicking a ‘Next Step’ button on a touchscreen is often cumbersome and adds time to an operator's workflow. Using a footpedal is a simple way to trigger an action in an app while keeping both hands free.

WHEN

  • "Device" "Footpedal" outputs at "this station"

THEN

  • "Go To Step" "Next"

5. Use Buttons to Navigate Steps

The App Builder has default buttons for Previous & Next, but you can create your own buttons that can prompt the user to navigate to any step in the app. For instance, you can name the button ‘Report Defect’ and then add a trigger to go to a specific step when it is pressed.

WHEN "button is pressed"

THEN

  • "Go To Step" "Defect Report"

6. Use Buttons to Store Variables

Adding onto the trigger shown in #5, you can store a variable whenever the button is pressed. For example, the "num" variable will increment by 1 every time the button is pressed. You can later use this number in Analytics.

WHEN "button is pressed"

THEN

  • "Data Manipulation" "Increment Value" value: "num" by: "Static Value" "integer" "1"
  • "Go To Step" "Report Weight Out of Range"

7. Send SMS Alert

A "request help" button is frequently used to give the operators a way to call for help to their supervisor or engineer with a click of a button. 

Pro tip: Use the @ symbol to incorporate values of variables into the alert to give the person more information about what’s going on!

WHEN "button is pressed"

THEN

  • "Send SMS" to (person name) message: "Static Value" "text" (your text here)

8. Send Email alerts

For alerts that don’t require immediate action, users can opt to send an email instead. See the modification below:

THEN

  • "Send Email" to (person name) message: "Static Value" "text" (your text here)

9. Turn on GPIO outputs from the Tulip gateway 

You can use Triggers to set an output on a connected GPIO device.

In the example below, when the button is pressed to Report Defect, it also going to turn on the red light on the andon light to indicate there is an issue at the workstation. The red light is connected to pin #1.

WHEN "button is pressed"

THEN

  • "Run Gateway Function" "GPIO" "Set Digital Output" at "this station" on pin: "Static Value" "integer" "1" to state: "Static Value" "boolean" "yes"
  • "Go To Step" "QA Form"

10. Trigger action based on GPIO pin up (e.g. break beam status change)

Tulip can also listen to GPIO signals and respond based on a change in state. 

For example, let's say that a break bream is connected to the IoT Gateway and is used to control a conveyor belt. The steps can change automatically based on when a product passes through the beam.

 WHEN

  • "device" "GPIO" outputs at "this station" with event: "Pin up"

IF

  • "Device Output" "pin" = "Static Value" "integer" "1"

THEN

  • "Go To Step" "Next"
Did this answer your question?