AdsConnection Class

ADS Connection class

Inheritance Hierarchy

System.Object
  TwinCAT.Ads.AdsConnection
Namespace:  TwinCAT.Ads
Assembly:  TwinCAT.Ads (in TwinCAT.Ads.dll) Version: 4.3.0.0

Syntax

C#

public sealed class AdsConnection : IAdsConnection, 
    IConnection, IConnectionStateProvider, IAdsNotifications, IAdsAnyAccess, IAdsHandleAccess, 
    ITcAdsRpcInvoke, IDisposable

VB

Public NotInheritable Class AdsConnection
    Implements IAdsConnection, IConnection, IConnectionStateProvider, IAdsNotifications, 
    IAdsAnyAccess, IAdsHandleAccess, ITcAdsRpcInvoke, IDisposable

The AdsConnection type exposes the following members.

Properties

 

Name

Description

AdsConnection Class 1:

AccessWaitTime

Gets the access wait time.

AdsConnection Class 2:

ActiveSince

Gets the UTC time when tha last active/resurrected Connection was established

AdsConnection Class 3:

Address

Gets the AmsAddress of the ADS server.

AdsConnection Class 4:

ClientAddress

Get the AmsAddress of the ADS client.

AdsConnection Class 5:

ConnectionEstablishedAt

Gets the UTC time when the Connection was originally established.

AdsConnection Class 6:

ConnectionLostCount

Gets the connection lost count.

AdsConnection Class 7:

ConnectionLostTime

Gets the connection lost time.

AdsConnection Class 8:

AdsConnection Class 9:

ConnectionState

Gets the current Connection state of the AdsConnection

AdsConnection Class 10:

Disposed

Gets a value indicating whether this AdsConnection is disposed.

AdsConnection Class 11:

Id

Gets the AdsConnection identifier.

AdsConnection Class 12:

IsActive

Gets a value indicating whether communication is in active state

AdsConnection Class 13:

IsConnected

Gets a value indicating whether the local ADS port was opened successfully. It does not indicate if the target port is available. Use the method ReadState to determine if the target port is available.

AdsConnection Class 14:

IsLocal

Gets a value indicating whether the ADS client is connected to a ADS Server on the local computer.

AdsConnection Class 15:

IsLost

Gets a value indicating whether the communication is in lost / open state

AdsConnection Class 16:

IsReconnecting

Gets a value indicating whether communication is ready for reconnecting

AdsConnection Class 17:

Name

Gets the name.

AdsConnection Class 18:

ResurrectingTries

Gets the number of tries to resurrect the AdsConnection.

AdsConnection Class 19:

Resurrections

Gets the number of succeeded connection resurrections.

AdsConnection Class 20:

Session

Gets the Session object of the AdsConnection object.

AdsConnection Class 21:

State

Gets the current ConnectionState

AdsConnection Class 22:

Timeout

Gets the timeout (in milliseconds)

Methods

 

Name

Description

AdsConnection Class 23:

AddDeviceNotification(String, AdsStream, AdsTransMode, Int32, Int32, Object)

Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.

AdsConnection Class 24:

AddDeviceNotification(UInt32, UInt32, AdsStream, AdsTransMode, Int32, Int32, Object)

Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.

AdsConnection Class 25:

AddDeviceNotification(String, AdsStream, Int32, Int32, AdsTransMode, Int32, Int32, Object)

Adds the device notification.

AdsConnection Class 26:

AddDeviceNotification(UInt32, UInt32, AdsStream, Int32, Int32, AdsTransMode, Int32, Int32, Object)

Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.

AdsConnection Class 27:

AddDeviceNotificationEx(String, AdsTransMode, Int32, Int32, Object, Type)

Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.

AdsConnection Class 28:

AddDeviceNotificationEx(String, AdsTransMode, Int32, Int32, Object, Type, .Int32.)

Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.

AdsConnection Class 29:

AddDeviceNotificationEx(UInt32, UInt32, AdsTransMode, Int32, Int32, Object, Type)

Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.

AdsConnection Class 30:

AddDeviceNotificationEx(UInt32, UInt32, AdsTransMode, Int32, Int32, Object, Type, .Int32.)

Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event. If type is a string type, the first element of the parameter args specifies the number of characters of the string. If type is an array type, the number of elements for each dimension has to be specified in the parameter args. At the moment only 1 dimensional Arrays are supported.

AdsConnection Class 31:

Close

Closes the AdsConnection

AdsConnection Class 32:

Connect

(Re)Connects the IConnection when disconnected.

AdsConnection Class 33:

AdsConnection Class 34:

CreateSymbolLoader

Creates a new instance of the Symbol loader with the specified mode.

AdsConnection Class 35:

CreateVariableHandle

Generates a unique handle for an ADS variable.

AdsConnection Class 36:

DeleteDeviceNotification

Deletes an existing notification.

AdsConnection Class 37:

DeleteVariableHandle

Releases the handle of a ADS variable again.

AdsConnection Class 38:

Disconnect

Disconnects this IConnection.

AdsConnection Class 39:

Dispose

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

AdsConnection Class 40:

Equals

Determines whether the specified object is equal to the current object. (Inherited from Object.)

AdsConnection Class 41:

GetHashCode

Serves as the default hash function. (Inherited from Object.)

AdsConnection Class 42:

GetType

Gets the Type of the current instance. (Inherited from Object.)

AdsConnection Class 43:

InvokeRpcMethod(String, Int32, .Object.)

Invokes the specified RPC Method

AdsConnection Class 44:

InvokeRpcMethod(String, String, .Object.)

Invokes the specified RPC Method

AdsConnection Class 45:

InvokeRpcMethod(ITcAdsSymbol, Int32, .Object.)

Invokes the specified RPC Method

AdsConnection Class 46:

InvokeRpcMethod(ITcAdsSymbol, String, .Object.)

Invokes the specified RPC Method.

AdsConnection Class 47:

Read(Int32, AdsStream)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 48:

Read(UInt32, UInt32, AdsStream)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 49:

Read(Int32, AdsStream, Int32, Int32)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 50:

Read(UInt32, UInt32, .Byte., Int32, Int32)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 51:

Read(UInt32, UInt32, AdsStream, Int32, Int32)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 52:

Read(UInt32, UInt32, .Byte., Int32, Int32, Int32)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 53:

Read(UInt32, UInt32, AdsStream, Int32, Int32, Int32)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 54:

ReadAny(Int32, Type)

Reads data synchronously from an ADS device and writes it to an object.

AdsConnection Class 55:

ReadAny(Int32, Type, .Int32.)

Reads any.

AdsConnection Class 56:

ReadAny(UInt32, UInt32, Type)

Reads data synchronously from an ADS device and writes it to an object.

AdsConnection Class 57:

ReadAny(UInt32, UInt32, Type, .Int32.)

Reads data synchronously from an ADS device and writes it to an object. If the Type of the object to be read is a string type, the first element of the parameter args specifies the number of characters of the string. If the Type of the object to be read is an array type, the number of elements for each dimension has to be specified in the parameter args. At the moment only 1 dimensional Arrays are supported.

AdsConnection Class 58:

ReadAny(UInt32, UInt32, Type, .Int32., Int32)

Reads data synchronously from an ADS device and writes it to an object. If the Type of the object to be read is a string type, the first element of the parameter args specifies the number of characters of the string. If the Type of the object to be read is an array type, the number of elements for each dimension has to be specified in the parameter args. At the moment only 1 dimensional Arrays are supported.

AdsConnection Class 59:

ReadAnyString(Int32, Int32, Encoding)

Reads the string.

AdsConnection Class 60:

ReadAnyString(UInt32, UInt32, Int32, Encoding)

Reads the string

AdsConnection Class 61:

ReadDeviceInfo

Reads the identification and version number of an ADS server.

AdsConnection Class 62:

ReadState.

Reads the ADS status and the device status from an ADS server.

AdsConnection Class 63:

ReadState(Int32)

Reads the ADS status and the device status from an ADS server.

AdsConnection Class 64:

ReadSymbol(ITcAdsSymbol)

Reads the value of a symbol and returns it as an object. Strings and all primitive datatypes(UInt32, Int32, Bool etc.) are supported. Arrays and structures cannot be read.

AdsConnection Class 65:

ReadSymbol(String, Type, Boolean)

Reads the value of a symbol and returns the value as object. The parameter type must have the same layout as the ADS symbol.

AdsConnection Class 66:

ReadSymbolInfo

Call this method to obtain information about the individual symbols (variables) in ADS devices.

AdsConnection Class 67:

ReadWrite(UInt32, UInt32, AdsStream, AdsStream)

Writes data synchronously to an ADS device and then Reads data from this device.

AdsConnection Class 68:

ReadWrite(UInt32, UInt32, AdsStream, AdsStream, Int32)

Writes data synchronously to an ADS device and then Reads data from this device.

AdsConnection Class 69:

ReadWrite(Int32, AdsStream, Int32, Int32, AdsStream, Int32, Int32)

Writes data synchronously to an ADS device and then Reads data from this device.

AdsConnection Class 70:

ReadWrite(UInt32, UInt32, .Byte., Int32, Int32, .Byte., Int32, Int32)

Writes data synchronously to an ADS device and then reads data from this device.

AdsConnection Class 71:

ReadWrite(UInt32, UInt32, AdsStream, Int32, Int32, AdsStream, Int32, Int32)

Writes data synchronously to an ADS device and then Reads data from this device.

AdsConnection Class 72:

ReadWrite(UInt32, UInt32, .Byte., Int32, Int32, .Byte., Int32, Int32, Int32)

Writes data synchronously to an ADS device and then Reads data from this device.

AdsConnection Class 73:

ReadWrite(UInt32, UInt32, AdsStream, Int32, Int32, AdsStream, Int32, Int32, Int32)

Writes data synchronously to an ADS device and then Reads data from this device.

AdsConnection Class 74:

ToString

Returns a string that represents the current object. (Inherited from Object.)

AdsConnection Class 75:

TryAddDeviceNotification

Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.

AdsConnection Class 76:

TryAddDeviceNotificationEx

Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.

AdsConnection Class 77:

TryDeleteDeviceNotification

Deletes an existing notification.

AdsConnection Class 78:

TryInvokeRpcMethod(String, Int32, .Object., Object.)

Invokes the specified RPC Method

AdsConnection Class 79:

TryInvokeRpcMethod(String, String, .Object., Object.)

Invokes the specified RPC Method

AdsConnection Class 80:

TryInvokeRpcMethod(ITcAdsSymbol, Int32, .Object., Object.)

Invokes the specified RPC Method

AdsConnection Class 81:

TryInvokeRpcMethod(ITcAdsSymbol, String, .Object., Object.)

Invokes the specified RPC Method.

AdsConnection Class 82:

TryRead(Int32, AdsStream, Int32, Int32, Int32.)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 83:

TryRead(UInt32, UInt32, .Byte., Int32, Int32, Int32.)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 84:

TryRead(UInt32, UInt32, AdsStream, Int32, Int32, Int32.)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 85:

TryRead(UInt32, UInt32, .Byte., Int32, Int32, Int32, Int32.)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 86:

TryRead(UInt32, UInt32, AdsStream, Int32, Int32, Int32, Int32.)

Reads data synchronously from an ADS device and writes it to the given stream.

AdsConnection Class 87:

TryReadState(StateInfo.)

Reads the ADS status and the device status from an ADS server. Unlike the ReadState method this method does not call an exception on failure. Instead an AdsErrorCode is returned. If the return value is equal to AdsErrorCode.NoError the call was successful.

