EPSON Advanced Printer Driver for TM series Status API Reference Manual Revision L Seiko Epson Corporation
Notes (1) Reproduction of this documentation by any means in part or in whole is prohibited. (2) Contents of this documentation are subject to change without notice. (3) Epson will not be responsible for any consequences resulting from the use of any information in this documentation. (4) Comments and notification of any mistakes in this documentation are gratefully accepted.
Contents 1. INTRODUCTION ................................................................................................................................................................1 1.1. 2. OPERATING ENVIRONMENT ........................................................................................................................................3 2.1. 2.2. 2.3. 3. Modification from the old version.....................................................................................................
3.40. 3.41. 3.42. 3.43. 3.44. 3.45. 3.46. 3.47. 3.48. 3.49. 3.50. 3.51. 3.52. 3.53. 3.54. 3.55. 3.56. 3.57. 3.58. 3.59. 3.60. 3.61. 3.62. 3.63. 3.64. 3.65. 3.66. 3.67. 3.68. 3.69. 3.70. 3.71. 3.72. 3.73. 3.74. 4. LOG COLLECTION FUNCTION.................................................................................................................................101 4.1. 4.2. 4.3. 5. BiSCNSetReadBackFunction..................................................................................................
1.Introduction Status API is a program that offers an Application Program Interface for obtaining the printer and presenter status during printing and when not printing, in conjunction with the TM printer drivers made by Epson. By using this API, printer status handling functions can be integrated more simply with applications. This manual explains concerning the Status API.
- When using StatusAPI with a USB, possible blue screen problem is corrected. (Windows98SE/2000) Problem of a blue screen when the power of a printer connected to a USB is repeatedly turned on and off is corrected. (Windows98SE/2000) Ver2.04 - Supported of the TM-U590 - The following functions related to Check Scanner have been added.
2. Operating Environment 2.1. Operating System This software supports the following operating systems. • Microsoft Windows 95 Ennglish (OSR2 or later) • Microsoft Windows 98 Ennglish • Microsoft Windows NT 4.0 Ennglish • Microsoft Windows 2000 Ennglish • Microsoft Windows XP Ennglish 2.2. Computer This software supports computers, which the above operating systems run on. • AT Compatible Computers 2.3. Printers This software is compatible with the printer in the following table.
TM-U210D TM-H6000 TM-H6000II TM-J2000/2100 TM-J7000/7100 EPSON TM- U210D Receipt EPSON TM-H6000 Receipt EPSON TM-H6000 Reduce35 EPSON TM-H6000 Slip EPSON TM-H6000 Endorse EPSON TM-H6000II Receipt EPSON TM-H6000II Reduce35 EPSON TM-H6000II Slip EPSON TM-H6000II Endorse EPSON TM- J2000/2100 Receipt EPSON TM- J2000/2100 Reduce35 EPSON TM- J2000/2100 Reverse EPSON TM- J7000/7100 Receipt EPSON TM- J7000/7100 Reduce35 EPSON TM- J7000/7100 Slip EPSON TM- J7000/7100 Endorse TM-J8000 TM-H3000R EPSON TM-J8000
! When connecting to a serial cable, use the following wiring Cable wiring which can be used Printer side User side D-sub25 Connector Signal Pin Number name Signal name D-sub9 Connector Pin 8 (NC) DCD 1 3 RxD RxD 2 2 TxD TxD 3 20 DTR DTR 4 7 SG SG 5 6 DSR DSR 6 4 RTS RTS 7 5 CTS CTS 8 22 (NC) RI 9 Number Furthermore, there is one more wiring structure of the cable, which cannot be used.
3.Status API 3.1. Outline The following functions are provided in the Status API.
BiSCNDeleteCroppingArea BiSCNDeleteImage # BiSCNGetImageList # BiSCNGetImageRemainingCapacity ••• ••• ••• ••• BiESCNEnable() BiESCNGetDocumentSize() # BiESCNSetDocumentSize() # BiESCNGetAutoSize() ••• ••• ••• ••• # # # # # BiESCNSetAutoSize() ••• # BiESCNGetCutSize() ••• # # BiESCNSetCutSize() BiESCNGETRotate() ••• ••• # BiESCNSetRotate() ••• # # BiESCNDefineCropArea() BiESCNGetMaxCropAreas() BiESCNStoreImage() BiESCNRetrieveImage() BiESCNClearImage() BiESCNGetRemainingImages() BiOpenDra
3.1.1. Acquiring the Status Using BiGetStatus Using BiGetStatus, the application can acquire the printer’s status when necessary as shown in the following figure. F low of Status using B iG etStatus Application Status M onitor A PI B iO penM onPrinter() Printer Status N ew Status B iG etStatus() Status C hange B iG etStatus() N ew Status • If the monitored printer is opened by BiOpenMonPrinter(), Status API reads the printer status at that point in time.
3.1.3.Acquiring the Status Using BiSetStatusBackWnd Flow of the Status U sing BiSetStatusBackW nd Application Status M onitorAPI BiOpenM onPrinter() Printer Status BiSetStatusBackW nd() Button Click Event Button Click Event N ew Status Status Change BiCancelStatusBack() If you are acquiring auto status notification by a language which does not support callback functions like Microsoft Visual Basic 5.0 32-bit with Office Service Pack 3, use BiSetStatusBackWnd.
3.2. Printer Statuses that Can Be Acquired In Status API, using the Automatic Status Back command supported by TM printers, the following statuses are acquired and offered to the application. The acquired status changes into the DWORD value and notifies the application. ON/OFF of each bit with the value of DWORD corresponds to each printer status like the table below.
3.3.Scanning Data Processing Overview 3 Image Data Reading (current functions) BiESCNEnable(): Enables Scanner functions extended. Execute BiSCNReadImage() orBiSCNRetransmissionImage (). Abnormal end. Normal end. Notification of reading failure. No image data made. Notification of reading (callback). Image data made (option). Reading result 4, 5 BiESCNGetDocumentSize()/Bi ESCNSetDocumentSize(): Acquires/selects the width and height of read data. Scanner functions extended.
3.4.Scanning Data Processing 1 2 Cut the black part as much as possible using AutoSize processing. Image reading result. EPSON 3 Cut the left and right sides of the image using CutSize processing. TITLE EPSON Advanced Printer Driver for TM series StatusAPI Reference Manual 4 Rotate the image 90° clockwise.
3.5. BiOpenMonPrinter [Function] This opens the printer for which the status is being monitored. [Format] int BiOpenMonPrinter (int nType, LPSTR pName): [Argument] int nType This specifies the type of name specified in pName. One of the following two types is specified. TYPE_PORT The port name is specified in pName. TYPE_PRINTER The printer name is specified in pName. LPSTR pName This specifies the printer that is opened. The specification is as follows, depending on the nType value.
3.6. BiGetStatus [Function] Acquires the current printer status. [Format] int BiGetStatus (int nHandle, LPDWORD lpStatus); [Argument] int nHandle Specify the handle value of the printer you are acquiring the status of. For the handle value, use the value returned by BiOpenMonPrinter(). LPDWORD lpStatus The current status of the printer is set. [Return Value] If acquisition of the printer’s status was successful, a 0 is returned.
3.7. BiSetStatusBackFunction [Function] This registers the called callback function on the occasion of Automatic Status Back. [Format] int BiSetStatusBackFunction (int nHandle, int (CALLBACK EXPORT *pStatusCB)(DWORD dwStatus)); [Argument] int nHandle This specifies the handle value of the printer for which the status is monitored. The BiOpenMonPrinter() return value is used as the handle value. int (CALLBACK EXPORT *pStatusCB) (DWORD dwStatus) Sets the callback function’s address.
3.8. BiSetStatusBackWnd [Function] This registers a Windows handle for a button which sends a click even when there is an Automatic Status Back, and registers an address in memory where the status information is set. [Format] int BiSetStatusBackWnd (int nHandle, long hWnd, LPDWORD lpdwStatus); [Argument] int nHandle This specifies the handle value of the printer for which the status is to be acquired. The value returned from BiOpenMonPrinter() is used as the handle value.
3.9. BiCancelStatusBack [Function] This cancels Automatic Status Back registered by BiSetStatusBackFunction() or BiSetStatusBackWnd(). [Format] int BiCancelStatusBack (int nHandle); [Argument] int nHandle Specifies the handle value for the printer for which Automatic Status Back is being canceled. The value returned from BiOpenMonPrinter() is used as the handle value. [Return Value] If cancellation of Automatic Status Back was successful, a 0 is returned.
3.10. BiDirectIO [Function] This carries out reading and writing of data with the specified printer. [Format] int BiDirectIO (int nHandle, BYTE writeLen, LPBYTE writeCmd, LPBYTE readLen, LPBYTE readBuff, DWORD timeout, BOOL nullTerminate); [Argument] int nHandle Specifies the handle value of the printer being accessed. The value returned from BiOpenMonPrinter() is used as the handle value. BYTE writeLen This specifies the length of data (length of the command) written to the printer.
3.11. BiDirectIOEx [Function] This carries out reading and writing of data with the specified printer. No ASB disable command is added. [Format] int BiDirectIOEx( int nHandle, DWORD writeLen, LPBYTE writeCmd, LPDWORD readLen, LPBYTE readBuff, DWORD timeout, BOOL nullTerminate, BYTE option) ; [Argument] int nHandle Specifies the handle value of the printer being accessed. The value returned from BiOpenMonPrinter() is used as the handle value.
• While monitoring printer status, do not use this function to send the ASB status transmit disable command (GS a), or it will make it impossible to acquire status. • The BiDirectIOEx ASB (Auto Status Back) suppress specification is specified so that a response other than the expected response (such as Status) will not be received if a command is sent for which a response is expected from the printer.
3.12. BiResetPrinter [Function] Resets the status monitor printer. [Format] int BiResetPrinter (int nHandle); [Argument] int nHandle Specifies the handle value of the printer to be reset. The BiOpenMonPrinter() return value is used in the handle value. [Return value] 0 is returned when printer reset is successful. The following error codes (less than zero) are returned when an error is triggered. ERR_HANDLE The handle value specified for the printer is incorrect.
3.13.BiGetOfflineCode [Function] Acquires the bit that indicates the reason for being off-line. [Format] int BiGetOfflineCode(int nHandle, LPBYTE offlinecode); [Argument] int nHandle Specifies the handle value of the printer being accessed. The BiOpenMonPrinter() return value is used in the handle value. LPBYTE offlinecode Sets the bit that indicates the reason for being off-line. [Return value] 0 is returned when printer reset is successful.
6 7 Fixed Fixed Bit Function Fixed at 1 Fixed at 0 Byte 3 0 1 2 3 4 5 6 7 Thermistor error Print head high voltage error Print head low voltage error RTC error Number of carriage operations error Number of pump operations error Fixed Fixed Bit Function Value 0 Not occurred Not occurred Not occurred Not occurred Not occurred 1 Occurred Occurred Occurred Occurred Occurred Not occurred Occurred Fixed at 1 Fixed at 0 Byte 4 0 1 2 3 4 5 6 7 Auto cutter error Paper roll cover open error (recover au
5 6 7 Not defined Fixed Fixed Bit Function 0 1 2 3 4 5 6 7 High voltage error Low voltage error Overcurrent error Not defined Not defined Not defined Fixed Fixed Bit Function 0 1 2 3 4 5 6 7 7 Thermistor error Not defined Not defined Not defined Not defined Not defined Fixed Fixed Fixed Bit Function Fixed at 0 Fixed at 1 Fixed at 0 Byte 2 Value 0 1 Not occurred Occurred Not occurred Occurred Not occurred Occurred Fixed at 0 Fixed at 0 Fixed at 0 Fixed at 1 Fixed at 0 Byte 3 Value 0 1 Not occur
6 7 Fixed Fixed Fixed at 1 Fixed at 0 [Supported printer] TM-J2000/2100, TM-J7000/7100, TM-T90, TM-L90 (In all cases, they are enabled when there is not a Ethernet connection.
3.14. BiGetCounter [Function] Acquires the maintenance counter. [Format] int BiGetCounter(int nHandle, BYTE readno, LPDWORD readcounter); [Argument] int nHandle Specifies the handle value of the printer being accessed. The BiOpenMonPrinter() return value is used in the handle value. BYTE readno Specifies the number of the maintenance counter. LPWORD readcounter Sets the maintenance counter value. [Return value] 0 is returned when printer reset is successful.
[Explanation] In the TM-H5000II, a maintenance counter is assigned as shown below. Depending on the model, there are counter values which cannot be acquired, but please read the product specifications for each model. Counter No.
3.15. BiResetCounter [Function] Resets the maintenance counter. [Format] int BiResetCounter(int nHandle, BYTE writeno) [Argument] int nHandle Specifies the handle value of the printer being accessed. The BiOpenMonPrinter() return value is used in the handle value. BYTE writeno Specifies the number of the maintenance counter. [Return value] 0 is returned when printer reset is successful. The following error codes (less than zero) are returned when an error is triggered.
3.16. BiCancelError [Function] Restores recoverable printer errors. [Format] int BiCancelError(int nHandle) [Argument] int nHandle Specifies the handle value of the printer being accessed. The BiOpenMonPrinter() return value is used in the handle value. [Return value] 0 is returned when printer reset is successful. The following error codes (less than zero) are returned when an error is triggered. ERR_HANDLE The handle value specified for the printer is incorrect. ERR_TIMEOUT A time out error occurred.
3.17. BiGetType [Function] Acquires the printer’s type ID. [Format] int BiGetType(int nHandle, LPBYTE typeid, LPBYTE font, LPBYTE exrom, LPBYTE euspecial); [Argument] int nHandle Specifies the handle value of the printer being accessed. The BiOpenMonPrinter() return value is used in the handle value. LPBYTE typeid Sets the printer’s type ID (refer to the list of type IDs.) LPBYTE font Sets the font mounted on the printer (refer to the list of installed fonts.
[Explanation] The values are listed below.
2 3 4 5 6 7 DM-D connection Equipped with MICR Equipped with Scanner Equipped with endorse printer Not used Not used OFF Without Without Without ON With With With Fixed at 1 Fixed at 0 Installed Fonts For the TM-H5000II, TM-H6000, TM-H6000II, TM-T88II, TM-T88III, TM-T90, TM-T90 Value Installed Font 00h Not clear 01h ANK only 02h Japanese Kanji (JIS) 03h Chinese Kanji (Simplified Chinese GB 2312) 04h Taiwan Kanji (Traditional Chinese BIG-5) 05h Thai Characters (3-pass) Depending on the model, no installe
3.18. BiGetInkStatus [Function] Acquires the current ink status. [Format] int BiGetInkStatus( int nHandle, LPDWORD Status) ; [Argument] int nHandle Specifies the handle value for the printer whose status is being acquired. The return value of BiOpenMonPrinter() is specified in the handle value. LPDWORD Status The current ink status is set. [Return Value] If execution is successful, 0 is returned. If an error occurs, the following error codes (negative values) are returned.
3.19. BiSetInkStatusBackFunction [Function] Registers a callback function output when calling for ink status notification. [Format] int BiSetInkStatusBackFunction( int nHandle, int (CALLBACK EXPORT *pStatusCB)(DWORD dwStatus)) ; [Argument] int nHandle Specifies the handle value for the printer whose status is being acquired. The return value of BiOpenMonPrinter() is specified in the handle value. int (CALLBACK EXPORT *pStatusCB)(DWORD dwStatus) Sets the address of the callback function.
3.20. BiSetInkStatusBackWnd [Function] Registers a memory address which sets the window handle of the button which sends click events and sets status information when there is an ink status notification. [Format] int BiSetInkStatusBackWnd( int nHandle, long hWnd, LPDWORD lpdwStatus) ; [Argument] int nHandle Specifies the handle for the printer whose ink status is being acquired. The return value of BiOpenMonPrinter() is specified in the handle value.
3.21. BiCancelInkStatusBack [Function] Cancels the ink status notification registered in BiSetInkStatusBackFunction() or BiSetInkStatusBackWnd(). [Format] int BiCancelInkStatusBack( int nHandle ) ; [Argument] int nHandle Specifies the handle value for the printer whose ink status notification is being canceled. The return value in BiOpenMonPrinter() is specified in the handle value. [Return Value] If execution is successful, 0 is returned.
3.22. BiMICRSetReadBackFunction [Function] Executes reading of checks by BiMICRReadCheck and registers the address of the callback function when the results are notified as well as the memory addresses where each type of information read from the check is set. [Format] int BiMICRSetReadBackFunction( int nHandle, int (CALLBACK EXPORT *pMicrCB)(void),LPBYTE pReadBuffSize, LPBYTE readCharBuff, LPBYTE pStatus, LPBYTE pDetail) [Argument] int nHandle Specifies the handle value of the executing printer.
For the TM-H6000, TM-H6000II Bit Function 0 Reading font 1 Reserved 2 Reserved 3 Detailed information 4 Reread 5 Reading results 6 Reading data overflow 7 Fixed For the TM-H5000II, TM-U675 Bit Function Value 0 E13B 1 CMC7 Fixed at 0 Fixed at 0 Not added Enabled Normal end No Added Disabled Abnormal end Yes Fixed at 0 Value 0 0 1,2,3 4 5 6 7 Reading font Reserved Reread Reading results Reading data overflow Fixed 1 E13B CMC7 Fixed at 0 Enabled Normal end No Disabled Abnormal end Yes Fixed at 0
• Be sure to call this function before calling the BiMICRReadCheckfunction. An error will be returned if the BiMICRReadCheckfunction is called before this function is called. • Depending on the printer model (firmware version), the detailed information after there is a reading error may not be supported. In that case, nothing will be set. • If the reading data overflows, bit 6 of the MICR reading status goes ON (reading data overflow).
3.23. BiMICRSetReadBackWnd [Function] Executes check reading by BiMICRReadCheck, registers the handle of a button which sends the button’s click event when the results are notified, and registers the memory addresses where each type of reading information is set. [Format] int BiMICRSetReadBackWnd( int nHandle, long hWnd, LPBYTE pReadBuffSize, LPBYTE readCharBuff, LPBYTE pStatus, LPBYTE pDetail) [Argument] int nHandle Specifies the handle value of the printer executing the operation.
3.24. BiMICRSelectDataHandling [Function] Selects the check reading operation. [Format] int BiMICRSelectDataHandling( int nHandle, BYTE charSelect, BYTE detailSelect, BYTE errorSelect) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. BYTE charSelect Specifies handling of characters that cannot be analyzed.
3.25. BiMICRReadCheck [Function] Executes check reading. If 0 is specified for the check insertion wait time, the printer’s wait time is canceled. Furthermore, the check insertion wait time after MICR reading is finished is reset to 0, the printer’s default value. [Format] int BiMICRReadCheck( int nHandle, BYTE readFont, BYTE waitInsertionTime) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified.
3.26. BiMICRCancelWaitCheckInsertion [Function] Cancels check insertion wait. [Format] int BiMICRCancelWaitCheckInsertion(int nHandle) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. [Return Values] If execution is successful, 0 is returned. If an error occurs, the following error codes (negative values) are returned. ERR_ HANDLE The handle value that specifies the printer is incorrect.
3.27. BiMICRCancelReadBack [Function] Cancels a reading information notification request registered using BiMICRSetReadBackFunction() or BiMICRSetReadBackWnd(). [Format] int BiMICRCancelReadBack( int nHandle) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. [Return Values] If execution is successful, 0 is returned. If an error occurs, the following error codes (negative values) are returned.
3.28. BiMICRRetransmissionCheckData [Function] Resends the check reading results. [Format] int BiMICRRetransmitionCheckData( int nHandle, LPBYTE pReadBuffSize, LPBYTE readCharBuff, LPBYTE pStatus, LPBYTE pDetail, DWORD timeout) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. LPBYTE pReadBuffSize Specifies the size of memory where the reading data are set.
3.29. BiMICRGetStatus [Function] Acquires the MICR status. [Format] int BiMICRGetStatus( int nHandle, LPBYTE pStatus) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. LPBYTE pStatus Specifies the memory address where the MICR status is set. See the following MICR states concerning the types of MICR status that are returned. [Return Values] If execution is successful, 0 is returned.
3.30. BiMICREjectCheck [Function] Ejects the check when the MICR function is selected. [Format] int BiMICREjectCheck( int nHandle) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. [Return Values] If execution is successful, 0 is returned. If an error occurs, the following error codes (negative values) are returned. ERR_ HANDLE The handle value that specifies the printer is incorrect.
3.31. BiMICRLoadCheck [Function] Loads the check to the check print start position when the MICR function is selected. [Format] int BiMICRLoadCheck( int nHandle) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. [Return Values] If execution is successful, 0 is returned. If an error occurs, the following error codes (negative values) are returned.
3.32. BiMICRCleaning [Function] Cleans the MICR mechanism. [Format] int BiMICRCleaning( int nHandle) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. [Return Values] If execution is successful, 0 is returned. If an error occurs, the following error codes (negative values) are returned. ERR_ HANDLE The handle value that specifies the printer is incorrect. ERR_NOT_SUPPORT Not supported by this printer.
3.33.BiSCNSetImageQuality [Function] Sets the image scanning quality. Furthermore, the value set with this function is valid until the printer’s power is turned OFF or until the printer is reset. [Format] int BiSCNSetImageQuality( int nHandle, BYTE bColorDepth, char bThreshold, BYTE bColor, BYTE bExOption) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified.
3.34.BiSCNSetImageFormat [Function] Sets the format of the scanning image data. Furthermore, the value set with this function is valid until the printer’s power is turned OFF or until the printer is reset. [Format] int BiSCNSetImageFormat( int nHandle, BYTE bFormat) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. BYTE bFormat Specifies the format of image data notified.
3.35.BiSCNSetScanArea [Function] Sets the image scanning area. Furthermore, the values set with this function remain in effect until the printer’s power is turned off or until the printer is reset. [Format] int BiSCNSetScanArea( int nHandle, BYTE bStartX, BYTE bStartY, BYTE bEndX, BYTE bEndY) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. BYTE bStartX Specifies the starting X coordinate of the scanning area.
3.36.BiSCNPreScan [Function] This sets the printer’s density threshold value after prescanning of the image and returns the set density threshold value. (An image can be scanned at the threshold value obtained from the prescan operation only in the case that this function is called and the image is scanned without ejecting the paper (BiSCNSetImageQuality).
3.37.BiSCNGetImageQuality [Function] Acquires the scanning quality of the image set in the printer. [Format] int BiSCNGetImageQuality( int nHandle, LPBYTE pColorDepth, char *pThreshold, LPBYTE pColor, LPBYTE pExOption) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. LPBYTE pColorDepth Specifies the memory address where the tonal gradation is set.
3.38.BiSCNGetImageFormat [Function] Acquires the format of the image set in the printer. [Format] int BiSCNGetImageFormat( int nHandle, LPBYTE pFormat) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. LPBYTE pFormat Specifies the memory address where the format of the notified image data is set. The set value is as shown below. EPS_BI_SCN_TIFF(1) : TIFF format CCITT (Group 4) compressed data.
3.39.BiSCNGetScanArea [Function] Acquires the image scanning area specified in the printer. [Format] int BiSCNGetScanArea( int nHandle, LPBYTE pStartX, LPBYTE pStartY, LPBYTE pEndX, LPBYTE pEndY) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. LPBYTE pStartX Specifies the memory address where the starting X coordinate of the scanning area is set.
3.40.BiSCNSetReadBackFunction [Function] Executes image scanning by the function BiSCNReadImage and registers the callback function’s address called when sending notification of the results as well as the memory addresses for setting each type of scanned information.
Detailed Image Information For the TM-H6000II Value Information 40h No error. 41h The image scanning result do not exist. 44h The cover was opened, so image scanning was interrupted. 45h A recoverable error/automatic reset error occurred during image scanning. 46h Paper which is not the standard length was inserted (longer than approximately 333 mm). 47h Compressed data error (The amount of data increased in data compression processing, and there was insufficient memory.
3.41.BiSCNSetReadBackWnd [Function] This function executes image scanning with the BiSCNReadImage function and registers the memory address for the handle of the button where button click events are sent when sending notification of the scanning results as well the memory addresses for setting each type of information.
3.42.BiSCNCancelReadBack [Function] Cancels the scanning information notice request registered using BiSCNSetReadBackFunction ( ) or BiSCNSetReadBackWnd ( ). [Format] int BiSCNCancelReadBack( int nHandle) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. [Return Values] If execution is successful, 0 is returned. If an error occurs, the following error codes (negative values) are returned.
3.43.BiSCNReadImage [Function] Executes image scanning. If 0 is specified for the paper insertion wait time, the printer wait time is canceled. [Format] int BiSCNReadImage( int nHandle, WORD wId, BYTE bSelectSheet, BYTE bWaitInsertionTime, BYTE bAddInforDataSize, LPBYTE pAddInforData, BYTE bMemory) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. WORD wId Specifies the data identifier related to the scanned image.
[Caution] • If this function is executed for the TM-H6000II, which is not equipped with a scanner, it ends normally, but image scanning is not executed. • Before using this function, be sure to register it using either BiSCNSetReadBackFunction or BiSCNSetReadBackWnd. • After image scanning is completed, the check paper insertion read time is reset to the default value 0. • If the data identifier that is already present is specified, the saved image is deleted and replaced with a new image.
3.44.BiSCNRetransmissionImage [Function] Retransmits the image scanning results. [Format] int BiSCNRetransmissionImage( int nHandle, WORD wId, LPDWORD pBuffSize, LPBYTE pBuff, LPBYTE pImageXsize, LPBYTE pStatus, LPBYTE pDetail, DWORD dwTimeout) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. WORD wId Specifies the data identifier related to the scanned image.
3.45.BiSCNGetClumpStatus [Function] Acquires the clamp status of cut sheets. [Format] int BiSCNGetClumpStatus( int nHandle, LPBYTE pStatus) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. LPBYTE pStatus Specifies the memory address where the cut sheet clamp status is to be stored. See the cut sheet clamp status items shown below concerning the returned status.
3.46.BiSCNClumpPaper [Function] Sets the cut sheet paper in the clamped state. After this function is executed, the printer is set in the cut sheet insertion wait state, then the paper is clamped after it is inserted. If paper is already clamped at this time, nothing is done. [Format] int BiSCNClumpPaper( int nHandle) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified.
3.47.BiSCNSetCroppingArea [Function] Specifies the cropping area. [Format] int BiSCNSetCroppingArea( int nHandle, BYTE bAreaNo, BYTE bStartX, BYTE bStartY, BYTE bEndX, BYTE bEndY) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. BYTE bAreaNo Specifies the cropping area number. The valid setting range is 1~255. BYTE bStartX Specifies the starting X coordinate of the cropping area.
3.48.BiSCNGetCroppingArea [Function] Acquires the cropping area set in the printer. [Format] int BiSCNGetCroppingArea( int nHandle, LPWORD pBuffSize, LPBYTE pBuff) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. LPWORD pBuffSize Specifies the size of memory where the cropping area information is set. The actual size of the scanned data is set.
3.49.BiSCNDeleteCroppingArea [Function] Deletes the cropping area set in the printer. [Format] int BiSCNDeleteCroppingArea( int nHandle, BYTE AreaNo) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. BYTE bAreaNo Specifies the number of the cropping area to be deleted. The valid setting range is 1 ~ 255. If 0 is set, all the cropping areas are deleted. [Return Values] If execution is successful, 0 is returned.
3.50. BiSCNDeleteImage [Function] Deletes the reading result of an image of a specified data ID or deletes the reading result of all data IDs saved at a time. When executing a collective deletion, both the NV memory used for image saving and the reading result of images saved in the work area are deleted. [Format] int BiSCNDeleteImage( int nHandle, WORD wID) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified.
3.51. BiSCNGetImageList [Function] Acquires a data ID list of the reading result of the images saved in the NV memory. If there is no data ID saved, it returns 0 to pListNum. [Format] int BiSCNGetImageList( int nHandle, LPWORD pListNum, LPWORD pIDList) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. pListNum LPWORD Specifies the number of data ID acquired in the data ID list.
3.52. BiSCNGetImageRemainingCapacity [Function] Acquires the remaining capacity (in bytes) of the NV memory for saving the reading result of images. [Format] int BiSCNGetImageRemainingCapacity( int nHandle, LPDWORD pSize) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. pSize LPDWORD Specifies the memory address for setting the remaining capacity of the NV memory for saving the reading result of images.
3.53.BiESCNEnable [Function] Set so that scanner extended functions can be used. [Format] int BiESCNEnable(BYTE bStoreType); [Argument] BYTE bStoreType Select a storing method for a cropped image stored using BiESCNStoreImage(). CROP_STORE_MEMORY(0): Save in memory. CROP_STORE_FILE(1): Save in a file. [Return value] SUCCESS(0) is returned if the execution is successful.
3.54.BiESCNGetAutoSize [Function] Acquire the value of capAutoSize. [Format] int BiESCNGetAutoSize(int nHandle, LPBYTE pCapAutoSize); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. LPBYTE pCapAutoSize Select a memory address to set a capAutoSize value. [Return value] SUCCESS(0) is returned if the execution is successful.
3.55.BiESCNSetAutoSize [Function] Select the value of capAutoSize. [Format] int BiESCNSetAutoSize(int nHandle, BYTE bCapAutoSize); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. BYTE bCapAutoSize Select a value for a capAutoSize. CROP_AUTOSIZE_ENABLE(1): AutoSize processing enabled. CROP_AUTOSIZE_DISABLE(0): AutoSize processing disabled. [Return value] SUCCESS(0) is returned if the execution is successful.
3.56.BiESCNGetCutSize [Function] Acquire the value of cutSize. [Format] int BiESCNGetCutSize(int nHandle, LPWORD pCutSize); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. LPWORD pCutSize Select a memory address to set a cutSize value. [Return value] SUCCESS(0) is returned if the execution is successful.
3.57.BiESCNSetCutSize [Function] Select a value of cutSize. [Format] int BiESCNSetCutSize(int nHandle, WORD wCutSize); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. WORD wCutSize Select size of cutting the left and right sides of the image data (unit: 0.1mm). Selectable range is 0 to 1500. Numbers except “0”: CutSize processing is executed with the selected size. “0”: CutSize processing is not executed.
3.58.BiESCNGetRotate [Function] Acquire the value of capRotate. [Format] int BiESCNGetRotate(int nHandle, LPBYTE pCapRotate); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. LPBYTE pCapRotate Select a memory address to set a capRotate value. [Return value] SUCCESS(0) is returned if the execution is successful.
3.59.BiESCNSetRotate [Function] Select a value of capRotate. [Format] int BiESCNSetRotate(int nHandle, BYTE bCapRotate); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. BYTE bCapRotate Select a value for capRotate. CROP_ROTATE_ENABLE(1): Rotate processing enabled. CROP_ROTATE_DISABLE(0): Rotate processing disabled. [Return value] SUCCESS(0) is returned if the execution is successful.
3.60.BiESCNGetDocumentSize [Function] Acquire the values of documentWidth and documentHeight. [Format] int BiESCNGetDocumentSize(int nHandle, LPWORD pDocumentWidth, LPWORD pDocumentHeight); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. LPWORD pDocumentWidth Select a memory address to set a value of the width of the image data (unit: 0.1 mm).
3.61.BiESCNSetDocumentSize [Function] Select values of documentWidth and documentHeight. [Format] int BiESCNSetDocumentSize(int nHandle, WORD wDocumentWidth); WORD wDocumentHeight); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. WORD wDocumentWidth Select the width of the image data (unit: 0.1 mm). Selectable range is 100 to 3000. WORD wDocumentHeight Select the height of the image data (unit: 0.1 mm).
3.62.BiESCNDefineCropArea [Function] Register CropArea or delete all the CropArea registered. [Format] int BiESCNDefineCropArea(int nHandle, BYTE bCropAreaID, WORD wStartX, WORD wStartY, WORD wEndX, WORD wEndY); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. BYTE bCropAreaID Select CropAreaID to be registered. Selectable values are 1 to 255. CROP_AREA_RESET_ALL(0): All the CropAreas registered are deleted.
[Note] ❑ The number of CropArea data that can be defined is up to 255 (limited item). ❑ The argument unit is 0.1 mm. ❑ If wStartX >= wEndX, wStartY >= wEndY, the error (ERR_PARAM) is returned. ❑ When BiCloseMonPrinter() is being executed, all the data defined in the CropArea definition table are deleted.
3.63.BiESCNGetMaxCropArea [Function] Acquire a maximum number of data of CropArea that can be registered . [Format] int BiESCNGetMaxCropAreas(int nHandle, LPBYTE pMaxCropAreas); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. LPBYTE pMaxCropAreas Select a memory address to set a maximum number of data of CropArea that can be registered. [Return value] SUCCESS(0) is returned if the execution is successful.
3.64.BiESCNStoreImage [Function] Register a Crop image. [Format] int BiESCNStoreImage(int nHandle, DWORD dwFileIndex, LPSTR pFileID,) LPSTR pImageTagData, BYTE bCropAreaID); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. DWORD dwFileIndex Select FileIndex that is identification data of the Crop image to be saved. NULL can be selected. LPSTR pFileID Select FileID that is identification data of the Crop image to be saved.
ERR_WORKAREA_FAILED(-280) Failure in creating the WORK AREA because image data formatting is incorrect. Failure in creating the WORK AREA. [Explanation] Crop the CropArea from the image data saved in the WORK AREA by using CropAreaID selected and register the data to the Crop image saving table. ❑ The cropped data are the same format as the original image data; however, if they are JPEG format, they are compressed and saved with JPEG standard compression.
3.65.BiESCNRetrieveImage [Function] Acquire Crop image. [Format] int BiESCNRetrieveImage(int nHandle, DWORD dwFileIndex, LPSTR pFileID, LPSTR pImageTagData, LPDWORD pImageSize, LPBYTE pImageData); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. DWORD dwFileIndex Select FileIndex that is identification data of the Crop image to be acquired. If NULL is selected, searching is not executed with this identification data.
❑ If the size of Crop image data is bigger than the memory size selected with pImageSize, the error (ERR_BUFFER_OVER_FLOW) is returned. ❑ If Crop image data that match the selected identification data are present more than once, only the data that has been searched first is acquired.
3.66.BiESCNClearImage [Function] Clear the registered Crop image. [Format] int BiESCNClearImage(int nHandle, BYTE bFlag, DWORD dwFileIndex, LPSTR pFileID, LPSTR pImageTagData); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. BYTE bFlag Select the flag for the method of clearing. The Crop image to be cleared can be identified by a combination of flags. CROP_CLEAR_ALL_IMAGE (0): Clear all the Crop image data saved.
❑ When executing BiCloseMonPrinter(), all the data defined in the saving table of the Crop image are cleared.
3.67.BiESCNGetRemainingImages [Function] Acquire the remaining number of data of the Crop image that can be registered. [Format] int BiESCNGetRemainingImages(int nHandle, LPBYTE, pRemainingImages); [Argument] int nHandle Select a printer handle value. Specify a return value of BiOpenMonPrinter() to the handle value. LPBYTE pRemainingImages Select a memory address to set a value of the number of remaining data that can be registered. [Return value] SUCCESS(0) is returned if the execution is successful.
3.68. BiGetPrnCapability [Function] Acquires printer information specified by printer ID. [Format] int BiGetPrnCapability( int nHandle, BYTE prnID, LPBYTE pBuffSize, LPBYTE pBuff) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. BYTE PrnID Specifies a printer ID to acquire information. See the following tables. pBuffSize LPBYTE Specifies the memory size to set the printer information.
69 Character type Character string data. Acquired data differs depending on equipped fonts. ANK :None Kanji: “KANJI JAPANESE ” Simplified Chinese: “CHINA GB2312 ” Traditional Chinese: “TAIWAN BIG-5 ” Thai: “THAI 3 PASS ” Korean: “KOREA C-5601C ” 112 114 115 Settings relating to models Acquired data differs depending on models. · DIP switches →2 or 4-byte data. See (C) for details. · Type ID (B) →1-byte data. See (D) for details.
The second byte Bit 0 1 2-5 *4 Value Function 0 1 NV memory for saving the reading result of images Not present Present Gray scale reading Not capable Capable (Reserved) (Fixed to 0) -- 6 Fixed -- Fixed to 1 7 Fixed Fixed to 0 -- Available only for TM-H6000II.
1-5 (Reserved) (Fixed to 0) -- 6 Fixed -- Fixed to 1 7 Fixed Fixed to 0 -- *5 Available only for TM-U675, TM-H6000, TM-H6000II, TM-T90, and TM-L90. *6 The third and fourth bytes are available only for TM-U675, TM-H6000, and TM-H6000II.
3.69. BiOpenDrawer [Function] Executes drawer operation. [Format] int BiOpenDrawer( int nHandle, BYTE drawer, BYTE pulse) [Argument] int nHandle Specifies the handle value of the printer executing the function. The return value in BiOpenMonPrinter() is specified. BYTE drawer Specifies the drawer to be opened. EPS_BI_DRAWER_1: Operates Drawer 1 EPS_BI_DRAWER_2: Operates Drawer 2 BYTE pulse Specifies the interval until drawer operation. EPS_BI_PULSE_100: Operates the drawer after 100 msec.
3.70. BiSetMonInterval [Function] A status API that specifies the interval of the status information from the printer which is expressed in milliseconds. [Format] int BiSetMonInterval (int nHandle, WORD wNoPrnInterval, WORD wPrnInterval); [Argument] int nHandle Specifies the handle value of the printer to change the interval. The BiOpenMonPrinter() return value is used in the handle value.
3.71. BiSetMonEtherInterval [Function] A status API that specifies the interval of the status information from the Ethernet connection printer which is expressed in seconds. [Format] int BiSetMonEtherInterval (int nHandle, WORD wEtherInterval); [Argument] int nHandle Specifies the handle value of the printer to change the interval. The BiOpenMonPrinter() return value is used in the handle value.
3.72.BiSetDefaultEchoTime [Function] Sets the number of response confirmations and the length of 1 time out. [Format] int BiSetDefaultEchoTime( BYTE Count, WORD Timeout) [Argument] BYTE Count Specifies the number of response confirmations. (0 < Count ≤ 255) WORD Timeout Specifies the length of 1 time out (Millisecond units (0 < Timeout ≤ 65535) [Return value] 0 is returned when changing the interval to get information from the printer is successful.
3.73.BiSetEtherEchoTime [Function] Sets the number of network printer response confirmations and the length of 1 time out after opening the StatusAPI. [Format] int BiSetEtherEchoTime( int nHandle, BYTE Count, WORD Timeout) [Argument] int nHandle Specifies the handle value of the printer to change the interval. The BiOpenMonPrinter() return value is used in the handle value. BYTE Count Specifies the number of response confirmations.
3.74. BiCloseMonPrinter [Function] This closes the printer that is undergoing status monitoring. [Format] int BiCloseMonPrinter ( int nHandle); [Argument] int nHandle This specifies the handle value of the printer to be closed. The value returned from BiOpenMonPrinter() is used as the handle value. [Return Value] If closing of the printer was successful, a 0 is returned. If there is an error, the following error code (less than zero) is returned.
4. Log Collection Function 4.1. Log File Outline The trace log is collected in accordance with Registry specifications.
4.2.Registry Details The log is output in accordance with the contents that are already set in the Registry. When the Registry is corrected and the OS is rebooted, the new settings become valid. (The Registry may be corrected unintentionally and the OS may not start. Be sure to create a backup copy before correcting the Registry.) Also delete existing log files in advance if you are correcting this Registry. A tool for changing this registry is provided separately. Use it for your convenience.
4.3. Log File Details File Name EpsStmApi.log EpsStmApi_BAK.log Outline A variable length record text log file output by the application process. Output only if 0x00000001: API Function Sequence is specified in LogLevel, and the contents of the API function and parameters, and the status information from before and after the callback call, respectively, are output in single record units. At the point when the file specified in MaxLogSize is exceeded, the current log file name is renamed to “EpsStmApi_BAK.
• Variable Length Record Text Log (EpsStmApi.log/EpsStmMon.log) Format For 1 Variable length record 32 Common Header Indefinite Log Data : Common Header 2 CRLF : : Log Data CRLF Common Header 18 Output Date and Time “YYYYMMDDhhmmss.
<4> If the type is “WDO” “Return size” Format output when returned from the port monitor. Return Size: The size of the data returned from the port monitor is output in hexadecimal character string format. Output if 0x00000010 or 0x00000100 is specified in LogLevel. <5> If the type is “WPI” ”Write request size Format that is output when sending print data from the printer driver. Write request size: The write request size to the port monitor is output in hexadecimal character string format.
The 1st record shows that the BiGetCounter function was called and that the contents of the 3 parameters are nHandle=1 (0x00000001), readno=20 (0x0014), *readcounter=0 (0x00000000). The 2nd record shows that the BiGetCounter function was returned, that the contents of the 3 parameters are nHandle=1 (0x00000001), readno=20 (0x0014), *readcounter=2000 (0x000007D0) and that the function’s return value = 0 (SUCCESS). [EpsStmMon.log] “20010409130000.200,WDI,00000055,6,1D 67 32 00 14 00CRLF”…<1> “20010409130000.
“20010409130010.010,RPN,00000055CRLF” …<4> “20010409130010.300,RDI,00000055,1CRLF” …<5> “20010409130010.310,RDO,00000055,1,xxCRLF” …<6> “20010409130010.320,RDI,00000055,1CRLF” “20010409130010.330,RDO,00000055,1,xxCRLF” “20010409130010.340,RDI,00000055,1CRLF” “20010409130010.350,RDO,00000055,1,xxCRLF” “20010409130010.360,RDI,00000055,1CRLF” “20010409130010.370,RDO,00000055,1,xxCRLF” “20010409130010.380,RDI,00000055,1CRLF” “20010409130010.390,RDO,00000055,0,00CRLF”…<7> “20010409130010.
5. Notes 1) 2) There are certain computers with which printing will not be performed normally and the status API cannot be used when the parallel operations mode is set to the ECP mode. In this event, cancel the ECP mode. When using the printer driver for EPSON Terminal Printers (Page printer, ink-jet printer and others ) and TM printer driver at the same time, the installation and uninstallation goes by the following order: [Installation] 1. EPSON Terminal Printer driver 2.
13) When using the TM-H6000II with Image Scanner with a RS-232C by hardware control (CTS/RTS), be sure that the PC does not become busy.If there is a possibility that the PC becomes busy, use an equalized cable of RTS on the PC and DSR on the TM-H6000II.
Appendix A Operation of each Function According to Printer Status Function Name Printer Printer API Open Status Offline Online Status Printer Offline Status Power Off, Cable Disconnected Status (Period during which the API is opened offline, until the Online status is recovered) BiOpenMonPrinter The API is normally Open if the parameters are normal. In the Offline Open status until the printer recovers Online status. Ends with No Target.
that Online recovery occurred and reset was completed. Offline state remains as is. It remains in the No Response state. but the Offline state remains as is. below. No Response→ Without cause Offline→Online If there is an error, No Response→ Without cause Offline→With cause Offline The intermediate Status may not be sent back depending on the conditions. BiGetOfflineCode No cause is sent back. The function can get data normally. The latest Offline cause is sent back.
BiSCNSetImageQuality Set normally. The function ends normally, but the parameter is not set. It is reset when Online recovery takes place. The function ends normally, but the parameter is not set ERR_OFFLINE is made a return value, then the function ends. Set normally. ERR_TIMEOUT is made a return ERR_ACCESS is made a return ERR_OFFLINE is made a return ERR_ACCESS is made a return value, then the function ends. value, then the function ends. value, then the function ends.
Appendix B End of Processing Judgment Method after Each Function is Executed Function Name Normal End Abnormal End Remark BiOpenMonPrinter Return value > 0 Return value < 0 BiGetStatus Return value = 0 Return value < 0 Return value = 0 Return value < 0 Return value = 0 Return value < 0 Return value = 0 Return value < 0 BiDirectIO Return value = 0 and Return value < 0 or BiDirectIOEx (If Readlen is not specified) Judgment is made by the printer’s status, such as paper position.
the specified counter acquired by BiGetCounter is 0. the specified counter acquired by BiGetCounter is not 0. execution to be confirmed to be Online and that there be a Call. BiGetType Return value = 0 Return value < 0 It is preferable for the Status just before execution to be confirmed to be Online and that there be a Call. BiMICRSelect Return value = 0 Return value < 0 or It is preferable for the Status just before execution to be confirmed to be Online and that there be a Call.
BiSetMonInterval Return value = 0 Return value < 0 Return value = 0 Return value < 0 BiSetDefaultEchoTime BiSetEtherEchoTime BiCloseMonPrinter EPSON TITLE EPSON Advanced Printer Driver for TM series StatusAPI Reference Manual Revision K No NEXT SHEET 7 6