简体   繁体   English

读取和发送数据到串行端口

[英]Reading from and Sending data to Serial port

I'm trying to do a serial port communication to send and receive data. 我正在尝试进行串口通信以发送和接收数据。 Here is the scenerio: 这是一个场景:

I connect to a serial port and start my device. 我连接到串口并启动我的设备。 When it's counting down to do something, I should pause it and send it some command to work. 当它倒计时做某事时,我应该暂停它并发送一些命令来工作。 It does all work and then again the starting continues. 它完成所有工作,然后再次开始继续。

Now i searched through the internet and c# fits me. 现在我通过互联网搜索,c#适合我。 Can you suggest anything to me while doing this? 这样做的时候你可以向我推荐一些东西吗? How can i start and which methods do i need to use ? 我该如何开始以及我需要使用哪些方法? Thank you. 谢谢。

.NET框架甚至有一个适当的SerialPort类 ,这对您的应用程序来说很合适。

这里有一个详细的指南这里覆盖在C#中使用串行端口很好的做法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM