Boca Systems

 

DISCONTINUED PRODUCTS


Boca Systems

 

October 19, 2009

The Ghostwriter Series of printers (Mini, Micro, SubATM, XATM, Mag, etc.) is no longer in production.  These printers have been replaced by the ENERGY STAR qualified Lemur Series of printers.  Although the Ghostwriter Series has reached end of life status, we will continue to support these printers in terms of spare parts and repairs for as long as possible.  Based upon our existing data, we should be able to maintain most of these printers according to the followinbg schedule:

  • FGL26/46 based printers:  5 to 10 years
  • FGL22/42 based printers:  3 to 5 years (except for repairs requiring a new ASIC)
  • All other Ghostwriter Series printers:  3 to 5 years

  

 

SOFTWARE REVISIONS

Latest Revision

Comments

 FGL II

 DOT27

 

 FGL IV

 S964Y31 or X96431

 

 FGL20

 FGL20C8

 *Upgrade if before FGL20C8

 FGL21

 FGL21B7

 *Upgrade if before FGL21B1

 FGL40

 FGL40B7

 *Upgrade if before FGL40B1

 FGL41

 FGL41B7

 *Upgrade if before FGL41B1

 HP40

 HP40C4

 Upgrade if before HP40B4

 HP41

 HP41B8

 

 FGL MagMini

 F41CCM10

Consult factory before updating code

 HP MagMini

 HPM41C3 

Consult factory before updating code

 

 

NOT RECOMMENDED FOR NEW APPLICATIONS

 

For bi-directional communication, you must remove USB print and install the Boca Systems USB bi-directional drivers & tools.  Assuming USB print has already been loaded, follow the directions below.  If not, plug in your printer to load USB print, as described above, before continuing with the following instructions.  (NOTE: The Windows Device Manager can be reached by clicking on the System icon in the Control Panel.  Look here for the Hardware tab and Device Manager Button.)   On most systems the "New Hardware Wizard" may automatically appear while you are performing the update below.  If it does, just cancel it and continue with the update driver approach outlined below.     

 

Steps for Updating USB driver

  1. Create new directory – c:\boca\usb_drivers

  2. Download USB. exe to the new directory

  3. From the "Device Manager" window, look under Universal Serial Bus Controllers and find the item listed as USB Print Support (for the Boca Systems printer, should you have other USB printers already installed).

  4. Highlight USB Print Support, left-click on it once, and then right-click once to show the menu.  Select Update Driver with left-click.

  5. The install wizard appears next. Pick "Install from a list or specific location", then click Next

  6. Pick, "Don't search, I will choose the driver to install" and then, click on Next.

  7. Click on "Have Disk" and go to the c:\boca\usb_drivers directory created above, when downloading usb.exe.  Select boca.inf and click on OK.

  8. Choose Boca Systems Thermal Ticket Printer (22/42, 24/44 or 26/46) and then click Next

  9. If prompted, ignore driver warning and click on Yes (At release time the driver has not been MS certified.)

  10. The wizard is ready to install, Click on Next

  11. If prompted, ignore second driver warning and click on Yes (At release time the driver has no digital signature.)

  12. Completed, Click on Finish

To verify that the low-level USB drivers are installed properly, refer again to your PC's Device Manager window.  Boca Systems Thermal Ticket Printer 42/44/46 should be displayed under Human Interface Devices.  Your PC is now configured for bi-directional USB communication with the BOCA printer.  You may use the Boca Systems Customer tool for testing the USB interface. 

 

Obsolete BI-DIRECTIONAL COMMUNICATIONS Information

 

The three Visual C (VC) and three Visual Basic (VB) example programs are intended for the use of programmers.  The source code is included. You will need to have the appropriate Visual Studio components in order to take full advantage of these tools.  These programs show how to perform bi-directional communication with a Boca Systems printer on a serial, parallel or USB port in VC and again in VB.  If you are interested in the sample source code supplied here, download sample_code.zip into a directory (typically c:\boca ).  This file was created using WinZip, and should be unzipped using the same (or similar) tool.  Unzipping this file will create some subdirectories under the c:\boca directory that contain each project.

 

