简体   繁体   中英

Access Serial Port VIA USB

I want to access a scale hooked up via a RS232 Serial Port. The machine I'm writing the C# code on does not have a serial port, so I was going to use a USB to Serial Port dongle. Will anything need to be changed with my code?

No, they emulate a serial port at the driver level. Your code, nor the SerialPort class, won't know the difference. The only temptation you'll have to resist is unplugging the USB cable while the port is opened. That works about as well as unplugging a flash memory stick while Windows is writing to it. Your customer will do it anyway, but they usually get bored with it after a couple of times.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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