cancel
Showing results for 
Search instead for 
Did you mean: 

Send ZPL II commands to zebra printer via USB

paul2
Senior
Posted on August 12, 2017 at 21:51

Hi,

I'm investigating how to send ZPLII commands to an USB printer using a STM32F4 or F7 MCU.

So far i did some testing with USB FS Host examples. The printer is being recognized, but I'm not able to send a ZPLII string like: '^XA^FO10,10,^AO,30,20^FDFDTesting^FS^XZ';

Anybody experience with sending ZPLII commands to zebra printer via USB? Or how to send a raw string like mentioned above?

Thanks

2 REPLIES 2
john doe
Lead
Posted on August 13, 2017 at 01:07

Can you send any commands to it at all?  Start with 'give me your version number.' Get command/response working first.

I can't help with USB commands, but programmatically building a string, we can do with sprintf()

Posted on August 13, 2017 at 20:55

Hi,

yes, I managed to receive to device description like Product & Vendor ID etc.

I was thinking/trying to use HAL_HCD_HC_SubmitRequest in order send the ZPLII string as data.

  USB_status = HAL_HCD_HC_SubmitRequest(hUSBHost.pData,

                                      hUSBHost.Control.pipe_out,

                                      0,

                                      USBH_EP_BULK,

                                      USBH_PID_DATA,

                                      (uint8_t*) &txdata,

                                      97,

                                      0);

But no success so far..

Function returns USBH_OK, but the printer doesn't respond accordingly.