DOWNLOAD: [sample_code. zip]  Released - September 2003
 

Objective

The purpose of this document is to assist the programmer in communicating bi-directionally with Boca Systems Ticket Printer using a parallel, serial or USB interface. The sample code and documentation provided offer a starting point for developers wishing to communicate with a Boca Systems Printer.  The process of opening a port, writing to a printer, reading from a printer and closing a port is demonstrated in all six example projects.   There are three projects each in VB and VC using a parallel, serial or USB interface. Please feel free to borrow whatever code and concepts are applicable to your application.

 

Description

Sample_code.zip contains samples of VC and VB code showing techniques for writing to and reading from a Boca Systems Ticket Printer.  The VB version has a GUI front end and the VC version is menu driven.  To support bi-directional USB communication with Boca Systems printers, both USB sample applications rely on utility programs supplied in a Dynamic Link Library (DLL).  Please note that the DLL is only used for USB (not parallel or serial) communications.

 

Environment

The sample code has been developed and tested in a Windows environment using Microsoft Visual C++ and Visual Basic.  It is fully compatible with Windows 98, Millennium, 2000 and XP.  Windows 95 and NT do not fully support bi-directional communication on all interfaces.  If you need bi-directional parallel or USB communication, we suggest that you consider upgrading to one of the compatible operating systems.

 

DLL Calls for USB

A USB port provides levels of efficiency greater than parallel or serial ports.  A USB port is also more complicated to deal with than parallel or serial ports.  To simplify this for our customers, a library of routines providing low level USB communication has been provided in the form of a DLL. There is a DLL file named boca.dll included with the VC version of the software and boca_vb.dll with the VB version.  These DLLs provide communication routines for multiple Boca Systems Inc. printers on USB ports or hubs.  These routines are accessible to developers through calls in VB or VC as displayed in the sample code.  The routines provide initialization, communication and determine the total number of Boca USB printers plugged into a PC.  Below is an interface description for the DLLs supporting the VB and VC USB projects.  There is more detailed inline documentation in the code along with the calls to the DLL routines.

 

VB USB interface description for boca_vb.dll

 

Routine Name

Calling Parameters

Return Value

Description of Routine

Initialize_USB

None

 None

Establish communication with the DLL

 

 

 

 

Find_Printers

hUSB_Table As Long

Count As Integer

Find Boca USB printers on PC and populate hUSB_Table.

       

Open_USB

Auto As Boolean

Index As Integer

hUSB As Long

Choose a specific Boca Systems USB Printer from the hUSB_Table

 

 

 

 

Close_USB

hUSB As Long

None

Close USB Port

 

 

 

 

Read_USB

hUSB As Any

None

Read data from Printer

 

pBuffer As Any

 

 

 

dwSize As Long

 

 

 

Pipe As Integer

 

 

 

 

 

 

Write_USB

hUSB As Any

None

Write data to Printer

 

pBuffer As Any

 

 

 

dwSize As Long

 

 

 

Pipe As Integer

 

 

 

 

 

 

Timeout_USB

pBuffer As Long Timeout As Integer

None

Set USB Interface R/W timeout periods

 

   

 

Status_USB

hUSB As Any

Status As Long

Read USB Interface Status

 

When Find_Printers is called, it will perform three tasks. It will scan usb ports and hubs for Boca Systems Printers and populate a table with the information found. It will open the port to the first printer it finds.  The function also returns the number of Boca Systems USB printers found and written to the table.

 

You will notice in the example VB code that the parameters hUSB, and pBuffer are defined as “Any” in the Declare statements.  This allows the developer to define these parameters types when the call is actually made.  There are many uses of the type called “Any”.  One of them is VB's way of getting around the linking problems created when Basic routines are calling C routines and passing pointers to structures.  Visual Basic does not support many structure types such as user-defined structures.  Also, VB does not support certain types, such as Strings, in the same way as C.  In the calls of the routines that use these parameters, you will notice they are all defined as “Long”.  These parameters are used as pointers in the C++ subroutines that reside in the DLL file and pointers are passed as “Long” regardless of to what it points.

 