AdsConnection Class 88:

TryReadState(Int32, StateInfo.)

Reads the ADS status and the device status from an ADS server. Unlike the ReadState method this method does not call an exception on failure. Instead an AdsErrorCode is returned. If the return value is equal to AdsErrorCode.NoError the call was successfull.

AdsConnection Class 89:

TryReadWrite(Int32, AdsStream, Int32, Int32, AdsStream, Int32, Int32, Int32.)

Writes data synchronously to an ADS device and then Reads data from this device.

AdsConnection Class 90:

TryReadWrite(UInt32, UInt32, .Byte., Int32, Int32, .Byte., Int32, Int32, Int32.)

Writes data synchronously to an ADS device and then Reads data from this device.

AdsConnection Class 91:

TryReadWrite(UInt32, UInt32, AdsStream, Int32, Int32, AdsStream, Int32, Int32, Int32.)

Writes data synchronously to an ADS device and then Reads data from this device.

AdsConnection Class 92:

TryReadWrite(UInt32, UInt32, .Byte., Int32, Int32, .Byte., Int32, Int32, Int32, Int32.)

Writes data synchronously to an ADS device and then Reads data from this device.

AdsConnection Class 93:

TryReadWrite(UInt32, UInt32, AdsStream, Int32, Int32, AdsStream, Int32, Int32, Int32, Int32.)

Writes data synchronously to an ADS device and then Reads data from this device.

AdsConnection Class 94:

TryWrite(Int32, AdsStream, Int32, Int32)

Writes data synchronously to an ADS device.

AdsConnection Class 95:

TryWrite(UInt32, UInt32, .Byte., Int32, Int32)

Writes data synchronously to an ADS device.

AdsConnection Class 96:

TryWrite(UInt32, UInt32, AdsStream, Int32, Int32)

Writes data synchronously to an ADS device.

AdsConnection Class 97:

TryWrite(UInt32, UInt32, .Byte., Int32, Int32, Int32)

Writes data synchronously to an ADS device.

AdsConnection Class 98:

TryWrite(UInt32, UInt32, AdsStream, Int32, Int32, Int32)

Writes data synchronously to an ADS device.

AdsConnection Class 99:

TryWriteControl(StateInfo)

Changes the ADS status and the device status of an ADS server.

AdsConnection Class 100:

TryWriteControl(StateInfo, Int32)

Changes the ADS status and the device status of an ADS server.

AdsConnection Class 101:

TryWriteControl(StateInfo, AdsStream, Int32, Int32)

Changes the ADS status and the device status of an ADS server.

AdsConnection Class 102:

TryWriteControl(StateInfo, AdsStream, Int32, Int32, Int32)

Changes the ADS status and the device status of an ADS server.

AdsConnection Class 103:

Write(Int32, AdsStream)

Writes data synchronously to an ADS device.

AdsConnection Class 104:

Write(UInt32, UInt32)

Trigger Client Method/Command.

AdsConnection Class 105:

Write(UInt32, UInt32, Int32)

Trigger Client Method/Command.

AdsConnection Class 106:

Write(UInt32, UInt32, AdsStream)

Writes data synchronously to an ADS device.

AdsConnection Class 107:

Write(Int32, AdsStream, Int32, Int32)

Writes data synchronously to an ADS device.

AdsConnection Class 108:

Write(UInt32, UInt32, AdsStream, Int32)

Writes data synchronously to an ADS device.

AdsConnection Class 109:

Write(UInt32, UInt32, .Byte., Int32, Int32)

Writes data synchronously to an ADS device.

AdsConnection Class 110:

Write(UInt32, UInt32, AdsStream, Int32, Int32)

Writes data synchronously to an ADS device.

AdsConnection Class 111:

Write(UInt32, UInt32, .Byte., Int32, Int32, Int32)

Writes data synchronously to an ADS device.

