Loading...
This chapter gives an overview of the members available for the TCP Server in the Configuration dialog.
Please read the chapter "TCP Server" if you would like to know how to add and use this device. As explained in the topic"Object and Member Notation (dot syntax)", all kinds of objects can be addressed in the scripting language by using their members which set (or return if applicable) properties or methods of that object. Please refer to the chapter "Script Language" for more details about scripting in general.
Project.Tcp_Server(deviceName or ID) |
Example: Alternative Example: |
This gives access to all further members of the device "Tcp_Server" from the Configuration dialog. Using the Project object is an alternative to addressing the device directly by entering its name. The Project object allows to address the device through its name or ID. Substituting the ID with a dynamic variable allows automation. Actions can be performed on many devices of the same type simultaneously, e.g. by using for-loops: |
Tcp_ServerName.Adapter |
Example: Alternative Example: |
This returns the name of the network adapter (NIC) of the TCP Server connection as a string. The result could look as follows: Lan1 You could also write it into a Widget, e.g. a Label via the script: Label1.Text = Tcp_Server1.IpAddress An alternative command is: Tcp_ServerID.GetAdapter In return, you can also assign another NIC to the TCP Server connection. WD automatically connects to it if it is a valid name. An alternative command is: Tcp_ServerID.SetAdapter |
Tcp_ServerName.Disable |
Example: Alternative Example: |
This disables the TCP Server connection in the Configuration dialog as if the "Enable" check box in the window was unchecked. Use the .Enable member to reverse this command. |
Tcp_ServerName.Enable |
Example: Alternative Example: |
This enables the TCP Server connection in the Configuration dialog as if the "Enable" check box in the window was checked. Use the .Disable member to reverse this command. |
Tcp_ServerName.GetAdapter |
Example: Alternative Example: |
This returns the name of the network adapter (NIC) of the TCP Server connection as a string. The result could look as follows: Lan1 You could also write it into a Widget, e.g. a Label via the script: Label1.Text = Tcp_Server1.IpAddress An alternative command is: Tcp_ServerID.Adapter |
Tcp_ServerName.IpAddress |
Example: Alternative Example: |
This returns the IP address of the TCP Server connection as a string. The result could look as follows: 10.169.80.10 You could also write it into a Widget, e.g. a Label via the script: Label1.Text = Tcp_Server1.IpAddress You cannot assign a value to .IpAddress; use the .Adapter member instead. |
Tcp_ServerName.IsConnected |
Example: Alternative Example: |
This member returns the connection status for the TCP Server connection as a Boolean value. The result is "True" if the connection is established and "False" if it is not. You could also write it into a Widget, e.g. a Label via the script: Label1.Text = Tcp_Server1.IsConnected |
Tcp_ServerName.IsEnabled |
Example: Alternative Example: |
This member returns the status of the check box "Enable" for the TCP Server connection in the Configuration dialog as a string or Boolean value. The result is "True" if the connection is enabled and "False" if it is currently not enabled. You could also write it into a Widget, e.g. a Label via the script: Label1.Text = Tcp_Server1.IsEnabled |
Tcp_ServerName.LastMessageReceived |
Example: Alternative Example: |
This returns the last message that was received from the TCP Server connection as a string value. You could also write it into a Widget, e.g. a Label via the script: Label1.Text = Tcp_Server1.LastMessageReceived |
Tcp_ServerName.Port |
Example: Alternative Example: |
This returns the port number of the TCP Server connection in the Configuration dialog as an integer value. The result could look as follows: 10001 You could also write it into a Widget, e.g. a Label via the script: Label1.Text = Tcp_Server1.Port In return, you can also assign another port to the TCP Server connection. WD automatically connects to it afterwards. |
Tcp_ServerName.Send(data) |
Example: Alternative Example: |
This allows to send a custom message to all connected TCP clients. Literal text should always be enclosed in either single or double quotation marks; otherwise, the text is handled like a variable. The example shows, how both can be combined. The global variable "Now" sends the current date and time. |
Tcp_ServerName.SetAdapter(NicAdapterName) |
Example: Alternative Example: |
This assigns the network adapter (NIC) named "Lan2" to the TCP Server connection. WD automatically connects to it if it is a valid name. An alternative command is: Tcp_ServerID.Adapter |