JavaScript Breaks Data Out From Bar(codes) img


Well-known programming language is overlooked data parsing tool

This guest column by Code Corp Firmware Engineering Manager, Steve Pierce, appeared in Data Collection Online, a specialty publication, on May 19th. Data Collection Online is a growing and respected voice within the barcoding and AIDC industry; explore it here

Since springing from a line drawn on the sand of a Miami beach, the humble barcode has corralled the world’s mission-critical data within blocks and bars to serve humanity. For instance, barcodes are long-proven to reduce medication administration errors by up to 85%, prompting the FDA to mandate them nearly 20 years ago.

JavaScript enables Code’s barcode scanners to parse data upon scan.

There are now 40 barcode types (also called symbologies) holding anywhere from 2,000–7,089 characters of vital info like manufacture date. This diversity and complexity make data-parsing devices key to the kingdom.

“The more data that’s encoded in my barcode, for me to use that data, I need a way to parse, sort, and contextualize it,” explains Vernon Witney, solutions architect at Code Corporation.

A Deluge of Data
Indeed, the supermarket’s ubiquitous 1D linear barcode no longer meets today’s demands. Tightening regulations, production advancements of Industry 4.0, and the need for near-instant decision-making have industries flocking to 2D barcodes. These symbologies stack data horizontally and vertically, limiting the physical space barcodes need. To standardize formatting for the data that protects people, places, things, and the bottom line, GS1, the global barcode authority, has created 500+ Application Identifiers (AIs). Predictably, AIs are diverse; examples include NATO Stock Numbers, harvest date, and catch area.

“Take Transport AIs, like net weight, for example,” Witney says. “In scanning a barcode with a description of goods into a host system, I can see immediately how heavy a package is, and I can make a business decision based on that weight.”

So, how do firms cope with this deluge of data?

“The root to using all that data is data parsing,” Witney explains. “You can’t just have one long data string without any order or sense.”

At its most basic, data parsing is extracting relevant data from a source (e.g., barcode) and converting it into a useable format. A common example is scanning a driver’s license when selling tobacco products. Another familiar one is applying for in-store credit or enrolling in a store loyalty program. A quick scan of the barcode on a government-issued ID can extract basic info and automatically populate parts of an online application to expedite application.

And thanks to JavaScript, an often-overlooked programming language, data parsing isn’t time-consuming or resource-intensive. This open-source language is known for making websites interactive and online forms auto-fill compatible, and it gives intrepid device makers an edge.

A Trio of Data-Parsing Options
Demands for data have entrenched barcode scanners on the front lines of data capture. And while every firm making barcode scanners faces the same demands, the industry splits on meeting these specific requests. Most barcode scanner OEMs, Witney says, address data parsing by revising their devices’ proprietary firmware upon customer request. A small minority, such as Code Corp., offer JavaScript-based barcode readers that parse data. Lastly, an even smaller group of end-users opt for mobile devices and app developers.

Code’s AIDC devices uniquely use JavaScript for data parsing. 

To parse barcodes for specifics, such as UN/ECE meat carcasses and cuts classifications, firms typically ask manufacturers to create custom firmware that is hardcoded into a barcode scanner. However, this process is lengthy and costly because it diverts engineers from R&D.

“I’ve worked at places where we’d require a volume of 1,000 devices for custom data-parsing firmware,” Witney explains. “And if it’s not precisely what the customer wants, we have to go down that path again. $100K is not uncommon for customization.”

Firmware changes can take months. However, much like a shot of espresso, JavaScript programming speeds things up.

“It could take months to customize device firmware,” Witney adds. “With a JavaScript-based device, I can make changes in two minutes by creating a new JavaScript rule. Deployment occurs in hours because an end-user simply scans a special QR barcode that I’ve encoded with the new JavaScript; scanning uploads it to their Code devices.”

A bonus, Witney says, is that JavaScript rule creation is free because it involves coding changes—not a firmware engineer who has to create, test, and refine. Moreover, Witney said, many customers can usually get it done in-house once they realize their Code barcode readers use JavaScript.

“Most anyone worth their salt in programming knows JavaScript,” Witney adds. “The foundation is already there, and some users are surprised to learn they can do it themselves because JavaScript is not proprietary to Code.”

On the far end of the spectrum, some end-users opt for mobile, camera-equipped Android or iOS devices for basic barcode scanning. Third-party developers then create a bespoke data-parsing application. Although fast, shortcuts like this aren’t cost-effective.

Locking Down Data Parsing?
If JavaScript makes data parsing faster, cheaper, and easier, why is it only found on a few advanced barcode scanners?

“As barcode scanners are developed, each one is usually an iteration of what came before it—they’re improvements, but have the same core,” Witney theorizes. “You can’t just throw 40 years of development out the window; it’s expensive to do that.”

He also added that there hasn’t been a strong need for new data capture approaches, but tightening traceability and authentication guidelines are forcing changes right now.

“Traditionally, it’s been all about capturing up to 40 digits and transmitting them—that’s it,” Witney explains. “Many times, it’s even been a lot less like focusing on [a UPC’s] 13 digits in retail.”

JavaScript makes Code’s devices scalable.

However, shifting to data-rich 2D barcodes may prompt broader JavaScript adoption—particularly among OEMs supporting retailers and hospitals. By 2027, retailers will have fully switched to data-dense 2D barcodes that better suit shifting supply chain needs and ever-evolving mandates. These changes make data parsing via JavaScript even more appealing because a few lines of new code give existing devices greater versatility, saving costs.

“One of the key benefits is that JavaScript-based devices grow with firms’ requirements; today, they may only need to scan 1D codes, but what happens when a manufacturer must encode more data about a product?” Witney asks. “As your data requirements change, we just change the barcode reader’s JavaScript rules—end-users don’t have to throw away their scanners and start again.”

Witney reports that hospitals in the UK are requesting data parsing so that their barcode readers only pull out pertinent info (e.g., drug batch number) from a package bearing several 1D and 2D barcodes. JavaScript, in this instance, makes data capture a point-and-shoot affair for harried nurses.

“With JavaScript, you create a rule to get the same data out no matter which barcode you scan,” Witney explains. “Whatever the nurses scan doesn’t matter, they’ll transmit the right data into their system and get on with doing what they do best.”

Similarly, data parsing at the point-of-sale prevents UK shopkeepers from breaking laws by selling expired goods.

“If you can catch that at point of sale with a 2D barcode, you’ll be compliant, and compliance has a value as well.” Witney states.

Value, Witney says, is ultimately what data parsing via JavaScript brings to the table.

“When you add JavaScript to a barcode reader, you’re encroaching into the realm of a smartphone without the cost,” Witney summarizes. “Suddenly, JavaScript gives devices new functionality, and the end-users new ways to process data—that’s powerful.”

About the Author
Steve Pierce is the Firmware Engineering Manager of Code Corporation. Code is an industry pioneer, leader, and champion for barcode and data capture innovation. It designs and manufactures a complete line of market-leading hardware and software data capture solutions. For more, visit www.codecorp.com.

Share this Post

Recent Posts