AdsConnection Class 112:

Write(UInt32, UInt32, AdsStream, Int32, Int32, Int32)

Writes data synchronously to an ADS device.

AdsConnection Class 113:

WriteAny(Int32, Object)

Writes an object synchronously to an ADS device.

AdsConnection Class 114:

WriteAny(Int32, Object, .Int32.)

Writes an object synchronously to an ADS device. If the Type of the object to be written is a string type, the first element of parameter args specifies the number of characters of the string.

AdsConnection Class 115:

WriteAny(UInt32, UInt32, Object)

Writes an object synchronously to an ADS device.

AdsConnection Class 116:

WriteAny(UInt32, UInt32, Object, .Int32.)

Writes an object synchronously to an ADS device. If the Type of the object to be written is a string type, the first element of parameter args specifies the number of characters of the string.

AdsConnection Class 117:

WriteAny(UInt32, UInt32, Object, .Int32., Int32)

Writes an object synchronously to an ADS device. If the Type of the object to be written is a string type, the first element of parameter args specifies the number of characters of the string.

AdsConnection Class 118:

WriteControl(StateInfo)

Changes the ADS status and the device status of an ADS server.

AdsConnection Class 119:

WriteControl(StateInfo, Int32)

Changes the ADS status and the device status of an ADS server.

AdsConnection Class 120:

WriteControl(StateInfo, AdsStream, Int32, Int32)

Changes the ADS status and the device status of an ADS server.

AdsConnection Class 121:

WriteControl(StateInfo, AdsStream, Int32, Int32, Int32)

Changes the ADS status and the device status of an ADS server.

AdsConnection Class 122:

WriteSymbol(ITcAdsSymbol, Object)

Writes a value to the symbol. Strings and all primitive data types(UInt32, Int32, Bool etc.) are supported. Array and structures are not supported. If a string is passed as parameter, the method attempts to parse the string according to the ADS data type of the symbol.

AdsConnection Class 123:

WriteSymbol(String, Object, Boolean)

Writes the passed object value to the specified ADS symbol.The parameter type must have the same layout as the ADS symbol.

Events

 

Name

Description

AdsConnection Class 124:

AdsNotification

Occurs when the ADS device sends a notification to the client.

AdsConnection Class 125:

AdsNotificationError

Occurs when a exception has occurred during notification management.

AdsConnection Class 126:

AdsNotificationEx

Occurs when the ADS devices sends a notification to the client.

AdsConnection Class 127:

AdsStateChanged

Occurs when ADS State has been changed.

AdsConnection Class 128:

AdsSymbolVersionChanged

Occurs when the symbol version has been changed.

AdsConnection Class 129:

AmsRouterNotification

Occurs when the Route sends an Notification.

AdsConnection Class 130:

AdsConnection Class 131:

ConnectionStateChanged

Occurs when connection status of the AdsConnection has been changed.

Extension Methods

 

Name

Description

AdsConnection Class 132:

AdsConnection Class 133:

PollAdsState(IObservable.Unit.)

Overloaded.

Gets an observable sequence of AdsStates via Polling. (Defined by AdsClientExtensions.)

AdsConnection Class 134:

AdsConnection Class 135:

PollAdsState(TimeSpan)

Overloaded.

Gets an observable sequence of AdsStates via Polling. (Defined by AdsClientExtensions.)

AdsConnection Class 136:

PollValues(String, Type, IObservable.Unit.)

Overloaded.

Polls the symbol values on timepoints where the polling observable streams data / triggers (Defined by AnyTypeExtensions.)

AdsConnection Class 137:

PollValues(String, Type, TimeSpan)

Overloaded.

Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.)

AdsConnection Class 138:

PollValues(String, Type, .Int32., TimeSpan)

Overloaded.

Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.)

AdsConnection Class 139:

PollValues(String, Type, IObservable.Unit., Func.Exception, Object.)

Overloaded.

