秘奥服装管理软件Blog

秘奥服装管理软件博客,主要介绍服装软件,进销存软件,仓库管理软件等行业管理软件的文章

« 服装销售系统的成功标尺服装业 手工管理中存在的问题 »

POS机客显问题

1.应用范围及特点
HK-VC210B型客户显示器是一种用于向顾客显示信息的设备,因采用了点阵荧光数码显示,所以显示亮度高,并可显示数字、字母、图形及二级汉字。
VC210B客显需使用RS232转换头,连接主机的COM3使用。
2.技术性能
(1) 显示屏外形尺寸:190(W)× 64(H)× 36(T)
(2) 显示面积:132.65mm ×33.05mm
(3) 显示颜色:绿色
(4) 显示点阵:160(W)×40(H)
(5) 点大小: 0.68(W)×0.68(H)
(6) 点距:0.83(W)×0.83(H)
(7) 显示汉字:标准二级汉字库
(8) 工作电压:12V±5%
(9) 工作温度:0℃ ---+50℃
(10) 接口:RS232c 串行接口
(11)功率:4.5W
3. 命令简介
通信波特率:9600 bps
校验:奇校验
数据位:8 bit
停止位:1bit
(1) 初始化:复位
命令 1BH 40H
(2) 清屏:清除当前显示内容
命令 0CH
(3) 左对齐显示:
顶行显示d1….dn字符
命令 1bH 51H 41H d1d2….dn 0dH
底行显示d1….dn字符
命令 1bH 51H 42H d1d2….dn 0dH
(4) 右对齐显示:
顶行显示d1….dn字符
命令 1bH 52H 41H d1d2….dn 0dH
底行显示 d1….dn字符
命令 1bH 52H 42H d1d2….dn 0dH
(5) 清除单行
清除顶行:
命令 18H 31H
清除底行:
命令 18H 32H
(6)设置显示亮度:关闭显示或设定显示模式
命令 1bH 5cH 3fH 4cH 44H PSH
PS =0H, 关显示
PS =31H, 31.6% 亮度
PS =32H, 45% 亮度
PS =33H, 58.8 %
PS =34H, 79.4%
PS =35H, 默认亮度100%
4.客显函数库及例程
#include
#include "dos.h"
#include "string.h"
#include "conio.h"
#include "stdio.h"

#define WAITIME 30000
#define DBUF 0X0 /* DATA BUFFER REGISTER */
#define LSB 0
#define MSB 1
#define IER 0x1 /* intr enable register */
#define IIR 0x2 /* intr ident. register */
#define LCR 0x3 /* line control register*/
#define MCR 0x4 /* modem control register*/
#define LSR 0x5 /* line status register */
#define MSR 0x6 /* modem status register */

int giCustdisPt = 0; //端口号:1:com1,...4:com4;
unsigned PortAddress[]={0x3f8,0x2f8,0x3e8,0x2e8}; //端口地址

//功能: 用写地址的方式向串口输出字符
//参数: ch--要输出的字符串
//返回: 1:成功; 0:失败
int SendCh(char ch)
{
int iWaitTime = 3000;

if (!giCustdisPt)
return 0;

while (!(inportb(PortAddress[giCustdisPt-1]+LSR) & 0x20) && iWaitTime)
iWaitTime--;

if(iWaitTime)
{
outportb(PortAddress[giCustdisPt-1]+DBUF, ch);
return 1;
}
else
return 0;
}

//功能: 用写地址的方式向串口输出字符串
//参数: pStr--要输出的字符串
// iStrLen:字符串长度
//返回: 1:成功; 0:失败
int SendStr(char *pStr, int iStrLen)
{
int i,iResult;

for(i=0; i {
iResult = SendCh(*pStr++);
if(!iResult)
break;
}

return iResult;
}

//函数:VC210B_Init
//功能:初始化,清除所有字符
//参数:无
//返回:TRUE:成功;FALSE:失败
int VC210B_Init(void)
{
bioscom(0,0xe0|0x03|0x00|0x08, giCustdisPt-1); // 9600,8,1,o
return SendStr("\x1b\x40",2);
}

//函数:VC210B_Display
//功能:从左端对齐显示nLength个长度字符串
//参数:nLines: 1:顶行; 2:底行; pStr:要显示的字符串;nLength:字符串的长度
// (0//返回:TRUE:成功;FALSE:失败
int VC210B_Display(int iLine,char *pStr,int iLength)
{
char str[50]="";
if(iLine == 1)
sprintf(str,"\x1b\x51\x41%s\x0d",pStr);//top left flush
if(iLine == 2)
sprintf(str,"\x1b\x52\x41%s\x0d",pStr);//bottom right flush
return SendStr(str,iLength+4);
}

//函数:VC210B_Cls
//功能:清除所有显示内容
//参数:无
//返回:TRUE:成功;FALSE:失败
int VC210B_Cls(void)
{
return SendStr("\x0c",1);
}

//功能: 主函数,运行时,初始化客显并清屏
// 第一行显示:ABCDEFGHIJKLMNOPQRSTU
// 第二行显示:01234567890123456789
void main()
{
giCustdisPt=4;
VC210B_Init();
VC210B_Cls();
VC210B_Display(1," ABCDEFGHIJKLMNOPQRSTU ",20);
VC210B_Display(2,"01234567890123456789",20);
}

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最近发表

网站分类

友情链接

Powered By 秘奥软件1.8 Walle Build 91204

Copyright 秘奥