Specifications
No
EPSON
TITLE
EPSON Advanced Printer Driver for TM series
StatusAPI
Reference Manual
Revision
L
NEXT
20
SHEET
19
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.
DWORD 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.
LPWORD 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..
BYTE option
0: ASB disable command (GS a) is sent before data write, and ASB enabled after data write complete.
1: ASB disable and enable commands are not sent.
[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. This is functionally the same as BiDirectIO, but there are specification differences. See Section 5.8 BiDirectIO.
[Caution]
• Up to 2 Gbytes of data can be specified for read/write processing, but under Windows NT 4.0 the specified memory region
is reserved, so please specify the minimum data length.