Skip to content

DirectIOEx

Description

With the syntax (a), the API gets the receive data as binary data from the printer after sending binary data.
With the syntax (b), the API gets the receive data as string data from the printer after sending binary data.
With the syntax (c), the API sends binary data.

Syntax

  
    (a) ErrorCode DirectIOEx( byte[] cmd, ref byte[] data, int timeout, bool readFlag, byte option )
(b) ErrorCode DirectIOEx( byte[] cmd, out string data, int timeout, byte option )
(c) ErrorCode DirectIOEx( byte[] cmd, int timeout )

Parameter

cmd

Buffer of data to send
Specify the buffer in which the data to send is stored.

data

Buffer of data to receive
Specify the buffer that stores the data to get.
The maximum receive data size is 4096 bytes.
When the value is specified more than 4096, the size is set to 4096 bytes.
Specify 0 when data retrieving is not necessary.
When the control returns from the API, the received data size is stored.

timeout

Timeout period
Specify the time to wait for success of this API in milliseconds (ms).
The valid range is from 3000 to 90000.
When the value is specified less than 3000, the time is set to 3000 ms.
When the value is specified more than 90000, the time is set to 90000 ms.

readFlag

Receive operation flag
Specify the flag to specify the receive operation from the following.
TRUE: Continues receiving until any data is received or timeout occurs.
FALSE: Continues receiving until the receive data size is received or timeout occurs.

option

Receive target option
Specify the data to receive from the followings.
0: Gets the data excluding the response of the ASB setting command.
1: Gets the data including the response of the ASB setting command.

Return value

Returns an error code. See "Error Code List" for details of the error code.

Remarks

    • When this API succeeds, data in syntax (a) is resized to the actual receive data size within the limits of specified receive data size as data.
    • This API can be aborted by ResetPrinter.
    • When 0x02 is included in the receive data, it is converted to 0x5f.