Skip to main content

Using Anzio with Counterpoint POS Systems

This document describes some techniques for getting the most out of Anzio, as a terminal emulation client, when used in conjunction with CounterPoint point-of-sale software from Synchronics, Inc.

Background

Anzio is available as Anzio Lite, a very low-cost version, or AnzioWin, a fully-featured version. Both programs are terminal emulation (telnet) clients that run on any version of Windows from 95 onward. All comments below refer to both products unless otherwise noted.

In addition to being a general purpose terminal emulation product, Anzio has some features which make it work especially well in a point-of-sale environment, especially in supporting multiple serial devices and printers, controlled by escape code sequences from the host system. We have worked to optimize the coordination of these features with the CounterPoint software.

We have succeeded in creating a demo environment in which Anzio supports a full-page printer, a receipt printer, a serial scale, a serial pole display, and keyboard-wedge scanner. Details are below.

Communication with Host

Anzio supports several communication methods, including direct serial and telnet. Both products also support SSH, which provides a higher level of security.

Device support, as described below, goes through the main communication channel, and is switched by means of escape code sequences.

Screen Display

Both Anzio and CounterPoint support many terminal types. It appears that the best option for working together is the SCO ANSI model, which Anzio identifies as "SCOANSI" and CounterPoint refers to as "ANSI". The keymap file that Anzio provides (SCOANSI.KYS) provides all the necessary key definitions. Color usage is driven from the CounterPoint software.

The Anzio window can display on part of the screen, or it can be "zoomed" to take over the entire screen. The latter is usually preferred for POS installations. It is also possible to run Anzio in "superzoom" mode, in which there is no title bar and optionally no menu system. To remove the title bar, go to Edit:Advanced Options:Screen, and in the section "Window Style", remove all checkmarks except "Popup". Then save settings, quit, and restart. To remove the menu system, use Anzio's "kiosk mode". This requires altering the command line associated with the desktop icon that starts Anzio, to include "/k:0" as a command line parameter. Note that in this mode, the user will need to terminate the session by quitting from the host end, thereby causing Anzio to quit.

Printing in Anzio

Anzio supports several approaches to printing, referred to as Print Levels (in the File menu). High uses the Windows printer driver to print. Anzio controls page setup, font face and size, spacing, etc.  Low is deprecated. Spooler writes directly to the Windows spooler, and does NOT use the printer driver.  It is completely transparent. Raw prints directly to a COM or LPT port. Like Spooler, it does not use the driver and it is transparent. Being transparent, it does not and can not affect the output content or format in any way.

Note: In Windows NT/2000/XP/2003, if you have any printer driver installed on a COM or LPT port that you are trying to access via Raw, that driver will interfere. We suggest uninstalling such drivers, so Anzio can drive the port directly.

AnzioWin also contains a feature called Print Wizard. This feature is designed to deal automatically with a large number of printing issues. Most notably, it will auto-fit reports to the page. Print Wizard starts off printing in High; however, if it detects escape characters in the data it will switch to Spooler mode.

The Printer Setup menu item allows you to specify what is your primary printer. This must be a printer with an installed Windows printer driver. By default, all printing will go to this printer. However, it is possible to configure Anzio to use a different printer for Spooler, by doing Spooler Setup, and/or a different printer for Raw, by doing Raw Setup (both in the File:Print Level submenu). In this way it is possible to support 3 printers (or more, as described below).

The passthrough print protocol, in which print data is sent from the host through the terminal session, does not have a provision for indicating end-of-job. Windows printing, especially at High level, is job oriented. So something needs to be done to determine when a job is finished. Our solution to this is to use a Flush Timer (in the File menu). This specifies a number of seconds. When a print job has been idle for this number of seconds, Anzio will "flush" it, closing the job and sending it on to Windows.

