简体   繁体   English

为什么发送到Zebra QLn220打印机的CPCL代码有效,而发送到Zebra QL220的相同代码却不起作用?

[英]Why would CPCL code sent to a Zebra QLn220 printer work, whereas the same code does NOT work when sent to a Zebra QL220?

Based on user preferences (type of label selected, and whether to send a "Keep Alive" message), different CPCL commands are sent from a handheld device to a Zebra QL[n]220 belt printer. 根据用户首选项(所选标签的类型以及是否发送“保持活动”消息),将不同的CPCL命令从手持设备发送到Zebra QL [n] 220皮带打印机。 This code: 这段代码:

const string quote = "\"";
string keepPrinterOn = string.Format("! U1 setvar {0}power.dtr_power_off{0} {0}off{0}", quote);
string shutPrinterOff = string.Format("! U1 setvar {0}power.dtr_power_off{0} {0}on{0}", quote);
string advanceToBlackBar = string.Format("! U1 setvar {0}media.sense_mode{0} {0}bar{0}", quote);
string advanceToGap = string.Format("! U1 setvar {0}media.sense_mode{0} {0}gap{0}", quote);

...works for the (newer) QLn220 printer, but on the (older) QL220, rather than the printer receiving the commands and acting on them, it simply prints the raw commands onto the labels. ...适用于(较新的)QLn220打印机,但在(较旧的)QL220上,而不是打印机接收命令并对其执行操作,它只是将原始命令打印到标签上。 IOW, the QL220 belt printer, instead of converting the commands to actions, or barcodes, it prints stuff like this directly on the label: IOW,QL220带式打印机,而不是将命令转换为动作或条形码,而是直接在标签上打印以下内容:

0 200 200 241 1
RIGHT
TEXT 4 3 0, 0 0.75
LEFT
TEXT 5 0 0 90 DRPEPPER (7X2) = 14
CENTER

BARCODE UPCA 1 1 50 0 137 054900000295
FORM
PRINT

Is it that something changed between the QL220 and the QLn220 as to the CPCL protocol, or...??? QL220和QLn220之间关于CPCL协议是否有所更改,还是... ???

UPDATE 更新

Well, this is bizarre; 好吧,这很奇怪。 oddly enough, I added this code: 奇怪的是,我添加了以下代码:

string getDeviceLang = string.Format("! U1 getvar {0}device.languages{0}", quote); 
string setDeviceLangZPL = string.Format("! U1 setvar {0}device.languages{0} {0}ZPL{0}", quote); 
. . . 
String deviceLanguage = PrintUtils.GetSettingFromPrinter(getDeviceLang); 
MessageBox.Show(deviceLanguage); 
if (deviceLanguage.Equals("line_print")) 
{ 
PrintUtils.SendCommandToPrinter(setDeviceLangZPL); 
} 

...and although the call to GetSettingFromPrinter() returns an empty string (as seen in MessageBox.Show), the printing therefater works as desired anyway (it prints the labels as desired, instead of just printing the raw commands onto them)!? ...虽然对GetSettingFromPrinter()的调用返回了一个空字符串(如MessageBox.Show中所示),但是无论如何,打印该打印机还是可以按需进行的(按需要打印标签,而不仅仅是在其上打印原始命令)! ?

UPDATE 2 更新2

Note: My QLn220 Zebra printer does have a usb port (the older QL220, which is the one that was causing the problems, does not). 注意:我的QLn220 Zebra打印机确实有一个USB端口(不是引起问题的较早QL220的端口)。 When I sent it the "what language are you using" (getDeviceLang) command using Zebra Setup Utils, it responded with, "hybrid_xml_zpl" 当我使用Zebra Setup Utils向其发送“您正在使用哪种语言”(getDeviceLang)命令时,它回复为“ hybrid_xml_zpl”

Hybrid zpl combines both CPCL and ZPL print commands. 混合zpl结合了CPCL和ZPL打印命令。

Receipt printers (imz, em220...etc) are set originally from factory in Line print mode. 收据打印机(imz,em220等)最初是在工厂以行打印模式设置的。 Some of the older QL220 are as well. 一些较旧的QL220也是如此。 Its best to set them to Hybrid and you should have no problems. 最好将它们设置为“混合”,并且应该没有问题。

Brent Arrowhead Corp - Zebra ISV 布伦特箭头公司-斑马ISV

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么在我讲话的过程中Zebra QL 220打印机会关闭? - Why does the Zebra QL 220 printer shut off in the middle of my talking to it? 如何使用OpenNETCF.IO.Ports写入Zebra QL220? - How can I write to a Zebra QL220 using OpenNETCF.IO.Ports? 如何通过 .Net SDK 将字体文件发送到 Zebra 打印机 (MZ 220)? - How to send a Font File to a Zebra Printer (MZ 220) via .Net SDK? 如何从.NET Compact Framework打印到MZ220打印机? - How to print to a MZ220 printer from .NET Compact Framework? 为什么一个String用等效的代码保存到文件,而另一个却不保存? - Why does one String save to a file, whereas the other doesn't, with equivalent code? 从手持设备(CE5 /紧凑型框架)设计和打印条形码标签到斑马移动打印机的最佳方法 - best way for design and print barcode label from handheld (ce5/compact framework) to zebra mobile printer 将SMS写入Windows Mobile上的文件夹(收件箱,草稿,已发送邮件)(首选托管代码) - Write SMS to folders (Inbox, Drafts, Sent Items) on Windows Mobile (Managed Code prefered) 是否有一个标志告诉Zebra打印机在条形码的文本表示中包含校验位? - Is there a flag that tells Zebra printers to include the check digit in the textual representation of a barcode? 使用Windows Mobile将值传递给Zebra中的标签变量 - Pass value to label variable in Zebra using Windows Mobile 发送短信并将其复制到“已发送邮件”文件夹中 - Send SMS AND copy them into the “sent messages” folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM