最近在做项目时候使用了东芝的B-EV4打印机,在打印Excel时候由于字体太小,导致打印非常模糊。只能通过串口名称发送打印指令进行打印。在做项目的时候查了很多关于B-EV4打印机的资料,和打印命令。资料都很少坑也很多,通过这个项目跟大家分享一下,也避免每个人都踩坑。

  我先把官方命令资料给大家,实际命令要以文档为主 下载地址:http://www.printmark.de/downloads/prog_manuals/Prog_handb_B-EV4.pdf

  1.打印测试页

  在连接串口之前需要知道串口的信息,在机器的测试页面会显示。具体步骤如下

  “自动打印测试和倾印模式”

  1. 关闭打印机电源,把介质卷装入打印机。
  2. 开启打印机的同时按下【FEED】按钮。指示灯将按照以下顺序持续亮起:

    绿色(闪烁)→ 红色(闪烁)→ 橙色(闪烁)→

    橙色 → 红色 → 绿色

  3. 当指示灯持续亮起且为绿色时,释放【FEED】按钮。

  4. 打印机将自动实现自动打印测试,然后进入倾印模式。

  5. 要开始联机操作,先关闭打印机,然后再次开启。

  在打印完毕之后会显示类似模板

  PARAMETER 下显示了机器目前的串口信息,串口的连接信息在以后的命令中也可以自己进行修改。 命令:{Z2; 1, abcdefghijklmnopqqrst(uvw) |}

  2.打印流程

  下图是官方给出的打印流程模板,每个指令都有自己的参数类型、参数数量。因为参数很多,具体指令还需要看官方文档。在此只能说下指令的目的和注意事项。

  指令是以大括号和竖线为识别符号,例如{XX;xx|},也就是说在大括号之外的指令是不被打印机识别和运行的,也不会报错。

  {D;aaa,bbb|} D是指令的名称,告诉打印机执行什么动作,aaa和bbb是参数告诉打印机执行具体执行的数据。需要注意参数是有位数限制。文档上给出的位数在调用的时候一定要位数一致,数值不够的需要在前方补0 ,例如 {PV00;0050,0030,0030,0030,J,00,B|}。在机器报错首先检查是否指令的位数和文档不符合。

  具体注意事项在文章最下方有详细说明

  {D;|} 指定打印大小、纸张大小。这项一定要按照打印标签的参数进行设置,否则在以后切纸的时候就会有偏移,就会有可能切到下一张标签上。如果没有标签纸的资料也可以用游标卡尺进行测量。(要求精度)

  {AX;} 制定切纸大小、切纸偏移位置等。我在使用中没用这条指令,打印纸张大小确定好后,机器有识别功能的话,会自动识别标签的切割位置。

  {AY;} 设置打印浓度。

  {T;} 进纸命令,执行完命令后会传出一份。

  命令注意事项

  1. If a command is not recognized as a command, it is ignored. e.g.) [ESC] H, [ESC]AA, and so on.

  2. If the number of digits of the parameter is specified, when the number of in put digits does not match the specified number of digits, a command error occurs.

  3. When a parameter is set to any character/value other than specified characters/values, a command error occurs.

    e.g.) In the case that a value should be set for parameter, “0001” is acceptable, however, “000A” results in an error.

    In the case that a character should be set for parameter, “A” is acceptable, however, “1” results in an error.

  4. If the value range of the parameter is specified, when any value beyond the range is entered, a command error occurs. (Except for the D command)

  5. When a parameter is missing, which cannot be omitted, a command error occurs.

  6. The parameter should be set to either a value or a character, even if the parameter is defined as “Ignore”.

    e.g.) a : Ignore
    If it is omitted, a command error occurs, except when the parameter is omissible.

    If the number of digits of the parameter is specified, when the number of input digits does not
match the specified number of digits, a command error occurs.

   7.When any value/character other than available values/characters for the parameter function is set,
a command error occurs.

    1. e.g.) Parameter “e” for the LC command.
      e: Type of line

      0: Line
      1: Rectangle
        If “2” is set to parameter “e”, a command error occurs.

  1. About D command

    1) Parameter “aaaa”, “bbbb” and “cccc”

    When any value lager than maximum value is entered for these three parameters, the
entered value is internally changed to the maximum value.
    When any value smaller than minimum value is entered for these tree parameters, the
entered value is internally changed to the minimum value.

    2) When “aaaa” is smaller than “cccc”, a command error occurs.
    3) When “aaaa – cccc < 2mm”, it is internally changed to “cccc = aaaa – 2mm”.

