ABLE Ap1400 Programmer's Manual

ABLE Ap1400 Programmer's Manual

Hide thumbs Also See for Ap1400:

Advertisement

The
Experts in Small Printer Solutions
Ap1400
Thermal Printer
Programmer Guide
Able Systems Limited Denton Drive, Northwich, Cheshire CW9 7TU England
Tel: +44 (0) 1606 48621 Fax: +44 (0) 1606 44903 Web: www.able-systems.com

Advertisement

Table of Contents
loading

Summary of Contents for ABLE Ap1400

  • Page 1 Experts in Small Printer Solutions Ap1400 Thermal Printer Programmer Guide Able Systems Limited Denton Drive, Northwich, Cheshire CW9 7TU England Tel: +44 (0) 1606 48621 Fax: +44 (0) 1606 44903 Web: www.able-systems.com...
  • Page 2: Table Of Contents

    1. Table of Contents Table of Contents ......................... 2 Introduction ........................... 3 Notes on Printer Firmware Revisions (Including Flash) ............... 3 Copyright Notice and Disclaimer ......................3 Modes of Operation ........................4 Paper Feed Button ..........................4 Printing Method ............................ 4 Built-In Fonts ............................
  • Page 3: Introduction

    Notes on Printer Firmware Revisions (Including Flash) Able Systems reserves the right to modify and improve the firmware in its products at any time. Whilst every effort is made to ensure backward compatibility, no guarantee in this respect is given or implied.
  • Page 4: Modes Of Operation

    3. Modes of Operation Please refer to the Installers’ Guide for an overview of the modes of operation, including idle mode and spool mode (where applicable). Some of the host-selectable features may be retained during power off by storage in non-volatile memory (FLASH), but the others are lost.
  • Page 5: Built-In Fonts

    Built-In Fonts The built-in font characters are formed according to the Font Mode: Font Chars/Line Character Height Row Height Mode 24 dots (3.00 mm) 30 dots (3.75 mm) 24 dots (3.00 mm) 30 dots (3.75 mm) 24 dots (3.00 mm) 30 dots (3.75 mm) 24 dots (3.00 mm) 24 dots (3.00 mm)
  • Page 6: Serial Interface

    Serial Interface The default serial interface format for the Ap1400 series printers is 9600 baud, 8 data bits, 1 stop bit and no parity. Other formats can be programmed into the printer at the factory or in the field, from the host.
  • Page 7: Usb Interface

    USB Interface The Ap1400 printer has a full speed USB client interface allowing the unit to be connected to a Windows based host via USB allowing simple configuration and access. There are two ways of printing from the Ap1400; Spool printing. This is the way a ‘standard’ desktop printer works and will enable you to print in the normal way from applications such as Word, Excel or any other application that supports spool printing.
  • Page 8: Control Code Tables

    4. Control Code Tables General Notes: All codes from 00 to 1F which are not listed below are ignored. An ESC, GS etc code followed by an unrecognised command is ignored, but any following parameters are interpreted as normal characters. Any ESC, GS etc sequence which is described below but which has an illegal parameter is abandoned at that point.
  • Page 9: Command Codes Received

    To assist programmers in converting existing host software, the following codes are used: Fully supported as in EPSON ESCPOS Altered functionality compared with ESCPOS Able special code, no ESCPOS equivalent exists Setting may be retained in non-volatile [FLASH] memory ESC,"L"...
  • Page 10: Graphics Commands

    Graphics Commands ESC,"*",.. 1BH,2AH,m,n1,n2,d1...dk Dot-Addressable (Bit) Graphics Several modes of Dot Addressable Graphics are possible: In all modes dot patterns are coded as 1= dot, 0= space, patterns are arranged in dot-columns, and the MSBit of each byte is printed at the top. The number of dot columns is given by (n1+ 256*n2). When the third byte, m=0 or 2 (00H or 02H): Doubled-up 8 dot graphics [ k = n1+ 256*n2 ]...
  • Page 11: Formatting Commands

    Formatting Commands ESC,"-".. 1BH,2DH,n Turn underline on/off If n=0: Underlining is turned off; otherwise is turned on. ESC,"2" 1BH,32H Set default Row Height Set default row height. ie:-30 (0.125mm) dots in Font Mode 0,1 and 2; 24 dots in Font Mode 3; and 16 dots in Font Mode 4.
  • Page 12: Formatting Commands (Continued)

    Formatting Commands (Continued) HTAB Horizontal Tab Default positions: 8,16,24,32,40; 6 positions available; programmed using ESC,D command. Ignored if off the end of a line. The first HTAB does not move from a HTAB position to the next: e.g. 1234567890123456 123456 T (1 Tab before "T") 1234567T (1 Tab before "T")
  • Page 13: Initialise And Request Status Commands

    Initialise and Request Status Commands ESC,"@" 1BH,40H Initialise printer Clears print parameters to power-on default, ie normal width and height, no underline, no extra space, and default tabs. Does not affect the inverted mode. Not real-time, executed in data sequence (unlike CAN). (Real time) Abort printing and initialise Same result as ESC,'@' but executed immediately when received.
  • Page 14: Initialise And Request Status Commands (Continued)

    Initialise and Request Status Commands (Continued) GS,"a",.. 1DH,61H,n Enable/Disable automatic status Defines the conditions under which the STATUS byte is transmitted without explicit request from the host. A bit set in ‘n’ causes the STATUS to be sent whenever the corresponding bit in the STATUS byte changes state (see CODES TRANSMITTED for format).
  • Page 15: Barcode Commands

    However, some additional EPSON ESCPOS commands are recognised, and an attempt is made to decode them, so that following commands will remain in synchronism and correctly interpreted. Please refer to Able Systems in case of difficulty. Ref: "Ap1400ProgGuide1_2.docx"...
  • Page 16: Codes Transmitted

    Codes Transmitted The printer automatically transmits XON and XOFF bytes when the buffer status changes, as follows: Start transmission Meaning: The buffer is ready to receive data. Transmitted after a reset, or when the data buffer empties to only 1/4 full. XOFF Stop transmission Meaning: The buffer is not ready to receive data.
  • Page 17: Settings And Configuration

    The printer maintains a large number of internal settings and configuration information which is not derived from ESCPOS control codes, and is unique to Able Systems printers. In general, the ESC,"X",m,... command is used to set these values, and the GS,"I",m command is used to query them.
  • Page 18 The printer automatically slows the paper feeding to allow all the dots to be printed. Therefore, reducing the value of MaxDotsAtOnce also reduces the overall print speed. The default value for the Ap1400 is 08H. Refer to the factory if more information is required. Ref: "Ap1400ProgGuide1_2.docx"...
  • Page 19: Saving Configuration Information

    N.B. This value is disabled, and no splitting occurs, if bit4 of Internal Defaults (m=9) is clear. m=42 Set EjectOffset value. The command ESC,"X",2AH,n sets the value of EjectOffset. This parameter is used in Mark Sense operation. See MARK SENSE OPERATION section for details. m=48 Save all settings to Flash.
  • Page 20: Querying Configuration Information

    [ eg:- 43H means 6.7V ] n2 = Printhead temperature in ºC [ eg:- 14H means 20ºC ] m=18 Report LED patterns. Please refer to Able for details if required. m=19 Report MT102FLAGS value. m=20 Report MarkFeed and EjectFeed values.
  • Page 21: Command Summaries

    6. Command Summaries Summary of Print Format Commands and Volatile Settings Function Command Clear Print Settings and Buffer ESC,”@” (Select single width, single height, no underlining, no extra inter- (real-time) character space, and default HTAB positions) Font Mode, Double Height, Double Width, Underlining ESC,"!",n Underlining only ESC,"-",n...
  • Page 22: Summary Of Non-Volatile Settings

    AUTO_STATUS settings GS,”a”.. A simple Windows setup program is available from Able on request allowing a printer to be configured via a suitable RS232 (or alternatively USB to RS232 converter) cable. Please refer to Able Systems or visit our website at www.able-systems.com for more information.
  • Page 23: Setting Up Usb Functionality

    7. Setting up USB functionality In order to take advantage of the USB functionality of the Ap1400, drivers must be installed on the Windows based machine you wish to use the printer with. First you must install LIBUSB, and then you should install the USBPrintDLL interface in order to take advantage of Able Systems’...
  • Page 24: Installing Usbprintdll

    When complete, the utility will display the completion message. Click Ok and then ‘cancel’ to exit the utility. Driver install is now complete. Once the driver has been installed, disconnect the USB lead from the Ap1400, wait for 5 seconds then reconnect.
  • Page 25: Testing The Libusb Install

    (Note: It may be necessary to scroll down to find the printer if more than one filter driver is installed.) When the printer is disconnected then the dialog display will change and the entry for the Ap1400 will be removed (see below).
  • Page 26: The Usbprintdll Interface

    Get the USBPrintDll full version information DllInitialise Initialise the USBPrint subsystem and LIBUSB drivers EnumPrinters Enumerates all the available USB printers with an ABLE vendor ID GetEnumPrinterCount Gets the number of printers currently in an enumerated state ClearEnumList Clears all enumerations of printer on the USB...
  • Page 27 GetDllVersion Get the USBPrintDll full version information Prototype SUSBPrintVersion WINAPI GetDllVersion(void); Description This function returns the full version information of the USBPrintDll. This function has no activity on the USB bus and is provided for tracing purposes. An application should check this version number before accessing the USB bus to ensure correct alignment between builds.
  • Page 28 DllInitialise Initialise the USBPrint subsystem and LIBUSB drivers Prototype WINAPI DllInitialise(void); Description This function prepares the LIBUSB subsystem and the USB bus for access. It loads all necessary LIBUSB dll’s and initialises them. This function must be called once only, prior to any other access of USBPrintDll functionality (except GetDllVersion). In a foundation class application this call is best placed in the InitInstance function of the CWinApp class.
  • Page 29 Prototype WINAPI EnumPrinters(void); Description Enumerates all available printers present on the USB with a valid ‘Able Systems’ vendor ID. All control structures for each device found, are built and initialised from the printer supplied control information blocks. This function must be called prior to accessing an individual, or group of printers.
  • Page 30 GetEnumPrinterCount Gets the number of printers currently in an enumerated state Prototype WINAPI GetEnumPrinterCount(void); Description Returns the number of printers currently in an enumerated state or 0 for none. This function does not guarantee that the number of printers enumerated are still active.
  • Page 31 ClearEnumList Clears all enumerations of printer on the USB Prototype WINAPI ClearEnumList(void); Description Clears the list to all enumerated printers. All memory associated with the printer is released, and any open handles are closed. All active pipes to printers are terminated and communication to any active printer will be lost.
  • Page 32 GetVendor Gets the vendor ID of an enumerated device Prototype DWORD WINAPI GetVendor(int iIndex); Description Retrieves the vendor id of the device as a doubleword value. Vendor Id’s are specific to usb device manufactures and can be used in the identification of a device.
  • Page 33 GetProduct Gets the product ID of an enumerated device Prototype DWORD WINAPI GetProduct(int iIndex); Description Retrieves the product id of the device as a doubleword value. product Id’s are specific to usb device manufacture’s individual products and can be used in the identification of a device.
  • Page 34 GetName Gets the enumerated name of an enumerated device Prototype LPSTR WINAPI GetName(int iIndex); Description Retrieves the enumerated name for the device referenced by iIndex. An enumerated name is a manufactured name made up of the driver name, vendor id, product id & a reference number ensuring that each name on the USB is unique. The name can be up to 512 bytes long although more normally it will be between 20~40 characters.
  • Page 35 OpenDevice Opens a device and prepares it to send/receive data Prototype WINAPI OpenDevice(int *pIndex); Description Opens a device and associates a unique handle with the device. An open device has the whole interface claimed(all control points & endpoints) making its use exclusive to the handle holder.
  • Page 36 CloseDevice Closes and releases a device and associated handle Prototype WINAPI CloseDevice(int *pHandle); Description. Closes a device and releases the resources associated with the device. Once closed the handle is invalidated and should be discarded. Arguments phandle – Pointer to the handle of an open device. This handle must have been issued by a previous call to OpenDevice.
  • Page 37 SendData Send data to a device Prototype WINAPI SendData(int iHandle, LPCTSTR pData, LPINT pDataLen, iTimeout); Description. Sends data to a device with flow control. There is no practical limit on the amount of data that can be sent, but the call is synchronous and will not return until either the data send is completed, a timeout occurs, or an error occurs.
  • Page 38 ReadData Read data transmitted from a device Prototype WINAPI ReadData(int iHandle, LPSTR pData, LPINT pLen); Description. Reads data from a device into the supplied buffer. If there is no data to retrieve, then ReadData will wait for a small period of time(typically 1000m/s) before returning.
  • Page 39 – Handle of an open device. This handle must have been issued by a previous call to OpenDevice. iReqtype-The request type. For the Ap1400 this value will always be USB_TYPE_CLASS|USB_RECIP_DEVICE|USB_ENDPOINT_IN. iRequest-The high level command request. Supported user requests are...
  • Page 40 SendCtrl (Continued) Example The following example shows a ctrl call to retrieve the print buffer status TCHAR cReturn; iRetLen=sizeof(TCHAR); //Check the buffer state DWORD dwStatusCode=SendCtrl(iHandle, USB_TYPE_CLASS|USB_RECIP_DEVICE|USB_ENDPOINT_IN, USB_BUFFERSTATE, &iRetLen, &cReturn); if(dwStatusCode!=ERROR_SUCCESS) TRACE(_T("Buffer state get Failed...\n")); CString csError; csError.Format(_T("GetBufferState failed - Reason=%d."), dwStatusCode);...
  • Page 41 SendStatusReq Get the current device status byte Prototype UCHAR WINAPI SendStatusReq(LPINT pHandle); Description. SendStatusReq provides a simple, easy to use method of receiving the printer status byte. The function sends a control request (refer to SendCtrl for a fuller description). The function is a ‘real time’...
  • Page 42 //Close the printer CloseDevice(&m_iOpenHandle); return; You are always welcome to contact Able Systems or your local supplier for specific assistance. We would also appreciate reports of any errors in our documentation, or suggested improvements. For technical support please contact: Support@Able-Systems.com or call +44 (0) 1606 48621 and select option 4 for Technical Support.

This manual is also suitable for:

Ap1400v

Table of Contents