LabelVision Classic: Technical Notes

Using the MOD Utilities
This technical note explains how to calculate and use the various Mod utilities (MOD10, MOD43 etc.) to produce check digits and link characters required by a variety of bar code specifications. Although each Mod utility calculates a different type of check digit, they all work in a similar manner. In this note, we will refer to the Mod utility with the name MODnn, where nn is the check digit being calculated. For example, the MOD10 utility calculates a Mod 10 check digit. The purpose of this note is to explain how to use any of the MODnn utilities in your application. In this note, we will use the MOD10.EXE as an example. Your application may use a different MODnn utility, and vary slightly in how it is used.

Before using the MODnn utility, you should copy the file MODnn.EXE to your LabelVision directory.

The MOD utilities come with a help screen, accessed by typing, for example, "MOD10 /?" at the DOS command line.

The MODnn utility is a DOS program. When it is called on the DOS command line, it has the following parameters and options:

MODnn [/F] [/O filename] argument1 [argument2...]

By default, it outputs the MODnn check digit for all numbers in all arguments to the screen.

If you specify the /F option, then it concatenates all its arguments, adds a MODnn check digit based on all digits in the arguments, and outputs the resultant string. If you wish to include spaces in the result, you must put each argument in quotes and put the spaces inside the quotes.

If you specify /O and a file name, the result is output to the given file instead of the screen.

Examples (blue text is output by the program):

MOD10 100 10900 00018
2

MOD10 /F 100 10900 00018
10010900000182

MOD10 /F "100" " " "10900" " " "00018" " "
100 10900 00018 2

MOD10 /F /O MYFILE.TXT "100" " " "10900" " " "00018" " "

Nothing is output to the screen. The file MYFILE.TXT has the following data:
100 10900 00018 2

To use a MODnn utility in your labeling application, follow these general steps:

Use the appropriate Application Items (INPUT FROM OPERATOR, TEXT FILE INPUT etc.) to get the data required to calculate the check digit.

After the above items, add an item to your application to RUN A DOS PROGRAM that will call the MODnn utility with the above parameters, and redirect it's output to a text file by adding "/O FILENAME.TXT" as the first argument to the MODnn command. The check digit will be output to this file.

Add the above text file to your application as a SINGLE RECORD Text file. Add a single field to this text file. This single field is the desired check digit.

The remainder of this document describes, in detail, how to use the MOD10 in a sample application.

Assume that we wish to have an application which outputs a typical Interleaved 2 of 5 shipping container code which consists of a three digit packaging / number system indicator, a 5 digit manufacturing number and a 5 digit item number. A typical label appears below:

bar code

100 10900 00018 2

Assume that you draw the above label. You should create four input fields: "Package System", "Manufacturer", "Item Number", and "Checksum". Draw an Interleaved 2 of 5 bar code, but do not mark the "Check character" option, since it will be calculated explicitly. The expression for this bar code is shown below:

Package System+Manufacturer+Item Number+Checksum

Add a text field below the bar code and box, with the desired font. Its expression should include spaces between the fields, and is shown below

Package System+" "+Manufacturer+" "+Item Number+" "+Checksum

Next, set up an application (in LabelVision Professional) for this label, which contains the following items:

  1. The database, text file or user input from where you get the first three field values.
  2. A "Run a DOS Program" item. Check the Put quotes around arguments option. Add the following fields (in order)
    1. The constant "MOD10" under Program Name.
    2. The constant "/O CHECK.TXT" as the first argument.
    3. The field "Package System" from your input source as the second argument.
    4. The field "Manufacturer" from your input source as the third argument.
    5. The field "Item Number" from your input source as the last argument.
  3. A "Text File Input" item. Select the Single Record per file option. Enter the file name "CHECK.TXT". Add one field, with the data type String. Call this field "Checksum".
  4. The label file you designed. If you have named your fields correctly, auto-assigning the fields will result in a correct application which prints the desired label.

    Normally, when the Print Program calls a DOS program, it "swaps" itself out of DOS memory (either to disk or to EMS memory), which frees up all but about 5K of DOS memory for the DOS program. This swapping is necessary when calling any DOS program that requires more than about 50K or so of memory.

    This swapping does take time. Applications which run a small DOS program will run faster if you disable swapping. The time savings is especially significant if your application repeatedly runs the DOS program..

    To disable swapping, specify the /X NOSWAP option on the command line when you call the print program. If you access your application from a LabelVision menu, simply add "/X NOSWAP" to the beginning of the "Options" box in the Menu Editor's "Define Action" dialog box.

    If you start your application from a DOS batch file, add "/X NOSWAP" to the LPRINT command line. The final line will be something like that shown below:

    LPRINT /X NOSWAP /L myapp


Send mail to
webmaster@labelvision.com with questions or comments about this website.
Copyright © 2014 Flexible Information Systems, Inc.