Anzio's passthrough print codes (in SCOANSI, VTxxx, and Linux mode) are

   On:   [ 5 i

   Off:   [ 4 i

In CounterPoint, you would enter these in hex mode, as "1B5B3569" and "1B5B3469", respectively.  Data received this way goes to Print Wizard, if it is turned on (AnzioWin only), or else as directed by the File:Print Level setting.

Anzio also has a secondary passthrough print feature, whose codes are

   On: [ 7 i

   Off: [ 6 i

In CounterPoint, these are entered as "1B5B3769" and "1B5B3669", respectively. Data received this way is always printed with Print Level Raw, going to the raw printer if so configured. Data is written immediately; the Flush Timer is not used.

Anzio also has a feature that allows use of a printer initialization ("print-init") file. This file, which resides on the PC, is automatically prepended to any print job that comes in to the primary passthrough print channel. Typically, this is used in conjunction with Print Wizard, and the file contains Print Wizard Markup Language (PWML), which controls how Print Wizard does its printing.  It can also contain text and/or graphics to be printed before data coming from the host.

Changing Raw Printing Configuration

As mentioned above, in Anzio's menu system you can do Raw Setup to specify a particular printer (LPT or COM port) to be used for raw printing. It is also possible to change this with an escape sequence from the host. 

To set Raw-setup to a particular serial (COM) port, send

   Esc [ 5 ; {

Or in hex

   1B5B353B7B

To specify a particular LPT port, do

   Esc [ 6 ; {

Or in hex:

   1B5B363B7B

For other options, see the file HOWTO.TXT that is part of the Anzio download/install.

Device Support

Anzio also supports both input-only and bidirectional serial devices, such as pole displays, scales, and barcode scanners. We refer to these as AUX devices. Special escape sequences allow turning aux devices on and off, and switching between ports. 

One aux device can be in use at any one time. If the aux device is in input mode, it is constantly polled, and any data that appears from the connected device will be sent to the host system, just as though it was being typed. No filtering is done. This would be appropriate for a serial barcode scanner, for instance.  See cautions regarding CounterPoint below.

If the aux device is in bidirectional (input/output) mode, in addition to data from the device going to the host as described above, all data coming from the host is routed (output) to the device instead of the screen, except for the sequence to turn this mode off. You can also exit this mode by using Anzio's "Grand Abort" function, .

Anzio uses the Windows drivers for serial ports. There is essentially no limit on the number of ports that can be added to a PC, especially when USB-to-serial adapters are used. Windows serial ports are configured as Data Terminal Equipment (DTE); for some devices a null modem adapter must be used.  Serial ports, of course, must be configured with the baud rate, data bits, parity, and handshaking to match how the connected serial device is configured. Anzio can do this, or Anzio can rely on the configuration as done in the Windows Control Panel.

Note: As explained above, uninstall any printer drivers connected to these ports.

Anzio's initial configuration for the aux port is done in Edit:Advanced Options:General tab.

The control sequences that Anzio recognizes in SCOANSI mode are as follows:

     Code                         Hex                       Meaning

-----------------------------------------------------------------------------------------------------------

  [ 1 {     1B5B317B              Sets AUX to input/output mode.

  [ 2 {     1B5B327B              Turns off the AUX port

  [ 3 {     1B5B337B              Sets AUX port to input mode

  [ 4 ; ; {    Configures AUX port (see below).

In the last case, the is the COM port to use as the AUX port, in ASCII. The is a baud rate in ASCII, such as "9600". Two special values are allowed. A value of 0 means to leave the baud rate as configured in Windows. A value of 1 means to use the baud rate as configured in Anzio's AUX setup. So the complete sequence to choose COM5 at 9600 would be:

   [ 4 ; 5 ; 9 6 0 0 {

or in hex:

   1B5B343B353B393630307B

Keyboard Devices

Some POS devices that are used for input only, such as barcode readers, can be connected as keyboard wedges; that is, they plug in between the PC and its keyboard. Other devices may plug in to a serial, USB, or other port, and have software that makes their input appear as though it were typed. These devices should work with any Windows software, including Anzio. No special configuration is needed in Anzio for the these devices.

Device Support in CounterPoint

The following is not definitive information on CounterPoint; it is simply to the best of our knowledge.

CounterPoint supports devices connected in the following ways:

1)   Keyboard - These input devices send their data as though it was typed into the keyboard.  CounterPoint does not exert any control on these devices - it does not turn them on and off.

In Anzio, such a device may or may not be a keyboard-type device. For instance, a scale might be defined to CounterPoint as a keyboard device, but in Anzio the scale might be connected to a serial port, and an Anzio macro could read, process, and send the data.

2)   Serial devices connected to host serial ports - You might plug a scale directly into a Unix serial port, for instance. You must then tell CounterPoint what serial port is to be used for the scale on a particular register.

Anzio itself does not get involved in these devices. However, we also offer a product called VirtPort. This product consists of two programs, one for the host system and one for the PC. Together these create a virtual serial port; that is, a port that CounterPoint sees as part of the Unix/Linux system, but that is in fact rerouted over the network to the PC. See more on this subject below.

3)   Serial passthrough devices - These are devices defined as serial in CounterPoint, with a device ID of "/dev/tty" or "dev/stdout". A passthrough printer is a case in point. An "enable" code and a "disable" code associated with this device tell the terminal (emulator) to turn on and off the output to the appropriate device. (These devices do not appear to work for input in CounterPoint.)

Anzio supports these devices very well. This is the primary means of driving devices through Anzio.

VirtPort - Virtual Serial Port Software

Rasmussen Software offers a product called VirtPort, that creates a virtual serial port; that is, a serial port on a PC appears (to CounterPoint, etc.) as though it is a Unix/Linux serial port. The port is bidirectional and has full flow control. Baud rate, etc. must be established at the PC side at the time the program is launched.

The product consists of two pieces (programs), one for the host and one for the PC, each launched and configured via a shell command. The PC-side program is typically started first. Its parameters direct it what socket to listen on, which COM port to drive, and the baud rate, etc., to use. It then runs, in a console window, waiting for a connection via the network.

The host-side program is told what name or IP address, and what socket number, it is to connect to (where the PC-side program is running). It establishes a connection to the PC-side program. It assigns a pseudo-tty (pty) device, and ties the elements together. Now, any I/O to the pty will be redirected over the network to the PC. Because the pty device number to be assigned is dynamic, it creates a soft link (sort of an alias) to that device, with a preset name.

To support multiple PCs, you would run multiple copies of VirtPort on the host system. You can also support multiple devices on one PC, by running multiple copies of both the host-side and the PC-side programs, using different socket numbers.

CounterPoint can be configured to communicate with serial devices. If you enter the alias of the pty (created by VirtPort) as the Device ID (in CounterPoint), then CounterPoint can communicate with the device attached to the PC. This works especially well with devices that need bidirectional control, such as scales.

One limitation of VirtPort is that it is difficult to make work over a network connection that uses Network Address Translation (NAT).

Under Development: Backchannel AUX Devices

We have under development a procedure similar to VirtPort, but using the multichannel capabilities of an SSH connection. 

When Anzio is connected to a Unix/Linux host via SSH, it can be configured to open one or more "backchannels" to the host. Each of these backchannels can be connected to a PTY on the server, and to a serial port on the Windows machine. This will then support multiple bidirectional serial devices simultaneously.

Please contact us if you are interested in working with us on this.

Printing from CounterPoint

CounterPoint supports a variety of types of printing. Anzio's printing features can be of great use in many cases:

1) Receipt printing

In most cases of receipt printing, CounterPoint sends out 40-byte lines of plain text. Anzio can handle this with Print Level set to High, Spooler, or Raw. In Spooler and Raw, the data goes straight through to the printer. If the printer has a cutter, and you want to trigger it, then the code to do so must be included in the "disable code" of the printer device definition in CounterPoint.

In High level printing, the Windows printer driver is used, and so there is a problem of pagination. However, if Print Wizard (in AnzioWin) is used, Print Wizard will dynamically create the proper page length. The driver can often be configured to cut the paper at end of job. The advantage of Print Wizard is that greater control can be had; you can configure a print-initialization file to control the printout, even adding a logo to the top of the receipt.

2) Form and report printing

Printing these jobs with Print Level set to Spooler or Raw causes the data to go unchanged to the printer. Any choices of font, pitch, paper size, etc. must be controlled either via control codes from the host (CounterPoint) or via the printer front panel itself.

In High mode, Anzio's Printer Setup controls job level settings such as paper size and orientation, and the Printer Font selection determines the font. The font size that is chosen implicitly determines the line spacing and character spacing.

If Print Wizard (in AnzioWin) is used, it will work to automatically fit reports to the page. You can then move from 80-column to 132-column (or whatever) reports, with no operator intervention. Reports to be printed in preprinted forms should align the same way they would with lower level printing.

Also with Print Wizard, a print-init file can specify the layout parameters of a print job, even to the point of dynamically creating form overlays, and so avoiding preprinted forms.

3) Label printing

CounterPoint has capabilities for printing a variety of labels. Some of these include barcodes. If these are printed through Anzio at Print Level Spooler or Raw, data will go unchanged to the printer, and if properly configured, it should work.

With Print Wizard (in AnzioWin), some enhancements can be made. First, Print Wizard has its own barcode generator. Codes sent from the CounterPoint can tell Print Wizard to print any of 12 kinds of barcode, on any printer (the printer does not need to have built-in barcode support).

Also, through a print-init file, Print Wizard can be told to reformat print jobs designed for continuous-feed labels into full-sheet labels, such as on an inkjet or laser printer.

A Real CounterPoint and Anzio Setup

The following describes a sample setup of CounterPoint 7.5.3 and AnzioWin 15.0.

AnzioWin is running on a Windows XP PC. This unit has one parallel port, and one serial port built in. However, a USB hub is attached, which in turn has four USB-to-serial converters. This effectively provides 5 serial ports. The unit has a PS/2 keyboard port.

CounterPoint is set up on a Red Hat Linux system, in its standard demo configuration. AnzioWin communicates via telnet or SSH. Terminal type in Anzio is SCOANSI, and in CounterPoint is ANSI.

A keyboard-wedge scanner is plugged in between the PC and its keyboard. No configuration is necessary.

Printer 1 (in CounterPoint) is configured to use Anzio's standard passthrough print. In Anzio, Print Wizard is on, and the printer is any Windows full-page printer. Printer Font is Courier New; font sizing is automatic, thanks to Print Wizard.

        Register definition:

      Device code       ANZP1   Local printer on Anzio

      Print method      Normal

      Device ID         /dev/tty

      Form ID 1         INVPP   Invoice - Plain Paper

      Pause             None

        Device ANZP1 definition:

      Enable            1B5B3569

      Disable           1B5B3469

      Printer type      Local

Printer 2 is used for receipts, and uses Anzio's secondary passthrough print. In Anzio, Raw Setup configures Raw-level printing (used by secondary passthrough) to go to COM6. This is wired through a null modem to an Epson TM-88III receipt printer. The CounterPoint "disable code" includes a sequence to trigger the printer's cutter.

        Register definition:

      Device code       ANZP2 Anzio receipt printer

      Device ID         /dev/tty

      Form ID 1         RCPT1   Receipt - Full

      Pause             None

        Device ANZP2 definition:

      Enable            1B5B3769

      Disable           1D56011B5B3669

A cash drawer could be connected to the drawer kicker port on the back of the Epson printer. This is configured in CounterPoint.

        Drawer definition:

Drawer device code      ANZCD   Anzio cash drawer

      Drawer device ID        /dev/tty

        Device ANZCD definition:

      Open codes        1B5B37691B7000197E1B5B3669

A 2-line, 20-column pole display is connected to COM7 directly. Anzio's AUX setup configures COM7 as the aux device, and sets the baud rate, etc. In CounterPoint, this display is defined, and codes turn AUX bidi mode on and off, and specify what messages to display.

        Display definition:

      Device code       AZAUX   Anzio AUX device

      Device ID         /dev/tty

        Device AZAUX definition:

      Enable            1B5B317B0D0A0D0A

      Disable           1B5B327B

      Separator         2020

A Weigh-Tronix scale is connected to COM8. This has been connected and configured in two different ways. First, a VirtPort connection was established, so the scale appeared to be connected to the Linux host. The CounterPoint configuration sends a "W" followed by a carriage return to the scale, and then reads and parses the scales response. This worked well in the office, but it does not work outside the office, over the Internet, because NAT is involved.

         Shell script that starts CounterPoint:

# Get IP address of Anzio

printf "\034env/s anz_ip\035"

read ANZ_IP

# start a virtport session

virtport15/virtport -i ${ANZ_IP} -D ~/vp1 -X -v &

PATH=.:$PATH                                        

export PATH                                         

cd /usr/local/synchronics                           

TERM=ansi;export TERM                               

# Following needed for serial input devices           

WINEDC=WINSTD;export WINEDC                         

syn DEMO1                                           

        Scale definition:

      Device code       ANZSC   Anzio Scale

        Device ANZSC definition:

      Type              Serial

      Parameters        Set externally

      Enable            1B5B343B383B317B1B5B317B570D

      Disable           1B5B327B

For on the road, a different approach was created. This approach requires certain new features in AnzioWin 15.0. Here, a macro was created, and assigned to F12. This macro

  1. selects COM8 as the aux port;
  2. sends "W" followed by carriage return to the scale;
  3. reads the input of the aux port until a control-C is received;
  4. does a regular expression replacement operation on the data, to extract only the weight information;
  5. sends that to the host;
  6. and resets the AUX port. At the CounterPoint end, the scale is defined as a "keyboard" device.

 

      Scale definition:

      Device code        ANZSC2   Anzio scale 2

      Device ANZSC2 definition:

      Type               Keyboard

      F10 macro definition:

      aux-setup com8|

      aux-write W$~{13}|

      replace/s \l[^0-9]*~{[0-9.]*}.*\r\l.*\r \1
             «aux-read $~{3}»|

      aux-setup com7|

Other POS devices could be defined and connected using similar means.

Printing of POS receipts, invoices, and general purpose reports works well.

A label printing demonstration has been set up using Print Wizard. A print-init file puts Print Wizard into PWML mode, and sets the layout parameters of the 2-column label stock. The barcode-start code in CounterPoint tells Print Wizard that following data is to be printed as a barcode with no caption. The barcode-end code is simply ">", which ends the barcode.

Possible Future Developments

There is always more work to be done. Some possibilities include:

  1. Supporting multiple simultaneous aux input devices. It is currently awkward to have a PIN pad and a check reader (both serial) configured, for instance. Anzio currently allows input from only one port at a time, and Anzio receives no signal from CounterPoint to tell it when it wants to read from the PIN pad, for instance.
  2. A reverse-direction option in VirtPort, to avoid the problem of Network Address Translation.
  3. Support for OPOS and/or HID devices.
  4. Use of on-screen toolbar buttons, new in 15.1.

Copyright © 2024 Rasmussen Software, Inc. Legal Information & Privacy Policy
Send comments and suggestions to rsi@anzio.com