Scanner: Zebra Scanner using Perspective App

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?

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.

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

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.

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.

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

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

1 Like

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.

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

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

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.

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.

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

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.