The Auto ID Book: Programming

PROGRAMMING

Languages
Most manufacturers are moving away from proprietary programming languages and are now supporting a more open architecture. BASIC, PASCAL, and C/C++ are the most commonly supported languages now available. Each language has it's own strength and weaknesses as discussed below.

BASIC is probably the easiest language to program in, but it is not a portable language. In addition, most BASIC software packages do not compile and are usually interpreted. This means that most BASIC programs will run slower than compiled programs such as C/C++. BASIC is a fairly robust programming language, but when it comes to manipulating digits within a byte (8 bit string) or word (16 bit string), it becomes very difficult. For the most part, BASIC is a rapid prototyping language and is very good for general purpose applications. If the development cycle must be short, BASIC is the best contender. In fact, most proprietary languages are modeled after BASIC because of the simplicity in programming and rapid development time.

PASCAL is usually a compiled language, but it is not portable. PASCAL looks like a combination between BASIC and C. PASCAL is also a structured language and, therefore, appears to be an outline to the casual observer. A few manufacturers support this language but most now support C/C++.

C/C++ is by far the most common, everyday programming language. Most manufacturers now support C/C++ functions and libraries to be imbedded within the programmer's code. As previously mentioned, C/C++ is a compiled language, and therefore, runs extremely fast. C/C++ is also portable and can be run on most platforms with different compilers. Of all common programming languages, C/C++ provides the greatest flexibility for almost any complex operation. However, the development time for most C/C++ applications is the most extensive.

Most users are now moving from DOS to Windows applications. With Windows, there two major development languages that could be employed: Visual Basic and Visual C/C++. Since the demand for Windows applications is increasing, many manufacturers are beginning to support custom controls and Dynamic Link Libraries (DLL) for developers to easily access a manufacturer's development routines.

Both Visual Basic and Visual C/C++ shorten the Windows development cycle immensely. Currently, Visual Basic does not compile and, therefore, does run slower. However, as processor speeds increase, the "slowness" will become less apparent to the end user. Most applications can be developed in a fraction of the time in Visual Basic than in Visual C/C++ and Microsoft even offers a compiler to increase performance. When beginning to develop Windows applications, Visual Basic should be the first choice for development.

Practically any database can be accessed with middleware software. Middleware software even exists for mainframe and midrange systems to allow PC developers to directly access the host database from an ordinary PC. No longer does the programmer have to know how to program on the host using languages such as Report Program Generator (RPG). The developer can now access the host information easily with common PC development tools such as Visual Basic.

Many programmers already know that access times can be slow if ODBC is employed to access some host computers. Some middleware software now even exists to access host databases directly without using ODBC routines. For example, the AS/400 best utilizes Distributed Data Management (DDM) to provide subsecond record access to most queries. PC development software now exists to employ DDM access the AS/400.

PDT Program Generators
In the previous section, several development languages were briefly discussed in order to program and integrate PDTs with your computer system. As an alternative, there are several PDT program generators that are now available that virtually eliminate the task of software programming and significantly reduce lengthy development time periods.

Most of these program generators are simple enough for non-programmers to use, but offer the features and functionality of experienced programmers to develop advanced applications. However, some training may be required. Usually these program generators provide conditional branching, user definable prompting, and keyed file access to your corporate databases. Other advanced features are available to completely customize your application.

In general, the goal of these program generators is to "automatically" produce the source code for you without having to write a single line of code. Once the custom data collection program is built, the output of the program generator usually generates "C" code which can be compiled using a standard C/C++ compiler. For the most part, these program generators can create data collection programs in a fraction of the time that it would take to write a software program. In addition, several of these program generators support "cross-platform" development. In other words, drivers can be purchased separately to generate code that will work with several different PDT models.

Program generators should be considered when (1) a fully custom solution is required, (2) limited developer resources are available, (3) frequent updates or minor modifications are continual (e.g. consulting services or contract programming), and (4) cross-platform PDT support is necessary.

Database Software
Programming using database software is generally the easiest approach to take when developing simple database accessing applications. Practically anyone can begin "programming" using database software. If more complex programs are necessary, Visual Basic or Visual C/C++ could be an alternate choice.

Most PC databases such as FoxPro, Microsoft Access, etc, support Open Database Connectivity (ODBC) allowing a common connectivity link between an application and a database. If the database were to be ported to another database platform supporting ODBC, then only the links have to be changed and not the code.

Most of these database software utilities now have built-in Graphical User Interface (GUI) tools to quickly develop software applications such as tracking, inventory, or fixed asset programs. With these applications specifically, complex algorithms are not usually necessary and, therefore, only access to database and a GUI presentation is required.

