Trigger Logic Sequence

I have an application where I am scanning a barcode and then storing it into a variable. I have four separate triggers that are happening when the barcode scanner outputs. The first trigger I have in my sequence checks to see if the format of the barcode scanned is correct to prevent from scanning an incorrect barcode.

This first trigger logic is the following:
When the device Barcode Scanner outputs at this station:

  1. If Device Output data starts with Static value “E”
  • Then store device output data into Variable
  1. Else If
  • Then show Error Static value Text

I have this same logic on the first trigger of barcode scanner inputs on 4 different steps. In all of them except this first step, the app kicks out the barcode correctly when the format is incorrect. In this first step, however, the steps continues through the logic even though the format is incorrect.

I am curious why this is, and if there is something happening here that I am missing?

Thanks for the help in advance

Screenshots?

I have started to use a step transition after my error messages to return me to the same step, as a way to escape the rest of the device output trigger stack.

Thanks for posting, it sounds like the first step ignores bad barcodes.

Most misses here come from hidden characters at the front of each scan. Tulip reads those, so “E123” might really be “⏎E123” and the IF test thinks the code does not start with E. Fixing that and forcing the step to stay put usually solves the issue.

  1. Drop a Text widget bound to Device Output. Scan and watch the raw string.
  2. In the trigger, wrap Device Output with TRIM().
  3. Use IF LEFT(TRIM(Device Output), 1) = “E” then store variable.
  4. In the Else, Show Error then Return to This Step.
  5. Keep this trigger first and remove other barcode triggers on this step.

TRIM clears hidden codes, LEFT checks the true first character, and the Return action blocks the step from advancing. Tulip expression docs list both TRIM and LEFT: Doc1, Doc2

Let me know if that clears it up.