# Scanner: Zebra Scanner using Perspective App

**URL:** <https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 5, 2024, 7:04am UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461 "2024-12-05T07:04:50Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohit\_Mehar1](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@Rohit\_Mehar1](https://forum.inductiveautomation.com/u/Rohit_Mehar1)\
**Post date:** [December 5, 2024, 7:04am UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/1 "2024-12-05T07:04:50Z")

</div>

I am going to use Zebra Scanner (TC26AK-21A222-) in my project. As its android one, will install Perspective app for Scanning application.

Zebra scanner doesn't have inbuilt camera so I will not be able to use Perspectives "Scan Barcode" action to read the barcode data. So I am wondering how can I get the data into my perspective application. I know that I may need to use Barcode Scanner Input Component.  
Here is what I want to do in my application.

1. Scan the Barcode
2. Concatenate Barcode data with to complete the API link.
3. Read the Data from API and Show it on View/Page using Label component.
4. I don't want to show Barcode data to user but need to use it in scripting to create valid API link.

I read that, Datawedge profile needs to be configure on Zebra scanner(with Keystroke Output/Intent Output)

With my project requirement, I am sure that I need to go with Intent Output, but I don't really know how can achieve this.  
Is anyone here built such application/functionality before who can guide me?

---

<div class="post-metadata">

**Author:** ![VinceV](https://avatars.discourse-cdn.com/v4/letter/v/bb73d2/32.png) [@VinceV](https://forum.inductiveautomation.com/u/VinceV)\
**Post date:** [December 10, 2024, 11:26am UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/2 "2024-12-10T11:26:45Z")

</div>

The Barcode Scanner Input component in Perspective can indeed be used to scan barcodes using the built-in scanner. Simply drag it onto the view. It can even be hidden (`display: false`) and it'll still work fine. We use Datalogic Skorpio X5 barcode scanners in our production environment and we've never really had an issue where something fails to scan.

You'll likely have to use keyboard wedge. One potential issue is that, to know where the barcode starts and ends, the Perspective app looks for a prefix and suffix (we use `{` and `}`). You need to configure these prefixes and suffixes in the settings of every individual scanner.

The component also supports regex (you don't need the prefixes and suffixes in that case) but I have to say that this is rather finicky; you have to very precisely craft the regex, because it is matched to every individual "keystroke". This can lead to problems where only part of the barcode is matched and doesn't work very well if the barcodes don't adhere to some kind of format.

You can then add an `onActionPerformed` event handler to the component and send the input off wherever. Probably a Project Library script in your case.

```py
def runAction(self, event):
	if self.props.data:
		barcode = self.props.data[0]
		# Use barcode to do whatever
```

---

<div class="post-metadata">

**Author:** ![Rohit\_Mehar1](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@Rohit\_Mehar1](https://forum.inductiveautomation.com/u/Rohit_Mehar1)\
**Post date:** [December 10, 2024, 7:20pm UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/3 "2024-12-10T19:20:57Z")

</div>

I have created the Datawedge profile, But I am not sure whether it is correct or not. Also I am not getting any data in the Data property of "Barcode Input Component".  
I have not added anything on "prefix", "suffix" and "regex" property.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 10, 2024, 7:28pm UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/4 "2024-12-10T19:28:28Z")

</div>

The barcode scanner component requires either a regex/window or prefix/suffix configuration to work. I have found the prefix/suffix setup to be the most versatile.

---

<div class="post-metadata">

**Author:** ![Rohit\_Mehar1](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@Rohit\_Mehar1](https://forum.inductiveautomation.com/u/Rohit_Mehar1)\
**Post date:** [December 10, 2024, 7:30pm UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/5 "2024-12-10T19:30:37Z")

</div>

ok. But how can decide what to put in prefix and suffix?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 10, 2024, 7:32pm UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/6 "2024-12-10T19:32:26Z")

</div>

Something that you do not **ever** expect to be in your barcode, like `$`, `|`, `!`, etc.

---

<div class="post-metadata">

**Author:** ![Rohit\_Mehar1](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@Rohit\_Mehar1](https://forum.inductiveautomation.com/u/Rohit_Mehar1)\
**Post date:** [December 10, 2024, 7:34pm UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/7 "2024-12-10T19:34:12Z")

</div>

Adding more to this. We have other application running on same Zebra scanner doing this scanning function and getting the data. Now we want to replace that application with Ignition's perspective.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 10, 2024, 7:38pm UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/8 "2024-12-10T19:38:52Z")

</div>

Once you add a prefix/suffix to the component in Ignition, you must also configure your scanner to append the prefix and suffix characters to the barcode scan. That is

```python
barcode = 1234
# prefix = $ and suffix = ! 
# scanner outputs this in datawedge mode
output = $1234!
# Perspective detects the prefix and suffix and parses it 
scan_data_in_app = 1234

```

---

<div class="post-metadata">

**Author:** ![Rohit\_Mehar1](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@Rohit\_Mehar1](https://forum.inductiveautomation.com/u/Rohit_Mehar1)\
**Post date:** [December 10, 2024, 7:47pm UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/9 "2024-12-10T19:47:53Z")

</div>

Tried this one but still not getting any data. Now, I need to know that Datawedge profile which i created is correct or not? because I am not seeing any log related to that in the gateway.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 10, 2024, 7:53pm UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/10 "2024-12-10T19:53:34Z")

</div>

Usually, the scanner profile app has a test mode. Scan something with a text editor open, or the test mode of the scanner profile and check what is being output.

---

<div class="post-metadata">

**Author:** ![Rohit\_Mehar1](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@Rohit\_Mehar1](https://forum.inductiveautomation.com/u/Rohit_Mehar1)\
**Post date:** [December 10, 2024, 8:27pm UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/11 "2024-12-10T20:27:36Z")

</div>

I don't have Note pad on my device so i can't check that one

---

<div class="post-metadata">

**Author:** ![Rick\_de\_Man](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rick_de_man/32/75670_2.png) [@Rick\_de\_Man](https://forum.inductiveautomation.com/u/Rick_de_Man)\
**Post date:** [December 19, 2024, 8:58pm UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/12 "2024-12-19T20:58:19Z")

</div>

Hi,

I think the following option is not configured correctly,  
Keystroke output \> Key event options \> Send Characters as Events = YES

Did yout also associate the app?  
Applications \> Associated apps \> Add: "com.inductiveautomation.perspectiveapp"  
"…PerspectiveClientActivity"

Let me know if this fixes your problem.

---

<div class="post-metadata">

**Author:** ![Daniel\_Calderon](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@Daniel\_Calderon](https://forum.inductiveautomation.com/u/Daniel_Calderon)\
**Post date:** [April 9, 2025, 9:57pm UTC](https://forum.inductiveautomation.com/t/scanner-zebra-scanner-using-perspective-app/99461/13 "2025-04-09T21:57:25Z")

</div>

Rohit, What version Android does this scanner pc have? No issues running perspective app for android? thanks.
