优利特血细胞分析仪下位机串口通信协议

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

3000下位机串口通信协议

一、数据链路MAC子层参数约定

波特率:115200

奇偶校验位:无

数据位:8 bits,

停止位:1bit

二、链路层帧格式

1.帧格式

消息格式:

2.各字段、控制字定义

三、Message字段的结构

1.消息格式

四、测量结果传送

各种类型DATA数据字段格式、内容:

数据内容从高到低依次为:

1.19项参数数据(与界面显示顺序相同),每项2字节,共38字节。2.WBC直方图,256字节

3.RBC直方图,256字节

4.PLT直方图,128字节

5.标杆参数,顺序为:WBC标杆,4字节;RBC标杆,2字节;PLT标杆,2字节;共8字节。

6.R1,R2,R3,R4,PM报警,每项1字节,共5字节。

7.WBC计数时间,2字节

8.RBC计数时间,2字节

四、传输端程序

case TRANSFER_RESULT:

{

tx_temp[1] = 0x02; //STX

tx_temp[1] = 0x02; //LENGHT

tx_temp[2] = 0xc5;

tx_temp[3] = 0x38; // TYPE

tx_temp[4] = 0x01; //DATA TYPE

tx_temp[5] = (uchar)(wbc >> 8); // WBC

tx_temp[6] = (uchar)wbc;

tx_temp[7] = (uchar)(w_scr >> 8); // L Y%

tx_temp[8] = (uchar)w_scr;

tx_temp[9] = (uchar)(w_mcr >> 8); // MO%

tx_temp[10] = (uchar)w_mcr;

tx_temp[11] = (uchar)(w_lcr >> 8); // GR%

tx_temp[12] = (uchar)w_lcr;

tx_temp[13] = (uchar)(w_scc >> 8); // L Y#

tx_temp[14] = (uchar)w_scc;

tx_temp[15] = (uchar)(w_mcc >> 8); // MO#

tx_temp[16] = (uchar)w_mcc;

tx_temp[17] = (uchar)(w_lcc >> 8); // GR#

tx_temp[18] = (uchar)w_lcc;

tx_temp[19] = (uchar)(rbc >> 8); // RBC

tx_temp[20] = (uchar)rbc;

tx_temp[21] = (uchar)(hgb >> 8); // HGB

tx_temp[22] = (uchar)hgb;

tx_temp[23] = (uchar)(hct >> 8); // HCT

tx_temp[24] = (uchar)hct;

tx_temp[25] = (uchar)(mcv >> 8); // MCV

tx_temp[26] = (uchar)mcv;

tx_temp[27] = (uchar)(mch >> 8); // MCH

tx_temp[28] = (uchar)mch;

tx_temp[29] = (uchar)(mchc >> 8); // MCHC tx_temp[30] = (uchar)mchc;

tx_temp[31] = (uchar)(rdw_cv >> 8); // RDW_cv tx_temp[32] = (uchar)rdw_cv;

tx_temp[33] = (uchar)(rdw_sd >> 8); //rdw_sd

tx_temp[34] = (uchar)rdw_sd;

tx_temp[35] = (uchar)(plt >> 8); // PLT

tx_temp[36] = (uchar)plt;

tx_temp[37] = (uchar)(mpv >> 8); // MPV

tx_temp[38] = (uchar)mpv;

tx_temp[39] = (uchar)(pdw >> 8); // PDW

tx_temp[40] = (uchar)pdw;

tx_temp[41] = (uchar)(pct >> 8); // MPV

tx_temp[42] = (uchar)pct;

for( i = 0; i < 256; i++ )

{

tx_temp[43 + i] = wbchist[i];

tx_temp[299 + i] = rbchist[i];

if( i < 128 )

tx_temp[555 + i] = plthist[i];

}

tx_temp[683] = swbclline;

tx_temp[684] = swbchline;

tx_temp[685] = lwbclline;

tx_temp[686] = lwbchline;

tx_temp[687] = rbclline;

tx_temp[688] = rbchline;

tx_temp[689] = pltlline;

tx_temp[690] = plthline;

tx_temp[691] = alarm.r1;

tx_temp[692] = alarm.r2;

tx_temp[693] = alarm.r3;

tx_temp[694] = alarm.r4;

tx_temp[695] = alarm.pm;

tx_temp[696] = alarm.wbctime >> 8;

tx_temp[697] = alarm.wbctime;

tx_temp[697] = alarm.rbctime >> 8;

tx_temp[699] = alarm.rbctime;

tx_temp[700] = bh[5];

tx_temp[701] = bh[4];

tx_temp[702] = bh[3];

tx_temp[703] = bh[2];

tx_temp[704] = bh[1];

tx_temp[705] = bh[0];

tx_temp[706] = timer.year;

tx_temp[707] = timer.month;

tx_temp[708] = timer.date;

tx_temp[709] = timer.hour;

tx_temp[710] = timer.minute;

tx_temp[711] = timer.second;

tx_temp[712] = 0x03; //ETX;

tx_temp[713] = 0;

for( i = 1; i < 713; i++ )

{

tx_temp[713] = tx_temp[i] ^ tx_temp[713]; //LRC }

}

break;

相关文档
最新文档