How to Create Variable Counters on Labels


Originally appeared on The Human Readable Blog, by TEKLYNX.

Without the proper organization and tracing tactics in place, labeling can become a nightmare. Products can become troublesome to find in the production line or storage, and identifying defective products in a recall can become almost impossible.

By using variable counters to organize, count, and trace your labeled products, your labeling process can become more efficient. In this blog, learn about variable counters and how to use them in your barcode labeling environment.

What are variable counters?

A counter is a variable that is set up to increment or decrement in value based on a counting base, a start value, an increment value, and a reset value. A counter variable can be used for counting, or for printing serial, lot, or production control numbers. Using a counter allows you to print a unique number as text or a barcode on each label or series of labels.

There are several types of counters in TEKLYNX labeling software, CODESOFT and LABELVIEW:

  • Classical counter: A classical counter is a simple counter that counts all labels created or printed. You have the ability to set a minimum value, maximum value, increment value, and reset value. If there are 10 labels in a series, the labels will be counted 1-10.
  • ISO counter: An ISO counter allows each label copy to be individually and exhaustively numbered. The counter specifies that each label printed is counted, regardless of whether it is an original or a duplicate. If you want to print 5 different labels and have two copies of each label, a classical counter would count the labels 1-10, and the ISO counter will count the labels as 1,1,2,2,3,3…
  • Shared counter: shared counter is a counter that is leveraged across multiple label files. For example, if you have one product that comes in a variety of options (e.g. different sizes or colors), you can use a shared counter to track how many labels are printed for the entire product family, regardless of the variety within it.
  • Advanced variable counter: The advanced variable counter is a new feature in LABELVIEW and CODESOFT 2021 that uses local or cloud database connections to drive the properties of the counter. CODESOFT 2021 includes two label samples demonstrating advanced variable counters:

How to add variable counters on labels

Uses for variable counters in labeling

Taking advantage of variable counters on your labels can be beneficial to your labeling process in many ways that stem far beyond the simple count of number of labels printed. Below are a few ways to use variable counters in your labeling process:


Adding counters to your labels is a simple way to organize your labeling system. While doing quality assurance checks on your products, having your labeled products numbered makes it easy to know the placement of the product in the production line. In the event of a product recall, having counters on your labels allows you to find the defective products quickly and efficiently.

If you are looking to track how many labels are printed in a given day, month, or year for a specific product, product family, or overall, using shared counters will help you achieve this. One shared counter applied across all your products can show you exactly how many labels are printed at any given time, giving insight into production and productivity.


New features in CODESOFT and LABELVIEW 2021 allow you to pull variable data directly from a local or cloud database to leverage in your variable counters. Having variable counter data pulled from a database alleviates the number of templates needed, and ensures accuracy across your labels.

With counter database connections, you can also take advantage of CODESOFT’s new visual basic script (VBScript) manager that allows you to execute application events to write your variable counter data back to your database after being printed. To see an example of a label leveraging a counter with VBScripting, take a look at the label sample within CODESOFT 2021, “FittingsWithCustomSerialSaveValue.lab,” which demonstrates the use of VBScript to write the value back to the database.


Using database connections in your counters to reduce the number of label templates means less work for your printer, making the entire printing process faster.

With TEKLYNX labeling software, you can utilize advanced variable counters while exploiting the benefits of embedded printer drivers. TEKLYNX developed printer drivers allow your labeling software to communicate with the printer in native language for faster printing, efficiency, and quality.

Instead of the printer reading variable counters as images in a language the printer doesn’t recognize, TEKLYNX native printer drivers communicate that the variable counter is a number, speeding up the printing process and creating efficiencies within your labeling environment.

How to Add a Variable Counter to Your Label

Creating variable counters on your labels in LABELVIEW and CODESOFT 2021 is simple:

  1. Go to Data Source > Counter Add.
  2. Give the Counter a name (you will use this unique name whenever you want to use this counter).
  3. Configure the settings of the counter to appropriately match the desired functionality. You will need to set the name of your counter, type, current value, increment, minimum value, and maximum value.
  4. Check if your counter is a shared counter or ISO counter, check the corresponding check boxes
  5. Click OK 

For more information on how to add variable counters to your label, visit our Support Center, or watch our TekTip, “How to Leverage Variable Counters” on our YouTube channel.

To have full access to the enhanced variable counter features and label samples, download a free 30-day trial of CODESOFT 2021.