简体   繁体   English

如何在c#中创建一个程序以通过USB读取串行数据

[英]How to create a program in c# that reads serial data via USB

I have a device that connects to my computer via USB. 我有一台通过USB连接到我的计算机的设备。 It sends a bunch of serial data but I am particularly interested in being able to read bytes 62-65, and placing them in a byte array. 它发送了一堆串行数据,但是我对能够读取62-65字节并将它们放置在字节数组中特别感兴趣。 I would like to create a program in c# that does this. 我想在C#中创建一个执行此操作的程序。 I have yet to find any good tutorials to teach me this stuff. 我还没有找到任何好的教程来教我这些东西。 I'm hoping this will help. 我希望这会有所帮助。

Use SerialPort 使用串口

The documentation contains some example usages of the class including reading bytes from a serial port. 该文档包含该类的一些示例用法,包括从串行端口读取字节。

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

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