GetHandshakeSignals

<< Click to Display Table of Contents >>

Navigation:  Reference (Scripting) > Docklight Script Commands - The DL Object > Methods (Advanced) >

GetHandshakeSignals

Returns the current handshake signal states (CTS, DSR, DCD, RI) as an integer bit value, in the same way the Receive Sequence function character ‘!’ works.

 

Return Value

 

Integer

 

Syntax

 

result = DL.GetHandshakeSignals()

 

Remarks

 

result is a bit value with the following components:

 

Bit No.

Decimal Value

Handshake Signal

0

001

CTS = High

1

002

DSR = High

2

004

DCD = High

3

008

RI (Ring Indicator) = High

 

In Tap Pro / Tap 485 applications, GetHandshakeSignals returns the following extended set of handshake signal states:

 

Bit No.

Decimal Value

Handshake Signal

0

001

CTS = High (DCE side / Docklight Receive Channel 2)

1

002

DSR = High (DCE side / Channel 2)

2

004

DCD = High (DCE side / Channel 2)

3

008

RI (Ring Indicator) = High (DCE side / Channel 2)

4

016

RTS = High (DTE side / Channel 1)

5

032

DTR = High (DTE side / Channel 1)

 

See also SetHandshakeSignals for controlling the state of the RTS and DTR lines.

 

Example

 

' Example GetHandshakeSignals

DL.StartCommunication

Do

  DL.AddComment DL.GetDocklightTimeStamp() & " - GetHandshakeSignals() = " & DL.GetHandshakeSignals()

   DL.Pause 200

Loop

 

Example Communication Window output:

 

6/23/2012 10:07:44.244  - GetHandshakeSignals() = 0

6/23/2012 10:07:44.469  - GetHandshakeSignals() = 48

6/23/2012 10:07:44.677  - GetHandshakeSignals() = 48

6/23/2012 10:07:44.884  - GetHandshakeSignals() = 48

 

NOTE: It can take 5-10 milliseconds after StartCommunication until GetHandshakeSignals reports the correct signal state.