|
-
Mar 23rd, 2023, 01:40 AM
#1
Thread Starter
Addicted Member
SerialPort Change Configuration in runtime
Hello,
I need to use RS232 with an old device that use different configuration for TX and RX:
TX:
9600 bps, Parity.Even, data bit 8
RX
9600 bps, Parity.None, data bit 7
I've tried to switch them in runtime, without close the port, but It not work very well, sometime TX command are not received from device, and may time the buffer RX buffer is corrupted. So I tried to
Port.Close before the configuration switch. Command sended(TX) work fine, but I have iusse in RX: I close DataReceived event to retrive data and parse it and then call the TX routine to answer, when I close the port to switch to TX it exit from the RX event or the TX routine (if called from the event).
My switch routines is similar to:
SerialPort1.Close;
'Here Change Config.
SerialPort1.Open
Which is the best way to go? Any advice?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|