从串行端口重新定义数据 [英] Recive Data from serial Port Undefine

查看:126
本文介绍了从串行端口重新定义数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是c#语言的Devloper,我做应用程序从Backman DXC 600i机器实验室vai串口发送和接收数据。我的应用程序是来自串口的recive数据,但数据是加密的,当我将数据转换为任何编码系统时,数据不正确,例如:Byte = 113-103-45-103-111-110-94-94-119- 103-103-103-103-94-23-103-111-95-86-86-94-94-94-86-94-94-94-86-94-94-94-94-94-94- 95-94-94-94-94-94-94-94-110-111-53-119-103-103-103-103-103-103-103-103-103-103-103-103-103- 119-119-0-



HEX = 71 67 2D 67 6F 6E 5E 5E 77 67 67 67 67 5E 17 67 6F 5F 56 56 5E 5E 5E 56 5E 5E 5E 56 5E 5E 5E 5E 5E 5E 5F 5E 5E 5E 5E 5E 5E 5E 6E 6F 35 77 67 67 67 67 67 67 67 67 67 67 67 67 67 77 77 00



UT8 = qg-gon ^^ wgggg ^ go_VV ^^^ V ^^^ V ^^^^^^ _ ^^^^^^^ no5wgggggggggggggww



我想要这样的数据O | 1 | SAMPLE123 ^ 4 ^ 3 ^ lot1 ^ control 1 || ^^^ 01A ^ 1 \ ^^^ 73A ^ 1 \ ^^^ 63A ^ 1 \ ^^^ 75A ^ 1 \ ^^^ 11A ^ 1 \ ^^^ 95A ^ 1 | R | 20060316135300 |||| John | N ||||尿液||| 1 ^ 1



请帮帮我。

I am Devloper for c# Language , I do Application to send and recive data from Backman DXC 600i Machine Laboratory vai Serial port . My application is recive data from serial port but the data is encryption , when I convert data to any encoding system ,The data is incorrect for example : Byte = 113-103-45-103-111-110-94-94-119-103-103-103-103-94-23-103-111-95-86-86-94-94-94-86-94-94-94-86-94-94-94-94-94-94-95-94-94-94-94-94-94-94-110-111-53-119-103-103-103-103-103-103-103-103-103-103-103-103-103-119-119-0-

HEX =71 67 2D 67 6F 6E 5E 5E 77 67 67 67 67 5E 17 67 6F 5F 56 56 5E 5E 5E 56 5E 5E 5E 56 5E 5E 5E 5E 5E 5E 5F 5E 5E 5E 5E 5E 5E 5E 6E 6F 35 77 67 67 67 67 67 67 67 67 67 67 67 67 67 77 77 00

UT8=qg-gon^^wgggg^go_VV^^^V^^^V^^^^^^_^^^^^^^no5wgggggggggggggww

I want data like this O|1|SAMPLE123^4^3^lot1^control 1||^^^01A^1\^^^73A^1\^^^63A^1\^^^75A^1\^^^11A^1\^^^95A^1|R|20060316135300||||John|N||||Urine|||1^1

Please help me.

推荐答案

基于ex的样本你已经显示了我的格式,我猜这是HL7格式的数据,虽然我不熟悉以单个'O'开头的任何HL7消息。



如果它是HL7接口,则数据不太可能被加密,因为HL7标准是关于连接来自不同制造商的设备。



我相信它是更有可能的是,您只是没有使用正确的参数打开您的串行端口。首先,确保使用与发送数据的设备相同的波特率。如果您的波特率设置确实正确,请检查其他基本参数数据位,奇偶校验位和停止位。



Soren Madsen
Based on the sample of the expected format you have shown, I am guessing this is HL7 formatted data, although I am not familiar with any of the HL7 messages starting with a single 'O'.

If it is an HL7 interface, it is highly unlikely that the data is encrypted, since the HL7 standard is all about connecting devices from different manufacturers.

I believe it is much more likely, that you simply don't open your serial port with the correct parameters. To begin with, make sure you are using the same baud rate as the device sending the data. If your baud rate setting is indeed correct, check the other 'basic' parameters Data bits, Parity and Stop bits.

Soren Madsen


请参阅

机器控制器 [ ^ ]


我发送此参数Buad rate = 9600,stopbit = 1,databit = 8,parity = none。

机器有这个参数
I send this Parameters Buad rate =9600 , stopbit = one , databit =8,parity= none.
The Machine is have this parameter


这篇关于从串行端口重新定义数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