大家好,
使用C#我通过串口读取称重机的读数。
Using C# I read the readings from a weighing machine through serial port.
读数为
我调试并看到它接受/ n / r
While I debug and saw it taking /n/r
在文本框中我可以看到如下连续流。但是我只需要将重量作为单个数字,并且它必须根据重量机器波动。
In the textbox I can see like the below continuous streams. But I need to get only the weight as single number and also it must fluctuate according to the weight machine.
请帮助我如何实现这个
我使用了SerialPort.ReadExisting()来捕获这个,我得到如下所示
I used SerialPort.ReadExisting() to capture this and I am getting like below
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
谢谢
记住过去的挑战未来"
推荐答案
看来每个weigt的结尾都是一个返回。所以一次读一行
It appears the end of each weigt is a return. So read one line at a time
port.ReadLine() ;
port.ReadLine();
更多推荐
如何在通过串口从称重机读取时停止连续流
发布评论