TcAdsClient Methods

The TcAdsClient type exposes the following members.

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(String, AdsStream, AdsTransMode, TimeSpan, TimeSpan, 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(UInt32, UInt32, AdsStream, AdsTransMode, TimeSpan, TimeSpan, 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)

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

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

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

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.

AddDeviceNotification(UInt32, UInt32, AdsStream, Int32, Int32, AdsTransMode, TimeSpan, TimeSpan, 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, TimeSpan, TimeSpan, 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(String, AdsTransMode, TimeSpan, TimeSpan, 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, TimeSpan, TimeSpan, 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.

AddDeviceNotificationEx(UInt32, UInt32, AdsTransMode, TimeSpan, TimeSpan, 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.

Close

Closes this IConnection

Connect(Int32)

Establishes a connection to a ADS device using the local netID.

Connect(AmsAddress)

Establishes a connection to a ADS device.

Connect(.Byte., Int32)

Establishes a connection to a ADS device.

Connect(String, Int32)

Establishes a connection to a ADS device.

Connect(AmsNetId, Int32)

Establishes a connection to a ADS device.

Connect(AmsNetId, AmsPort)

Establishes a connection to a ADS device.

CreateSymbolInfoLoader

Obsolete.

Creates a new instance of the TcAdsSymbolInfoLoader class (Symbol Browser V1, obsolete).

CreateVariableHandle

Generates a unique handle for an ADS variable.

DeleteDeviceNotification

Deletes an existing notification.

DeleteVariableHandle

Releases the handle of a ADS variable again.

Disconnect

Disconnects the TcAdsClient

Dispose.

Releases the resources used by TcAdsClient.

Dispose(Boolean)

Disposes the TcAdsClient.

Equals

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

Finalize

Finalizes an instance of the TcAdsClient class. (Overrides Object.Finalize..)

GetHashCode

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

GetType

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

InvokeRpcMethod(String, Int32, .Object.)

Invokes the specified RPC Method

InvokeRpcMethod(String, String, .Object.)

Invokes the RPC method.

InvokeRpcMethod(ITcAdsSymbol, Int32, .Object.)

Invokes the specified RPC Method

InvokeRpcMethod(ITcAdsSymbol, String, .Object.)

Invokes the RPC method.

MemberwiseClone

Creates a shallow copy of the current Object. (Inherited from Object.)

OnBeforeDisconnect

Called when before the TcAdsClient is disconnected.

OnConnectionStateChanged

Called when the ConnectionState of the TcAdsClient has changed.

Read(Int32, AdsStream)

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

Read(UInt32, UInt32, AdsStream)

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

Read(Int32, AdsStream, Int32, Int32)

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

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

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

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

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

ReadAny(Int32, Type)

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

ReadAny(Int32, Type, .Int32.)

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

ReadAny(UInt32, UInt32, Type)

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

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

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

ReadAnyString(Int32, Int32, Encoding)

Reads the string.

ReadAnyString(UInt32, UInt32, Int32, Encoding)

Reads the string

ReadDeviceInfo

Reads the identification and version number of an ADS server.

ReadState

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

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.

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.

ReadSymbolInfo

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

ReadWrite(UInt32, UInt32, AdsStream, AdsStream)

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.

ToString

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

TryAddDeviceNotification

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

TryAddDeviceNotificationEx

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

TryDeleteDeviceNotification

Deletes an existing notification.

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

Invokes the specified RPC Method

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

Tries to invoke the RPC method.

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

Invokes the specified RPC Method

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

Tries to invoke a RPC method.

TryRead(UInt32, UInt32, AdsStream, Int32.)

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

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

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

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

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

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

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

TryReadState

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, .Byte., Int32, Int32, .Byte., Int32, Int32, Int32.)

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

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.

TryWrite(Int32, AdsStream, Int32, Int32)

Writes data synchronously to an ADS device.

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

Writes data synchronously to an ADS device.

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

Writes data synchronously to an ADS device.

TryWriteControl(StateInfo)

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

TryWriteControl(StateInfo, AdsStream, Int32, Int32)

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

Write(Int32, Int32)

Trigger Client Method/Command.

Write(Int32, AdsStream)

Writes data synchronously to an ADS device.

Write(UInt32, UInt32)

Trigger Client Method/Command.

Write(Int32, Int32, AdsStream)

Writes data synchronously to an ADS device.

Write(UInt32, UInt32, AdsStream)

Writes data synchronously to an ADS device.

Write(Int32, AdsStream, Int32, Int32)

Writes data synchronously to an ADS device.

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

Writes data synchronously to an ADS device.

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

Writes data synchronously to an ADS device.

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

Writes data synchronously to an ADS device.

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

Writes data synchronously to an ADS device.

WriteAny(Int32, Object)

Writes an object synchronously to an ADS device.

WriteAny(Int32, Object, .Int32.)

Writes an object synchronously to an ADS device.

WriteAny(UInt32, UInt32, Object)

Writes an object synchronously to an ADS device.

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

Writes an object synchronously to an ADS device.

WriteAnyString(Int32, String, Int32, Encoding)

Writes the string (Potentially unsafe!)

WriteAnyString(UInt32, UInt32, String, Int32, Encoding)

Writes the string (Potentially unsafe!)

WriteControl(StateInfo)

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

WriteControl(StateInfo, AdsStream, Int32, Int32)

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

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.

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.

Extension Methods

 

Name

Description

PollAdsState(IObservable.Unit.)

Overloaded.

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

PollAdsState(TimeSpan)

Overloaded.

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

PollValues(String, Type, IObservable.Unit.)

Overloaded.

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

PollValues(String, Type, TimeSpan)

Overloaded.

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

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

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.)

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.)

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.)

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

Overloaded.

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

PollValues.T.(String, TimeSpan)

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.)

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.)

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

Overloaded.

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

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

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.)

WhenAdsStateChanges

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

WhenNotification(ISymbol)

Overloaded.

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

WhenNotification(ISymbolCollection)

Overloaded.

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

WhenNotification(ISymbol, NotificationSettings)

Overloaded.

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

WhenNotification(ISymbolCollection, NotificationSettings)

Overloaded.

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

WhenValueChanged

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

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

Overloaded.

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

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

Overloaded.

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

Reference

TcAdsClient Class

TwinCAT.Ads Namespace