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 |
---|---|---|
|
Gets the access wait time. | |
|
Gets the UTC time when tha last active/resurrected Connection was established | |
|
Gets the AmsAddress of the ADS server. | |
|
Get the AmsAddress of the ADS client. | |
|
Gets the UTC time when the Connection was originally established. | |
|
Gets the connection lost count. | |
|
Gets the connection lost time. | |
|
Gets the current Connection state of the AdsConnection | |
|
Gets a value indicating whether this AdsConnection is disposed. | |
|
Gets the AdsConnection identifier. | |
|
Gets a value indicating whether communication is in active state | |
|
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. | |
|
Gets a value indicating whether the ADS client is connected to a ADS Server on the local computer. | |
|
Gets a value indicating whether the communication is in lost / open state | |
|
Gets a value indicating whether communication is ready for reconnecting | |
|
Gets the name. | |
|
Gets the number of tries to resurrect the AdsConnection. | |
|
Gets the number of succeeded connection resurrections. | |
|
Gets the Session object of the AdsConnection object. | |
|
Gets the current ConnectionState | |
|
Gets the timeout (in milliseconds) |
Methods
|
Name |
Description |
---|---|---|
|
AddDeviceNotification(String, AdsStream, AdsTransMode, Int32, Int32, Object) |
Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event. |
|
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. |
|
AddDeviceNotification(String, AdsStream, Int32, Int32, AdsTransMode, Int32, Int32, Object) |
Adds the device notification. |
|
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. |
|
AddDeviceNotificationEx(String, AdsTransMode, Int32, Int32, Object, Type) |
Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event. |
|
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. |
|
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. |
|
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. |
|
Closes the AdsConnection | |
|
(Re)Connects the IConnection when disconnected. | |
|
Creates a new instance of the Symbol loader with the specified mode. | |
|
Generates a unique handle for an ADS variable. | |
|
Deletes an existing notification. | |
|
Releases the handle of a ADS variable again. | |
|
Disconnects this IConnection. | |
|
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. | |
|
Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
|
Serves as the default hash function. (Inherited from Object.) | |
|
Gets the Type of the current instance. (Inherited from Object.) | |
|
Invokes the specified RPC Method | |
|
Invokes the specified RPC Method | |
|
Invokes the specified RPC Method | |
|
Invokes the specified RPC Method. | |
|
Reads data synchronously from an ADS device and writes it to the given stream. | |
|
Reads data synchronously from an ADS device and writes it to the given stream. | |
|
Reads data synchronously from an ADS device and writes it to the given stream. | |
|
Reads data synchronously from an ADS device and writes it to the given stream. | |
|
Reads data synchronously from an ADS device and writes it to the given stream. | |
|
Reads data synchronously from an ADS device and writes it to the given stream. | |
|
Reads data synchronously from an ADS device and writes it to the given stream. | |
|
Reads data synchronously from an ADS device and writes it to an object. | |
|
Reads any. | |
|
Reads data synchronously from an ADS device and writes it to an object. | |
|
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. | |
|
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. | |
|
Reads the string. | |
|
Reads the string | |
|
Reads the identification and version number of an ADS server. | |
|
Reads the ADS status and the device status from an ADS server. | |
|
Reads the ADS status and the device status from an ADS server. | |
|
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. | |
|
Reads the value of a symbol and returns the value as object. The parameter type must have the same layout as the ADS symbol. | |
|
Call this method to obtain information about the individual symbols (variables) in ADS devices. | |
|
Writes data synchronously to an ADS device and then Reads data from this device. | |
|
Writes data synchronously to an ADS device and then Reads data from this device. | |
|
ReadWrite(Int32, AdsStream, Int32, Int32, AdsStream, Int32, Int32) |
Writes data synchronously to an ADS device and then Reads data from this device. |
|
ReadWrite(UInt32, UInt32, .Byte., Int32, Int32, .Byte., Int32, Int32) |
Writes data synchronously to an ADS device and then reads data from this device. |
|
ReadWrite(UInt32, UInt32, AdsStream, Int32, Int32, AdsStream, Int32, Int32) |
Writes data synchronously to an ADS device and then Reads data from this device. |
|
ReadWrite(UInt32, UInt32, .Byte., Int32, Int32, .Byte., Int32, Int32, Int32) |
Writes data synchronously to an ADS device and then Reads data from this device. |
|
ReadWrite(UInt32, UInt32, AdsStream, Int32, Int32, AdsStream, Int32, Int32, Int32) |
Writes data synchronously to an ADS device and then Reads data from this device. |
|
Returns a string that represents the current object. (Inherited from Object.) | |
|
Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event. | |
|
Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event. | |
|
Deletes an existing notification. | |
|
Invokes the specified RPC Method | |
|
Invokes the specified RPC Method | |
|
Invokes the specified RPC Method | |
|
Invokes the specified RPC Method. | |
|
Reads data synchronously from an ADS device and writes it to the given stream. | |
|
Reads data synchronously from an ADS device and writes it to the given stream. | |
|
Reads data synchronously from an ADS device and writes it to the given stream. | |
|
TryRead(UInt32, UInt32, .Byte., Int32, Int32, Int32, Int32.) |
Reads data synchronously from an ADS device and writes it to the given stream. |
|
TryRead(UInt32, UInt32, AdsStream, Int32, Int32, Int32, Int32.) |
Reads data synchronously from an ADS device and writes it to the given stream. |
|
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. | |
|
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. | |
|
TryReadWrite(Int32, AdsStream, Int32, Int32, AdsStream, Int32, Int32, Int32.) |
Writes data synchronously to an ADS device and then Reads data from this device. |
|
TryReadWrite(UInt32, UInt32, .Byte., Int32, Int32, .Byte., Int32, Int32, Int32.) |
Writes data synchronously to an ADS device and then Reads data from this device. |
|
TryReadWrite(UInt32, UInt32, AdsStream, Int32, Int32, AdsStream, Int32, Int32, Int32.) |
Writes data synchronously to an ADS device and then Reads data from this device. |
|
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. |
|
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. |
|
Writes data synchronously to an ADS device. | |
|
Writes data synchronously to an ADS device. | |
|
Writes data synchronously to an ADS device. | |
|
Writes data synchronously to an ADS device. | |
|
Writes data synchronously to an ADS device. | |
|
Changes the ADS status and the device status of an ADS server. | |
|
Changes the ADS status and the device status of an ADS server. | |
|
Changes the ADS status and the device status of an ADS server. | |
|
Changes the ADS status and the device status of an ADS server. | |
|
Writes data synchronously to an ADS device. | |
|
Trigger Client Method/Command. | |
|
Trigger Client Method/Command. | |
|
Writes data synchronously to an ADS device. | |
|
Writes data synchronously to an ADS device. | |
|
Writes data synchronously to an ADS device. | |
|
Writes data synchronously to an ADS device. | |
|
Writes data synchronously to an ADS device. | |
|
Writes data synchronously to an ADS device. | |
|
Writes data synchronously to an ADS device. | |
|
Writes an object synchronously to an ADS device. | |
|
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. | |
|
Writes an object synchronously to an ADS device. | |
|
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. | |
|
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. | |
|
Changes the ADS status and the device status of an ADS server. | |
|
Changes the ADS status and the device status of an ADS server. | |
|
Changes the ADS status and the device status of an ADS server. | |
|
Changes the ADS status and the device status of an ADS server. | |
|
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. | |
|
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 |
---|---|---|
|
Occurs when the ADS device sends a notification to the client. | |
|
Occurs when a exception has occurred during notification management. | |
|
Occurs when the ADS devices sends a notification to the client. | |
|
Occurs when ADS State has been changed. | |
|
Occurs when the symbol version has been changed. | |
|
Occurs when the Route sends an Notification. | |
|
Occurs when connection status of the AdsConnection has been changed. |
Extension Methods
|
Name |
Description |
---|---|---|
|
Overloaded. Gets an observable sequence of AdsStates via Polling. (Defined by AdsClientExtensions.) | |
|
Overloaded. Gets an observable sequence of AdsStates via Polling. (Defined by AdsClientExtensions.) | |
|
Overloaded. Polls the symbol values on timepoints where the polling observable streams data / triggers (Defined by AnyTypeExtensions.) | |
|
Overloaded. Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.) | |
|
Overloaded. Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.) | |
|
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.) |
|
Overloaded. Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.) | |
|
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.) |
|
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.) |
|
Overloaded. Polls the symbol values on timepoints where the polling observable streams data / triggers (Defined by AnyTypeExtensions.) | |
|
Overloaded. Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.) | |
|
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.) |
|
Overloaded. Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.) | |
|
Overloaded. Polls the symbol values on time points where the polling observable streams data / triggers (Defined by AnyTypeExtensions.) | |
|
Overloaded. Polls the symbol as value sequence of object values with a specified period time. (Defined by AnyTypeExtensions.) | |
|
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.) |
|
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.) |
|
Overloaded. Gets an observable sequence of Notifications. (Defined by AdsClientExtensions.) | |
|
Overloaded. Gets an observable sequence of Notification objects. (Defined by AdsClientExtensions.) | |
|
Overloaded. Gets an observable sequence of Notifications. (Defined by AdsClientExtensions.) | |
|
Overloaded. Gets an observable sequence of Notification objects. (Defined by AdsClientExtensions.) | |
|
Observable sequence of Values driven by ADS Notifications on the specified symbol. (Defined by ValueSymbolExtensions.) | |
|
Overloaded. Writes the sequence of values to the symbol specified by the instance path. (Defined by AnyTypeExtensions.) | |
|
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.