The globally defined variable known as “ptr_USB” is a pointer. It points to the USB hardware configuration data.  This pointer is initialized upon successfully calling “Find_Printers”.

 

The globally defined variable known as “text” is a byte array used as a buffer to transmit/receive bytes of data to/from a Boca Systems USB printer.  The parameter pBuffer points to this buffer and is passed between the VB and VC routines as a Long.  When preparing to call “Write_USB” to send data out the USB port, it is necessary to convert any text data entered from a keyboard, etc into ASCII integers stored as bytes.  The “Convert” routine performs this function as well as initializes the pointer to the text buffer (ptr_buffer) and the string size variable (Str_Size).

 

VC USB Interface description for boca.dll

 

Routine Name

Calling Parameters

Return Value

Description of Routine

proc_address

HINSTANCE hinstLib

Integer

Establish communication with the DLL 





Find_USB_Printers

None

None

Populate Printer_Table


 

 

 

Locate_Device

BOOL fUseDefault

int Index

USB_HANDLE hUSB

Locate a specific Boca Systems USB Printer and return pointer to USB configuration data

 

 

 

 

Read_Data

USB_HANDLE hUSB

None

Read data from Printer

 

PVOID pBuffer

 

 

 

DWORD dwSize

 

 

 

int Pipe

 

 

 

 

 

 

Write_Data

USB_HANDLE hUSB

None

Write data to Printer

 

PVOID pBuffer

 

 

 

DWORD dwSize

 

 

 

int Pipe

 

 


 

 

 

Close_Port

USB_HANDLE hUSB

None

Close USB Port

USB_Status

USB_HANDLE hUSB

int Status

Read USB Interface Status

Timeout_Port

PVOID pFunction

int Timeout value

None

Set USB Interface R/W timeout periods

USB_Control

USB_HANDLE hUSB

Error Code

Issue USB Interface control commands

 

PVOID pBuffer

 

 

 

DWORD dwSize

 

 

 

int Setup Packet

 

 

  

Description of Sample VC Code

This application demonstrates a technique for reading and writing from a Boca Systems printer.  The user will be prompted for several options beginning with whether to read from the printer buffer or write to the printer. The user can issue individual commands to the printer or print an FGL test ticket.  The user will have a selection of up to eight ports to use. This, of course, depends on the configuration of the PC and the Boca Systems printer.  The USB version demonstrates extra features for dealing with multiple USB printers, USB interface status and interface timeouts.   

  

USB Port Communication

USB communication requires the use of the low-level drivers installed in section 5. The table shown above, VC USB Interface description for boca.dll, shows a list of the DLL routines currently supported.  These routines are called from within the sample applications supplied. 

Parallel & Serial Port Communication

Bi-directional communication on parallel and serial ports within these C routines is accomplished with the use of Port_Read and Port_Write routines.  These (and other) routines demonstrate bi-directional communication. 

VC version - Sample I/O Program Users Guide/Section

Procedures

This application was designed with a simple menu driven front end.  With this tool, it is possible to read from, or write to a Boca Systems Inc. printer.  The main menu, prompts a user to choose read or write and then to select a port.  Should the user choose to write to a port, the user would then choose between issuing FGL commands directly or print a test ticket.

 

Choose Write Function

==========================

 1. Send Text

 2. Send ASCII value

 3. Print FGL Test Ticket

 4. Print PCL Test Ticket

99. Exit

 

Choose function:

 

If a ticket is printed an ACK is placed in the return buffer as a 6. Refer to the table below for more printer status values.  Should the user choose to issue FGL commands (Send Text), they will be prompted as shown below.  Please refer to the FGL Programming Guide, available on our web site, for details.

 

