TApxSLController Component

HierarchyProperties

Unit:

AxStatLt

The TApxSLController component monitors the status of a TApxComPort component and changes the state of one or more TApxStatusLight components to reflect that status. The goal of the component is to give communications programs a status light display similar to the LEDs found on external modems.

TApxSLController is capable of monitoring the port's line signals (DCD, DTR, CTS, and RI), line breaks and errors, and whether data is currently being received or transmitted.

The Lights property

The controller has a property called Lights which holds pointers to the status light components that the controller will be monitoring. Lights is of type TLightSet which is simply a class that contains a property of type TApxCustomStatusLight for each line condition that TApxSLController can monitor. In the Object Inspector, the Lights property has eight subproperties that are used to assign status lights to the line conditions you want to monitor.

The following table shows a list of all Lights subproperties and the port condition they monitor:

Sub-property
Line condition
BREAKLight
Lit when a line break occurs
CTSLight
Lit when CTS signal high
DCDLight
Lit when DCD signal high
DSRLight
Lit when DSR signal high
ERRORLight
Lit when a line error occurs
RINGLight
Lit after RI signal goes high
RXDLight
Lit when data is being received
TXDLight
Lit when data is being transmitted

Using a TApxSLController

To use a TApxSLController, first create a TApxStatusLight component for each line condition you want the controller to monitor. Next, drop a TApxSLController component on the form and link it to the TApxComPort component you wish to monitor. Next, link the controller's light properties to the status light components. Set the controller's Monitoring property to True at run time when you want to start monitoring.

When the CTS signal changes, the component named CTSLight is changed accordingly. Similarly, the component named DSRLight changes when the DSR signal changes, the DCDLight component changes when the DCD signal changes, and so on.