user9964422
user9964422

Reputation: 119

C# DtrEnable and RtsEnable in the serialPort

Could someone clarify for me what DtrEnable and RtsEnable do in the serialPort class? I'm trying to figure out if I should be using them at all in my program.

Upvotes: 4

Views: 5330

Answers (1)

user585968
user585968

Reputation:

I'm trying to figure out if I should be using them at all in my program.

It will depend on the device you are talking to and perhaps the baud rate. (back in the day, the higher the baud rate the higher the chances for data overlap and hence some means to control transmissions).

They are part of what is known as hardware flow control and is used as a means to ensure that data is only sent when the device is ready for it.

DTR or Data Terminal Ready (the name goes back to old terminal days, hence the name) to indicate that the terminal is on is ready to participate in serial communications. It is merely an overall ready state and by itself isn't particularly useful. It's partner DSR or Data Set Ready (e.g. modem) also has a corresponding overall readyness indicator.

Where it gets more exciting is in RTS (request to send) and CTS (clear to send). RTS is used by both devices when hardware flowcontrol is enabled. When either device wishes to send data, it turns on RTS. It won't send any data until the other device turns on the CTS signal.

Hardware flow control isn't required; it used to depend on the baud rate back in the day.

There is also software flow control that would send XON/XOFF signals to devices to control data transmission.

Upvotes: 8

Related Questions