东芝 B-EV4 打印机 串口打印命令的更多相关文章

  1. C#直接发送打印机命令到打印机及ZPL常用打印命令 - 条码打印机

    using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServi ...

  2. 斑马105SLPlus串口打印二维码

    1.根据说明书调试硬件,校准介质还有色带(很重要),我自己搞了好几天才搞明白. 2.设置好参数,比如打印介质连续.非连续,热敏还是热转质 3.打印机上电后悔自动校准,校准成功后就可以直接通过串口打印, ...

  3. Linux终端打印命令使用介绍

    常用linux打印命令 日常使用中或shell脚本中linux终端打印命令有echo和printf.  echo命令 功能说明:显示文字.语 法:echo [-ne][字符串]或 echo [--he ...

  4. cotex_m3内核提供的ITM串口打印调试

    cotex_m3内核的ARM提供了ITM串口打印观测的功能,可以不用ARM单片机自己的串口就可在开发时候串口打印调试.节约了宝贵的内部资源,同时也为调试提供了方便.使用方法如下: 1 将下面的SWO_ ...

  5. 【转】Esp8266学习之旅① 搭建开发环境,开始一个“hellow world”串口打印。

    @2019-02-28 [小记] Esp8266学习之旅① 搭建开发环境,开始一个“hellow world”串口打印.

  6. C#热敏打印图片 串口打印图片

    原文:C#热敏打印图片 串口打印图片 如图,一步一步慢慢调出来的 //串口通信类 public System.IO.Ports.SerialPort serialPort = null; serial ...

  7. 【RTOS】基于V7开发板的最新版FreeRTOS V10.2.0程序模板,含MDK和IAR,支持串口打印任务执行情况

    模板下载: 链接:https://pan.baidu.com/s/1N32Hx7cTbDoRinuzTUB3zw   提取码:6aox 1.MDK使用MDK5.26及其以上版本. 2.IAR使用IAR ...

  8. NRF52832 Mesh调试,使其同时支持串口打印和RTT打印

    查看开发环境里面,是否有这个文件,如果没有你的话,则添加文件. 然后要在sdk_config.h中添加使能 然后打开刚才添加的文件retarget.c,主意里面这些地方 这里它进行判断,要么使用RTT ...

  9. STM32串口打印的那些知识

    常规打印方法 在STM32的应用中,我们常常对printf进行重定向的方式来把打印信息printf到我们的串口助手.在MDK环境中,我们常常使用MicroLIB+fputc的方式实现串口打印功能,即: ...

随机推荐

  1. CentOS7.4安装和配置zabbix4.0

    一.安装zabbix前,需要搭建好LAMP环境 二.下载zabbix 进入官网:https://www.zabbix.com/ 更多详细内容请参考官方说明文档,详细的安装要求不贴出来了. https: ...

  2. 安装Go插件遇到的问题及解决方法

    1. 问题:在 Windows 平台下使用 go get 安装sqlite3 驱动时报错 The remote end hung up unexpectedly ? 原因及解决方法: 原因可能有两种: ...

  3. SpringMVC+Shiro整合配置文件详解

    http://blog.csdn.net/dawangxiong123/article/details/53020424

  4. promise学习总结

    什么是Promise Promise是异步编程的一种解决方案,它有三种状态,分别是pending-进行中.resolved-已完成.rejected-已失败 当Promise的状态又pending转变 ...

  5. python网络爬虫&&爬取网易云音乐

    #爬取网易云音乐 url="https://music.163.com/discover/toplist" #歌单连接地址 url2 = 'http://music.163.com ...

  6. vue 数组push元素 视图没更新

    Vue 包含一组观察数组的变异方法,所以它们也将会触发视图更新.这些方法如下: push() pop() shift() unshift() splice() sort() reverse() 问题描 ...

  7. Docker创建Tomcat镜像

    1.创建Dockerfile文件 vi Dockerfile Dockerfile内容 FROM debian ADD ./jdk-8u191-linux-x64.tar.gz /usr/local/ ...

  8. coursera-斯坦福-机器学习-吴恩达-笔记week3

    1 逻辑回归 1. classification 分类 eg:垃圾邮件分类.交易是否是欺诈.肿瘤类别.分类的结果是离散值. 2. sigmoid函数 使用线性方法来判断分类问题,会出现上图中的问题,需 ...

  9. js的预解析详解

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  10. postman操作练习用例

    1.注册用户:http://api.nnzhp.cn/api/user/user_reg 2.登录用户:http://api.nnzhp.cn/api/user/login 3.添加学生:http:/ ...