从串口读取秤重量 [英] Scale weight reading from the serial port

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

问题描述

你好朋友

我从串口读取体重秤。

有人可以帮我这方面。

我正在使用C#。

Hello Friends
I'd have a weight scale read from the serial port.
Can someone help me in this regard.
I am using C #.

推荐答案

首先查看您使用的秤的制造商详细信息:它应该包括有关接口的重要细节,如速度,每个字符的位数,奇偶校验等,以及它使用的数据格式 - 并且无法保证它在任何方面都是标准 - 这就是为什么您的第一站应该是制造商。



然后通过连接和使用HyperTerminal或类似工具确保它适用于您的PC,以确保使用制造商提供的详细信息进行通信。



然后看看使用 SerialPort类 [ ^ ] - 该链接包含一个示例 - 可让您开始与代码进行通信。
Start by looking at the manufacturers details for the scale you are using: it should include the important details about the interface such as speed, bits per character, parity, and so forth, as well as the data format it is using - and there is no guarantee that it is "standard" in any way - which is why your first stop should be the manufacturer.

Then ensure that it works to your PC by connecting it and using HyperTerminal or similar to make sure that communications are working using the details from the manufacturer.

Then look at using the SerialPort class[^] - the link includes an example - which will let you start to form that communications with your code.


这篇关于从串口读取秤重量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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