TApxComPort.Open

TApxComPort

property Open : Boolean

Default:False

Determines whether the physical port is opened and initialized with all current port properties.

Open must be set toTruebefore a comport component can send or receive characters. If the AutoOpen property is set toTrue, the comport component will open itself automatically under many conditions: calling any I/O method or property or when a component that uses a TApxComPort is loaded.

When Open is set toTrue, the TApxComPort uses all current property settings to allocate input and output buffers, open the physical port, initialize the line settings and flow control settings, and enable or disable debug logging. It then registers a low-level trigger for the port, which gets the first look at all trigger events and passes control on to the appropriate OnTriggerXxx event handlers.

When Open is set toFalse, the TApxComPort turns off debug logging (which creates an output file if any information has been buffered), closes the physical port, and deallocates input and output buffers.

There is no harm done by setting Open toTrue when it is already True, or setting it to False when it is already False.

See also: AutoOpen