Enter FGL Command:

 

After issuing a command, and the ticket or other transaction completes, the user would typically, read back from the same port for the expected responses.  Upon completion of each ticket the printer will place an ACK (0x6) in the outgoing print buffer for you to read.  

 

Upon reading back data from the port buffer, the data will be displayed in two ways. The character representation will be displayed if it is a printable character (Decimal ASCII value 32 through 126).  When an unprintable character is found in the buffer, a space will be printed in its place. The raw hexadecimal bytes will also be displayed for the user to look for control and command characters.  

 

Example, in response to the FGL command <S2>, the printer will return a ticket count followed by the firmware level of the printer.  After reading the buffer, one will see a similar display:

 

    The buffer contains 22 Byte(s) of Data.

    Character Response = 000000 PROM=FGL-44A17

    Hexadecimal Response = 30 30 30 30 30 30 20 50 52 4f 4d 3d 46 47 4c 2d 34 34 41 31 37 d
 

Description of Sample VB Code

 

USB Port Communication

The USB support is supplied via the DLL file as explained in Section 8.1 USB Port Communication .  The calls made to the DLL routines are contained within the VB routines that perform initialization, reads and writes.  These routines are Form_Load, Send and Receive to name a few.  Notice the use of aliases to simplify the routine names.  The status data returning to the PC from the USB port is buffered.

   

Parallel Port Communication

The parallel port communication is accomplished using a Print statement to write to the Boca Systems Inc. printer and an Input statement to read from the print buffer.  The status data returning to the PC on the parallel port is buffered.

Serial Port Communication

The serial port communication is accomplished using MSComm for reads and writes.  As the status data returned on the serial port is not buffered, great care must be taken in processing the data received from the printer.  Please refer to Visual Basic or MSComm guides for more information.

VB version - Sample I/O Program Users Guide/Section

Procedures

The built in test procedures demonstrate how to print test tickets, send text, ASCII & files and how to read the print buffer.  The serial port tool has a button to set the baud rate.  The USB port tool has several button relevant to USB only such as: setting timeout, reading interface status, etc.  The bulk of the bi-directional communication is contained within the Init, Send ,Receive and establish status routines.  Pick a procedure from the drop down list and buttons.

Test Tickets

The test tickets data is printer specific.  The standard FGL test ticket shows numerous print features and the alternate demonstrates some of the available resident fonts.  The HP file will print an example identification card.

Printer Path

Some Boca Systems Inc. printers have two ticket dispensers and need a method by which to distinguish them.  The FGL path text commands <P1> and <P2> give the user that option.  The default for all Boca Systems Inc. printers is path #1.

Read Print Buffer

This button is useful for performing reads from a buffer that may be filled with residual data from previous functions.  As you will notice, there are timing issues when writing a command to the printer and waiting for the printer to respond.  Most responses come after a ticket is actually printed.  How long it takes before a response is forthcoming from the printer is dependent upon the size of the ticket stock in the printer and how much is being printed on the ticket.  It could take up to 2 seconds for one large, heavily populated ticket, but most tickets print much faster.

Message Windows

The scrollable Message box at the bottom of the form displays detailed string messages.  This window is populated with data by calling the Display_Text subroutine in the code.  This can be used to display user or debug information.  There are examples of these calls sprinkled throughout the code.  The Response window, in the top left corner, displays short status messages.  The Ready window displays the printer status: Ready or Busy.  The Current Port window displays the currently selected port.  When nothing is displayed, there are no ports open. 

Clear Screen

The Clear Screen button will clean up the form by clearing all the data display windows.

 

Release Notes

Setting Printer Options from the printer Display/Keypad

