ESC * m nL nH d1… dk
[名称] 选择位图模式
[格式] ASCII ESC * m nL nH d1…dk
Hex 1B 2A m nL nH d1…dk
Decimal 27 42 m nL nH d1…dk
[范围] m = 0, 1, 32, 33
0 ≤ nL ≤ 255
0 ≤ nH ≤ 3
0 ≤ d ≤255
很多人不理解这个参数的 nl nh,定义是说data的数量是nl+nh*256决定,我琢磨了半天。其实说简单点,就是一个unsinged int16嘛。256就是高字节的模、这个没有struct申明的那么明白。因为命令是以字节来表示,所以才这么费解。其实struct就是
struct{
byte flag1; // ASCII:ESC 0x1B
byte flag2; //ASCII:*
byte mode; //0-3
unsingedint16 qty; //高字节*256+低字节=数据数量
byte data[] ; //data
}
下载我写好的程序: http://powerbuilder.ltd/soft/ESC_POS_PRINT.rar