串口
端口读入电子秤,码表等数据输入
<device code="sp" type="serialport" port="COM11" baudrate="9600" replacestr="kg" databites="8" stopbites="1" parity="0" subtype='str' resethex="54" digitalonly='true' />
databits 类型 int 数据位 取值 为 7 或者8 数据位为7位或8位
stopbits 类型 int 停止位 取值为 1 或者2 停止位为1或2位
parity 类型 int 效验类型 PARITY_NONE = 0; PARITY_ODD = 1;PARITY_EVEN = 2;PARITY_MARK = 3; PARITY_SPACE = 4;
replacestr 需要替换的结果中的字符串,例如kg 等字符
resethex 复位需要写入的16进制数据,不需要0x字符,默认为空, 开始操作,如新建记录的时候执行复位。 clear命令执行的写入字符。
digitalonly 仅接受数字,非数字的字符将被忽略。默认为true
数据集格式中的设置
<OBJECT TYPE="SERIALPORT" CODE="ysms" LABEL="米数" VISIBLE="TRUE" READONLY="FALSE" X="207" Y="50" HEIGHT="30" WIDTH="41" SIZERATIO="20,20"/>
编辑数据集中的设置
<SERIALPORT COL="ysms"></SERIALPORT>
Created with the Personal Edition of HelpNDoc: Generate Kindle eBooks with ease