Polls the symbol values on timepoints where the polling observable streams data / triggers (Defined by AnyTypeExtensions.)

AdsConnection Class 140:

PollValues(String, Type, TimeSpan, Func.Exception, Object.)

Overloaded.

Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.)

AdsConnection Class 141:

PollValues(String, Type, .Int32., IObservable.Unit., Func.Exception, Object.)

Overloaded.

Polls the symbol values on time points where the polling observable streams data / triggers (Defined by AnyTypeExtensions.)

AdsConnection Class 142:

PollValues(String, Type, .Int32., TimeSpan, Func.Exception, Object.)

Overloaded.

Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.)

AdsConnection Class 143:

PollValues.T.(String, IObservable.Unit.)

Overloaded.

Polls the symbol values on timepoints where the polling observable streams data / triggers (Defined by AnyTypeExtensions.)

AdsConnection Class 144:

PollValues.T.(String, TimeSpan)

Overloaded.

Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.)

AdsConnection Class 145:

PollValues.T.(String, IObservable.Unit., Func.Exception, T.)

Overloaded.

Polls the symbol values on timepoints where the polling observable streams data / triggers (Defined by AnyTypeExtensions.)

AdsConnection Class 146:

PollValues.T.(String, TimeSpan, Func.Exception, T.)

Overloaded.

Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.)

AdsConnection Class 147:

PollValues.T.(String, .Int32., IObservable.Unit.)

Overloaded.

Polls the symbol values on time points where the polling observable streams data / triggers (Defined by AnyTypeExtensions.)

AdsConnection Class 148:

AdsConnection Class 149:

PollValues.T.(String, .Int32., TimeSpan)

Overloaded.

Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.)

AdsConnection Class 150:

PollValues.T.(String, .Int32., IObservable.Unit., Func.Exception, T.)

Overloaded.

Polls the symbol values on timepoints where the polling observable streams data / triggers (Defined by AnyTypeExtensions.)

AdsConnection Class 151:

AdsConnection Class 152:

PollValues.T.(String, .Int32., TimeSpan, Func.Exception, T.)

Overloaded.

Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.)

AdsConnection Class 153:

WhenNotification(ISymbol)

Overloaded.

Gets an observable sequence of Notifications. (Defined by AdsClientExtensions.)

AdsConnection Class 154:

AdsConnection Class 155:

WhenNotification(ISymbolCollection)

Overloaded.

Gets an observable sequence of Notification objects. (Defined by AdsClientExtensions.)

AdsConnection Class 156:

WhenNotification(ISymbol, NotificationSettings)

Overloaded.

Gets an observable sequence of Notifications. (Defined by AdsClientExtensions.)

AdsConnection Class 157:

AdsConnection Class 158:

WhenNotification(ISymbolCollection, NotificationSettings)

Overloaded.

Gets an observable sequence of Notification objects. (Defined by AdsClientExtensions.)

AdsConnection Class 159:

AdsConnection Class 160:

WhenValueChanged

Observable sequence of Values driven by ADS Notifications on the specified symbol. (Defined by ValueSymbolExtensions.)

AdsConnection Class 161:

AdsConnection Class 162:

WriteValues.T.(String, IObservable.T.)

Overloaded.

Writes the sequence of values to the symbol specified by the instance path. (Defined by AnyTypeExtensions.)

AdsConnection Class 163:

AdsConnection Class 164:

WriteValues.T.(String, IObservable.T., Action.Exception.)

Overloaded.

Writes the sequence of values to the symbol specified by the instance path. (Defined by AnyTypeExtensions.)

Remarks

The ADS Connection class represents an ADS Point-to-Point Connection between client and server. It is established by using the Connect method of the AdsSession object. An ADS Connection can have different ConnectionStates, which represent the state of the logical ADS connection.

Reference

TwinCAT.Ads Namespace

TwinCAT.Ads.AdsSession

TwinCAT.Ads.IAdsConnection

System.IDisposable