ZPL command length limit?

S Steve Haun 3 years 7 months ago
234 0 0

I am generating ZPL command string and the printer (ZT410) does not print all the labels sent. I simply loop through the following code and send the string to the printer (via the IP address on port 9100). Each loop contains a unique set of data where row['item_desc'],row['our_part_number'], and part number change each iteration (so I am not just trying to print 522 identical labels).
 
 
   command += '^XA';
  command += '^LT23';
  command += '^FO125,30';
  command += '^A0N,85,50';
  command += '^FB950,1,,C'
  command += '^FD'+row['item_desc']+'^FS';
  command += '^FO20,260';
  command += '^A0N,50,50';
  command += '^FD'+part_number+'^FS';
  command += '^FO122,260';
  command += '^A0N,50,50';
  command += '^FB950,1,,C'
  command += '^FD'+row['our_part_number']+'^FS';
  command += '^FO935,255';
  command += '^A0N,25,25';
  command += '^FB200,2,,R'
  command += '^FDMy Company Name Phone_Number   ^FS';
  command += '^FO'+margin+',105';
  command += '^BY3';
  command += '^B3N,N,144,N,N';
  command += '^FD'+row['our_part_number']+'^FS';
    command += '^XZ';
 
 
My test lot is 522 labels.  Before adding the company info and barcode, the printer printed all 522 labels, but with the code above, it only prints 485 labels. 
 
 
Where is the limit?  Is there a limit on the string length that can be sent to the port?  Should I add a carriage return and line feed after each label (so the printer knows where to break the string)?  Or is there a IP:port timeout?
 
 
The printer prints the labels, but doesn't respond in any way to the port that sent the command.  If I break the labels into individual command strings and send them sequentially without pause, the printer didn't print ANY labels. Is it possible to query the printer to know when to send the next command string?
 
 
*Normally, I would just experiment with trial and error, but in this case that method is expensive and wasteful...*

CONTACT
Can’t find what you’re looking for?