How To Read From Datamax Printer (Usb) 追蹤

0
Avatar
Legacy Poster

I use Datamax-O'Neil ST-3210 with your driver.
Bi-direct communication is enabled in driver setup page.

I want to read printer status (SOH A).
I use:
CreateFile(interfacename,
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | FILE_FLAG_OVERLAPPED,
NULL);
Interfacename= \\\\?\\usb#vid_0b0b&pid_106e#6&182a12da&0&8#{28d78fad-5a12-11d1-ae5b-0000f803a8c2}

WriteFile is successful. Printer executes commands.
But ReadFile always returns 0 bytes for SOH A(0x01,”A”).
So I am not able to read printer status.

Are you driver and printer supports read (bi-directional communication)?
Can you provide a sample of bi-directional communication?

1 意見

0
Avatar
Ian Einman
評論操作 永久連結

If you are using BarTender (Automation edition or higher), and have the driver's status monitoring feature enabled, the Print SDK has functionality that will report the printer status. See the Status member of the Printer object. If you need to send a custom command, you can use the ExecuteQuery or ExecuteQueryAndWait methods to get a response.

If you are not using BarTender, we do not support reading data from the printer with our driver, sorry.

登入寫評論。