Specifications
No
EPSON
TITLE
EPSON Advanced Printer Driver for TM series
StatusAPI
Reference Manual
Revision
L
NEXT
19
SHEET
18
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. If this value is zero, writing is not performed,
but only reading is done.
LPBYTE writeCmd
This specifies the data (command) to be written to the printer.
LPBYTE readLen
This specifies the length of the data to be read from the printer. If the value is zero, reading is not performed after writing.
After return from this function, the number of bytes actually read is saved.
LPBYTE readBuff
This specifies the buffer where data read from the printer are stored.
DWORD timeout
This specifies the data writing and data reading time out time in msec units.
BOOL nullTerminate
If TRUE, reading is finished at the point when a NULL is received from the printer. At this time, the size of the readBuff
prepared by the user program in readLen must be specified.
If FALSE, reading of data from the printer is performed until a timeout occurs or the specified length of “readLen” is read.
[Return Value]
If reading/writing was successful, a 0 is returned. If there is an error, the following error codes (less than zero) are returned.
ERR_HANDLE The handle value which specifies the printer is incorrect.
ERR_TIMEOUT A time out error occurred.
ERR_ACCESS Reading/writing with the printer is not possible (printing in progress).
ERR_OFFLINE
It was opened in the offline state, so it cannot be used until the online state is recovered.
ERR_NOT_EPSON Cannot be used (printer not EPSON)
ERR_PARAM Parameter error
[Explanation]
For the readBuff size, memory with a length which is the same as, or greater than the length specified by readLen should be
secured.
The following points are also different from BiDirectIOEx. Use BiDirectIOEx as needed.
•
A command disabling ASB his added as a prefix to BiDirectIO data. If problems occur when other commands are inserted
while writing continuous data with BiDirectIO, use BiDirectIOEx.
•
The maximum data length that can be read/write processed by BiDirectIO is 255 bytes. For longer data, use BiDirectIOEx.
[Supported printer]
TM-T88II(R), TM-T88III, TM-T90, TM-L90, TM-H5000II, TM-U590, TM-U675, TM-H6000, TM-H6000II, TM-J8000,
TM-J2000/2100, TM-J7000/7100, TM-H3000(R), TM-U230, TM-U210, TM-U325, TM-U950, TM-U295, TM-L60II