GetChannelSettings

<< Click to Display Table of Contents >>

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

GetChannelSettings

Returns the current communication channel settings (COM port number or TCP address, serial port settings).  

 

NOTE: GetChannelSettings is a companion to the SetChannelSettings method, and intended for advanced Docklight Scripting applications where control of the communication channel settings is required.

 

Return Value

 

String

 

Syntax

 

result = DL.GetChannelSettings( [channelNo] )

 

The GetChannelSettings method syntax has these parts:

 

Part

Description

channelNo

Optional. Integer that specifies the communication channel if Communication Mode: Monitoring is used. Default value is 1 (Channel 1).

 

Remarks

 

GetChannelSettings returns a string with the current serial or TCP settings for the specified communication channel.

 

If the channel is a serial port, the return value has the following format:

COMxxx: BaudRate, Parity, DataBits, StopBits, FlowControl, ParityErrorChar

e.g. "COM1:9600,NONE,8,1,OFF,63"

 

If the channel is a TCP client, the return value is the current IP address and TCP port number, e.g. "192.0.0.1:3001".

 

If the channel is a TCP server, the return value is the string "SERVER:" plus the TCP port number, e.g. "SERVER:3001"

 

See also the SetChannelSettings method for a detailed overview on the return value data format, and a more complex example on how to manipulate channel settings during script runtime.

 

Example

 

' Example GetChannelSettings

 

DL.AddComment "Comm. Channel 1 Settings = " & DL.GetChannelSettings()

' The following command will only work,
' if Docklight Communication Mode is 'Monitoring (receive only)'

DL.AddComment "Comm. Channel 2 Settings = " & DL.GetChannelSettings(2)

 

The example could produce the following output in the Docklight Communication Window:

 

Comm. Channel 1 Settings = COM1:9600,NONE,8,1,OFF,63

 

Comm. Channel 2 Settings = SERVER:10001