Dtr Property
Sets and returns the state of the data-terminal-ready signal.
Syntax
Visual Basic
object.Dtr [ = value ]
Visual C++
object.GetDtr()
object.SetDtr(value)
Delphi
object.Dtr [:= value ]
| Part
| Description |
| object |
An object expression that evaluates to a PortController object. |
| value |
A boolean value representing the state of the DTR signal.
|
Example
Visual Basic
'Set Dtr
myPortController.Dtr = True
'Get Dtr
Dim dtr As Boolean
dtr = myPortController.Dtr
Visual C++
// Set Dtr
m_myPortController.SetDtr(true);
// Get Dtr
BOOL bDtr = m_myPortController.GetDtr();
Delphi
// Set Dtr
myPortController.Dtr := Ord(True);
// Get Dtr
var dtr: boolean; // declare variable in the proper place
dtr := myPortController.Dtr <> 0;
Remarks
When DTR/DSR handshaking is enabled the DTR line fluctuates between on and off.
Reading the Dtr property returns the current value of the fluctuating DTR line.
Returns
The boolean value TRUE if the DTR signal is on, FALSE otherwise.
Errors
Attempting to set the DTR signal while DTR/DSR handshaking is enabled
is not permitted and will cause the PortController to throw a "Unable to set Dtr value while
Dtr/Dsr handshaking is enabled" exception.
See Also
Rts, Break, SendXon(), SendXoff()
|