Through the use of the display panel, a user can adjust the factory default settings on the printer.  By depressing the Menu and Choices button simultaneously, the menu will be displayed, one option at a time.  To step through the menu, continue to toggle the menu button only.  Watch for BI-DIRECTIONAL to be displayed and press on the Choices button.  The word YES will be displayed. To turn bi-directional option on, press the Test button.  The display will acknowledge acceptance of the option and prompt for "EXIT AND SAVE?"  Do not exit yet.  Press the MENU button several more times until you see "STATUS ENABLED?" displayed.  Press “Choices”, until you see the port(s) displayed that matches your current configuration (serial only, serial and parallel, USB or all 3 at once).  This is the port(s) to which the printer will return status.  Once you find the choice you desire, press the TEST button.  The display will acknowledge acceptance of the option and prompt for "EXIT AND SAVE?"  Press TEST one more time.  The printer will save the choices and reinitialize.

 

Placement of Support files

You must place the DLL and INF files in the application’s working directory, or use the DOS command Set Path to assist your computer in locating them.

USB Port setup

The initialization routines in both the example “VC” code and “VB” code make a very important initialization call to the DLL to allow for further communication across the USB port.  Do not skip this step in your code.

Parallel Port setup

Bi-directional parallel communication must be enabled on your PC.  When booting-up your PC, go to Setup to enable this feature.

Serial Port Setup

When operating in DOS, use the Set Mode command to set the baud rate.  Set Mode 9600,8,N,1 will set com1:  to communicate at 9600 Baud with 8 data bits, no parity and one stop bit.  See the DOS manual for additional details.

Network Access (without print drivers)

With the use of the DOS command Net Use, it is possible to define a virtual port, that points to a printer on your network.  It can then be accessed by the local port name.  This means the sample code supplied can write to a printer on your network as if it were attached directly to a local port.  Choose a port name on your PC that does not really exist or is not being used (such as LPT2:).  The syntax of the command is:

    Net Use LPT2: \\networkPCname\printersharedname

 

An example of this command is as follows:

 

    Net Use LPT2: \\panther\boca-hplj2p 

At this point, any copy command issued to LPT2: on your PC will be redirected across your network to the Boca Systems Inc. printer named boca-hplj2p attached to PC panther.  For further details on Net Use, refer to your DOS manual or use windows Help mode.  Although Boca Systems Inc. printers can be written to across a network, the data returned from the printer currently can only be read on the local PC where the printer was installed.  Please note that the Net Use command will allow you to access the network printer across the network through both VB and VC without the use of a print driver on your PC.

Printer Status

Once a byte of data has read from the printer and is assumed to be status data, the following list applies.

 

Hexadecimal Value

Status Description

0x02

Start of Text

0x03

End of Text

0x04

End of Transmission

0x05

Test Button Ticket ACK

0x06

Ticket ACK

0x10

Out of Tickets

0x11

X-On

0x12

Power On

0x13

X-Off

0x15

Ticket NAK

0x16

Ribbon Low

0x17

Ribbon Out

0x18

Ticket Jam

0x19

Illegal Data

0x1A

Power Up Problem

0x1C

Incomplete Logo Stored in FLASH

 

 

USB Driver Uninstall Procedures

Customers who have accidentally installed our bi-directional drivers will have difficulty getting the printer to work over the USB interface.  In order to restore your computer to working order, you will need to uninstall the bi-directional drivers and re-install the USB Print drivers as shown below:

  • Go to Device Manager (NOTE: The printer must be on in order to remove it successfully.)

  • Locate HID Devices / Boca Ticket Printer

  • Remove the Boca Ticket Printer

  • Turn the printer off for at least five seconds

  • Turn the printer on

  • The USB Print drivers will load automatically

 

Contacts, References and Updates

This document and the source code supplied has all been written by:

 

Boca Systems Inc.                           Voice: (561) 998-9600

1065 South Rogers Circle                  Fax:    (561) 998-9609

Boca Raton FL 33487

 

For questions, comments and suggestions please email: michael@bocasystems.com

Please refer any use of an FGL command to the FGL Programming Guide.

 


RETURN TO TOP
CLICK TO ORDER YOUR TICKETS, WRISTBANDS, & LABELS LET BOCA DESIGN YOUR TICKETS