条码打印机代码解读!

把这两天 的学习整理了一下,
下面是关于打印文本的解读,由于没有相关文档,有些是自己估计,如果有错误请帮忙指出:
strText = ""
strText = strText & "^XA" & vbCrLf // 开始标签格式
strText = strText & "^MCY" & vbCrLf // 清除以前的标签
strText = strText & "^XZ" & vbCrLf // 结束打印字段并结束标签格式
strText = strText & "^XA" & vbCrLf// 开始标签格式
strText = strText & "^LRN^FWN^CFD,24^LH" & m_strOX & "," & m_strOY// 设置起点坐标, ^LR N 表示不反向打印( N 表示不反向), ^FW N 字体方向为正常( N 表示正常), ^CFD 表示 采用的字符字体, ^LH 表示起点坐标
strText = strText & "^CI0^PR" & m_strSpeed & "^MNY^MTT^MMT^MD" & m_strDarkness & "^PON^PMN" //^CI0 指采用国际字符设置 0 代表 USA1 ^PR 表示打印速度, ^MNY 表示纸类型类 Y 表示非连续纸, ^MTT 表示纸种类 T 表示热传印纸, ^MMT 表示打印模式 T 表示撕下, ^MD 表示标签深度(值在 -30 30 之间), ^PMN 打印标签镜象 N 表示不打印镜像
strText = strText & "^XZ" & vbCrLf
strText = strText & "^XA" & vbCrLf
strText = strText & "^A0N,23,24^FO32,11^CI0^FD(P) Part No^FS" & vbCrLf //^A0N 字体方向正常 N 表示正常, ^FO 表示起点位置, ^FD 数据字段, ^FS 段括号(通常做法是在数据后跟 ^FS 指令), ^FD ^FS 间的字符为条码右边的内容。
strText = strText & "^A0N,23,24^FO33,77^CI0^FD(Q) Quantity^FS" & vbCrLf // 打印 Text (位于条码上面)
strText = strText & "^A0N,23,24^FO33,216^CI0^FD(B)^FS" & vbCrLf // 打印 Text
strText = strText & "^A0N,23,24^FO32,143^CI0^FD(E) Product date + Expire days^FS" & vbCrLf
strText = strText & "^FO7,3^GB607,334,2,B,0^FS" & vbCrLf //^GB 表示图象框,后跟图象框宽度、图象框高度、线的厚度、线的颜色( B 表示黑色); -- 外面的大筐
strText = strText & "^A0N,23,16^FO288,78^CI0^FD(L) Lot No^FS" & vbCrLf
strText = strText & "^A0N,39,40^FO506,19^CI0^FDBenQ^FS" & vbCrLf
strText = strText & "^BY2,2.0^FO32,34^B3N,N,40,N,N^FDP" & pstrItem & "^FS" & vbCrLf //^BY 设置高度和宽度; ^FDP+ pstrItem + ^FS 表示 ”P”+Partno ,打印条码
strText = strText & "^A0N,23,24^FO161,11^CI0^FD" & pstrItem & "^FS" & vbCrLf // 打印 Text
strText = strText & "^A0N,23,24^FO161,76^CI0^FD" & pstrUnitQty & "^FS" & vbCrLf // 打印 Text
strText = strText & "^BY2,2.0^FO32,99^B3N,N,40,N,N^FDQ" & pstrUnitQty & "^FS" & vbCrLf // 打印条码
strText = strText & "^A0N,23,24^FO353,143^CI0^FD" & pstrProdDate & "^FS" & vbCrLf // 打印 Text
strText = strText & "^A0N,23,24^FO474,143^CI0^FD " & pstrExpDays & "^FS" & vbCrLf // 打印 Text
strText = strText & "^BY2,2.0^FO33,167^B3N,N,40,N,N^FDE" & pstrProdDate & " " & pstrExpDays & "^FS" & vbCrLf // 打印条码
strText = strText & "^BY1,2.0^FO144,211^B3N,N,40,N,N^FD" & strControlNo & "^FS" & vbCrLf // 打印条码
strText = strText & "^A0N,21,22^FO176,253^CI0^FD*" & strControlNo & "*^FS" & vbCrLf //* 为软连接字号会被直接打出来
strText = strText & "^BY1,2.0^FO288,99^B3N,N,40,N,N^FD" & pstrLotNo & "^FS" & vbCrLf // 打印条码
strText = strText & "^A0N,23,24^FO423,289^CI0^FD" & pstrRTNo & pstrWareHouse & "^FS" & vbCrLf
strText = strText & "^BY1,3.0^FO32,274^B3N,N,40,N,N^FD" & pstrReelId & "^FS" & vbCrLf // 打印条码
strText = strText & "^A0N,21,22^FO81,316^CI0^FD*" & pstrReelId & "*^FS" & vbCrLf // 打印 ReelId
strText = strText & "^A0N,23,18^FO375,77^CI0^FD" & pstrLotNo & "^FS" & vbCrLf // 打印 LotNo Text
strText = strText & "^MCY" & vbCrLf // 清除标签
strText = strText & "^PQ1,0,1,Y" & vbCrLf //^PQ 表示打印数量,许可值: 1-99,999,999 ,意义:打印总数 1 张标签每个序列号只打 1 张。打印每组数量是 0 ,但在每组间不暂停( Y
strText = strText & "" & vbCrLf
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值