About PortController
Introduction
Purchasing PortController
Redistributing PortController
License Agreement
Support
Getting Started
How to Use PortController
Using PortController with Visual Basic
Using PortController with Visual C++
Using PortController with Delphi
How to Use Events
Handling Events in Visual Basic
Handling Events in Visual C++
Handling Events in Delphi
PortController Sample Projects
Reading and Writing Binary Data
Handling PortController Errors
Reference
Properties
BaudRate Property
Break Property
BytesUsedRQ Property
BytesUsedTQ Property
Cd Property
Cts Property
DataBits Property
Dsr Property
Dtr Property
DtrDsr Property
EnableReadOnEventChar Property
EventChar Property
Parity Property
PortHandle Property
PortName Property
Ring Property
Rts Property
RtsCts Property
StopBits Property
XonXoff Property
Methods
ClearRQ Method
ClearTQ Method
Close Method
GetErrorStatus Method
Open Method
Read Method
ReadBinary Method
Write Method
WriteBinary Method
SendXoff Method
SendXon Method
Events
BreakSignal Event
CdToggle Event
CtsToggle Event
DataReceived Event
DsrToggle Event
Error Event
EvtCharReceived Event
Ring Event
TQEmpty Event

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()