Skip to content

DirectSendRead

Description

Sends transmission data corresponding to the command name specified in the command definition file that has been registered by SendDataFile.
With the syntax (a), the API gets the receive data as binary data from the printer after sending the transmission data corresponding to the command name specified in the command definition file that has been registered by SendDataFile.
With the syntax (b), the API gets the receive data as string data from the printer after sending the transmission data corresponding to the command name specified in the command definition file that has been registered by SendDataFile.
With the syntax (c), the API sends the transmission data corresponding to the command name specified in the command definition file that has been registered by SendDataFile.

Syntax

  
    (a) ErrorCode DirectSendRead( string cmdName, string readType, ref byte[] data, int timeout, bool readFlag )
(b) ErrorCode DirectSendRead( string cmdName, string readType, out string data, int timeout )
(c) ErrorCode DirectSendRead( string cmdName, string readType, int timeout )

Parameter

cmdName

Command name
Specify the command name defined by SendDataFile.

readType

Receive data type name
Specify the type of data to receive from the followings.
ASB: Stores only the response of the ASB setting command in the receive data.
Other: Stores responses other than the above from the printer in the receive data.

data

Buffer of data to receive
Specify the buffer that stores the data to get.

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
Specifies the flag to specify the receive operation from the followings.
TRUE: Continues receiving until any data is received or timeout occurs.
FALSE: Continues receiving until the receive data size is received or timeout occurs.

Return value

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

Remarks

    • This API can be aborted by ResetPrinter.
    • When 0x02 is included in the receive data, it is converted to 0x5f.