Random CR/LF inserted in the data when communicating via Bluetooth using the Zebra Mobile Printer SDK

Article ID: 96614379



Topic or Information

Unwanted CR/LF is added to the data when communicating via Bluetooth using the Zebra SDK

Applies To

  • Using the SDK communicating via Bluetooth
  • Zebra Mobile printers used in line print mode


Sending data to the QL Plus printer using the Write(byte[] data) method of the BT portion of the SDK results in an extra line feed occurring after every 666 bytes of data.  

The cause of this issue is the printer’s built-in line print timeout  When the printer is in line print mode it is expecting a CrLf termination following every batch of characters, after which it will print the characters received. However, if this termination is not received the printer will insert its own termination. Without this termination indication the printer could hang or appear locked up.


 In order to resolve the issue you can adjust the printer’s SETLP-TIMOUT parameter to a higher value. The default value at power on is 4 (~ 500ms). Setting the value to somewhere around 12-14 should suffice.  The value is persistent until a power cycle or changed with the CPCL SETLP-TIMEOUT command.

Note: Setting the SETLP-TIMOUT command to a value of 0 disables the line print timeout, and characters will be held forever until a terminator is received. We do not recommend a setting of zero unless the environment is well controlled.

Changing the Timeout Value

Send this command directly to the printer - 

! U1 SETLP-TIMEOUT 14<CR><LF> <— command must be followed by a carriage return / line feed termination 

Send test data to verify there are no more interjected CrLf in the data stream and the printed output. You can add this command into your data directly, or you can add it to a configuration file that is read on startup such as CONFIG.SYS, AUTOEXEC.BAT, or RUN.BAT. Here is an example using CONFIG.SYS: 


<CR><LF> <— PRINT command must be followed by a carriage return / line feed termination in the file being sent to the printer 

You can send this file to the QL Plus using the Zebra Setup Utilities' ‘Send File’ option in the ‘Action’ tab of the ‘Tools’ dialog as well.


Arthur P


+ Product Codes

  • Mobile Printers
  • P4T Mobile Printers
  • P4T Mobile Printers
  • QL Series Mobile Printers
  • QL320 Mobile Printer
  • QL420 Mobile Printer
  • QLn Series Healthcare Mobile Printers
  • QLn Series Mobile Printers
  • QLn220 Healthcare
  • QLn220 Mobile Printer
  • QLn320 Healthcare
  • QLn320 Mobile Printer
  • QLn420 Mobile Printer
  • RP4T RFID Printers
  • RP4T RFID Printers
  • RW 220 Mobile Printer
  • RW 420 Mobile Printer
  • RW 420 Print Station
  • RW Series Mobile Printers
  • ZQ500 Series Mobile Printers
  • ZQ510 Mobile Printer
  • ZQ520 Mobile Printer
  • iMZ Series Mobile Printers
  • iMZ220 Mobile Printer
  • iMZ320 Mobile Printer