Generally, these database utilities have visual development tools to drag objects (for example, a link into a particular database) onto form(s) which display the GUI screen(s). Even though this might seem technical at first, most of the database programming utilities have been designed specifically for the non-technical individual. Probably the most complicated decision is to decide what is to be included in the database itself.

Bar Code DLL Libraries
The Auto ID market is growing rapidly and many new applications are now being developed or existing applications are being modified to incorporate bar codes. From a software developer's stand point, time-to-market is very important due to the competitive nature of most industries. Bar Code ActiveX Controls & DLL libraries substantially save a programmer's time to develop and/or incorporate bar codes in their applications. These can easily be incorporated into most database or custom software applications. The software interface to these libraries is fully documented and relatively easy to incorporate into most Windows applications. For the most part, Bar Code ActiveX Controls & DLLs are royalty free (except for extremely high quantities) and are the most cost effective way to generate bar code applications.

2D Software Utilities
Until recently, businesses have relied on linear bar code symbols to achieve productivity. Productivity is important to every business, and interest in 2D (two dimensional) bar coding is growing rapidly due to its benefits over linear bar code symbologies. However, deployment is still lagging largely due in part to the high cost of marketing for this innovative technology as well as the margins manufacturers require to recoup R&D cost. From the consumer standpoint, added project development costs are usually associated in leveraging the increased information from the 2D symbol. In general, every software or database application receiving 2D scanned input must be modified in order to accommodate the thousands of bytes of data from the scanned 2D symbol. Up until recently, implementation has been generally very expensive in small to medium size businesses that may not have the time or ability to afford software programmers to make these modifications even if the benefits of 2D bar coding are clear.

Processing 2D Scanned Data
The principle behind scanning a 2D or linear bar code symbol is very much the same. The difference, however, lies in the amount of data that is transferred from the bar code scanner to the software or database application. Since most businesses can easily add 2D symbols to the documents and labels that already exist, the only crucial implementation issue left unanswered is "How do I process all of that data?"

A linear (1D) bar code encodes an index into a record of a database. In other words, the value of a linear bar code symbol generally corresponds to an input field of the software application. Therefore, pre-processing of the scanned input before it is sent to the software application is usually not required. With 2D symbols, however, an entire record of a database can be stored in a single bar code. If a 2D symbol is employed, data processing (i.e. parsing, editing, formatting, re-ordering, etc.) is necessary to extract the appropriate information from the 2D symbol. Therefore, the existing software application will have to be modified in order to support the 2D symbol. For all practical purposes, however, the 2D symbol should complement a business' current system and not be the driving force to change or modify the software application.

A single 2D symbol can easily hold specific corporate information as well as information that is unique to each department. Each department can then in turn process the data from the 2D symbol differently. With the ability to process the data after it has been scanned and before it enters the software application, major changes to departmental applications and operational procedures are eliminated. Often, the 2D software solutions can even be configured to process the data differently depending upon the information contained inside the symbol.

2D Bar Coding Made Practical
Usually, most 2D scanners connect via the keyboard or serial (COM) port. In recent years, however, connection via the keyboard port appears to be the most popular since the installation is much simpler. Regardless of the input connection type, 2D software solutions exists to process the scanned input data in real-time so that the software application does not need to or have to be modified. This creative approach makes 2D bar coding practical and affordable for most businesses considering this technology. Data can easily be edited, formatted, parsed, remapped, and re-ordered with no programming required. In addition, since the scanned input data is processed before it is transferred to the software application, unique features such as Windows message prompting and even sounds for user-defined triggered events exist to take full advantage of the PC's capabilities. These features can be used to prompt the user to take specific action(s) and/or provide instruction when certain user-defined events occur (i.e, a particular bar code is scanned).

The true benefit lies in the fact that the user can continue to use the existing business software with no costly modifications. Often, the source code may not be available to even modify. With these new 2D software tools, a substantial amount of the project development cost and time to support the increase in information can be eliminated. Until now, this drawback was usually one of the primary reasons why companies waited to integrate 2D bar coding. Now with these 2D software utilities, users can maximize the full potential of 2D bar coding by extracting only the information that is needed in any order and in any format — a fully custom solution.

The benefit of 2D bar coding is clear and certainly with this new innovative software approach, 2D bar coding may be more appealing to those who are waiting.


Would you like to own a hard copy of this book? If so, please click here to request your free copy. Be sure to include your name, mailing address, and phone number to ensure prompt delivery.

Click here to return to the Table of Contents.



Glenn W. Lee