ConnectTo

Opens a communication channel between the object and an ADS device (PLC, NC, ...).

object.ConnectTo(
  sAmsNetId As String,
  nPort As Long
)

Parameters

sAmsNetId

AdsAmsNetId.

nPort

Port number.

Return value

-

Description

The first parameter contains the six-figure AdsAmsNetId. The individual values are separated from one another by a dot. If an empty string is passed, the local AdsAmsNetId is used.

If a communication channel was already open before the call to ConnectTo(), it is automatically closed. The communication channel is also closed if the object is deleted.

Examples

VBScript:

Dim TcClientSync
Set TcClientSync =
CreateObject("TCSCRIPT.TcScriptSync")
Call TcClientSync.ConnectTo("", 801)

JScript:

var TcClientSync;
TcClientSync = new
ActiveXObject("TCSCRIPT.TcScriptSync");
TcClientSync.ConnectTo("172.16.17.13.1.1", 811);