How To Scan Barcodes and QR Codes via Your Device's Camera
20 Sep 2022
5 Minutes to read
Contributors
Share this
Print
Share
Contents
How To Scan Barcodes and QR Codes via Your Device's Camera
Updated on 20 Sep 2022
5 Minutes to read
Contributors
Print
Share
Article summary
Did you find this summary helpful?
Thank you for your feedback
Here's how to use Trigger logic to store a barcode value that has been scanned on a camera
Overview
You can use Tulip's "Barcode Scanner" camera under the Camera Widget to allow an operator to scan a barcode with the webcam on their phone, tablet or desktop computer.
Here's where to find it:
In order to successfully use this widget, you need to have three things on the step:
The widget itself. It should be large enough that the operator can see what they are scanning
A Trigger that fires "When" "Barcode Scanner (Optical)" is used.
A Variable embedded on the step so that the operator can see when they successfully scan the barcode
Here's how to set up a Step that accomplishes this.
Adding the Barcode Scanner Camera Widget
Click the Camera widget and choose "Barcode Scanner". Resize the widget to whatever size you prefer- this is the window where the operator will be able to see what they are scanning.
You can only have one Barcode Scanner widget per Step.
After selecting the widget, you will see the following options in the Context Pane:
Here are the supported barcode formats:
EAN-8
EAN-13
Code 39
Code 128
ITF
RSS-14
QR Code
Data Matrix
PDF 417
By default, all of these are turned "on". You can turn "off" individual barcode formats, which will also make it possible for the widget to scan barcodes more quickly.
Storing The Output
Now, you need to create a Trigger that fires when a barcode is successfully scanned.
Create a Trigger on the Step Tab of the Context Pane, and add the following "when" statement:
WHEN "device" "Barcode Scanner (Optical)" outputs at: "this station" with events "Barcode appeared"
Then, add a "Data Manipulation" "store" statement to store the barcode value in a Variable.
Finally, if you want to instantly send the operator to another step when the barcode is stored, add a "Go To Step" Transition.
Setting Up The Step
Here's a possible layout for an app that is meant to run on desktop:
The camera Widget takes up the top half of the screen.
On the bottom half, there are navigation buttons as well as a text label and embedded variable text, so the operator can see the value of the barcode that was just scanned.
Within the Player, users can also "Flip" and "Rotate" the live view from the camera.
Troubleshooting The Camera Barcode Scanner
The conditions at your workstation will impact the amount of time that the app will take to successfully scan a barcode.
Here are some common limitations that will prevent you from successfully scanning barcodes.
Camera Resolution
Does your tablet or phone use a modern, high-resolution camera? Many older devices and laptops have low-resolution cameras.
Lighting
Are you scanning in a well-illuminated area? The camera needs sufficient light to view the contrasts in the barcode.
Testing Procedure
Are you testing with the same camera that will be used in production? If not, you may get misleading results.
Multiple Examples of Text In View
The scanner works best if there is a single barcode in view. If there are other text sections or other barcodes in view, you should try blocking those with your finger.
Flat Paper
If the barcode is printed on wrinkled paper, the scanner will have a hard time reading it.
You can also head to community.tulip.co to post your question or see if others have faced a similar question!
Trigger
Triggers are the mechanism to do things in Tulip Apps. Store data, move users between Steps, Interface with hardware, Etc.
Triggers can be added to widgets, machines, devices, apps, and steps.
Widget
Widgets are the elements that make up a specific App Step. Widgets can display information to users, collect user input, or trigger app logic.
Common widgets include: Interactive Tables, Number inputs, Machine attribute widgets, and more.
Trigger
Triggers are the mechanism to do things in Tulip Apps. Store data, move users between Steps, Interface with hardware, Etc.
Triggers can be added to widgets, machines, devices, apps, and steps.
Variable
Variables are a location to store app information. Variables have a specific type that must match the contents they can store.
Variables are only accessible within a single application and are cleared when the app is restarted or completed.
Step
A view your users will see within an application. Steps can be viewed chronologically or in whatever order best fits your process.
Steps can be grouped into Step Groups to manage and organize your app Steps.
Widget
Widgets are the elements that make up a specific App Step. Widgets can display information to users, collect user input, or trigger app logic.
Common widgets include: Interactive Tables, Number inputs, Machine attribute widgets, and more.
Step
A view your users will see within an application. Steps can be viewed chronologically or in whatever order best fits your process.
Steps can be grouped into Step Groups to manage and organize your app Steps.
Context Pane
The Context Pane is the configuration pane on the right side of the App Editor where steps, apps, and widgets can be configured. Triggers can be added to adjust widget behavior.
Trigger
Triggers are the mechanism to do things in Tulip Apps. Store data, move users between Steps, Interface with hardware, Etc.
Triggers can be added to widgets, machines, devices, apps, and steps.
Trigger
Triggers are the mechanism to do things in Tulip Apps. Store data, move users between Steps, Interface with hardware, Etc.
Triggers can be added to widgets, machines, devices, apps, and steps.
Step Tab
The Step Tab is the Context Pane tab where you will adjust all of the Step-level settings, including Step Triggers, Step background, Step resolution, and more.
Context Pane
The Context Pane is the configuration pane on the right side of the App Editor where steps, apps, and widgets can be configured. Triggers can be added to adjust widget behavior.
Variable
Variables are a location to store app information. Variables have a specific type that must match the contents they can store.
Variables are only accessible within a single application and are cleared when the app is restarted or completed.
Transitions
Transitionsare different operations that can be executed in Triggers. Actions can only move users to other apps, or other steps.
Only 1 Transitioncan be added to a single Trigger.
ex. Complete this app, then go to app x. Move to the next step, etc.
Widget
Widgets are the elements that make up a specific App Step. Widgets can display information to users, collect user input, or trigger app logic.
Common widgets include: Interactive Tables, Number inputs, Machine attribute widgets, and more.
Tulip Player
Tulip Player is the Windows/Mac executable program where users can run Tulip apps. Tulip player allows you to create a more seamless user experience by removing the need for a web browser, and allows increased IT controls.
Was this article helpful?
Thank you for your feedback! Our team will get back to you