TwinCAT.Ads

TwinCAT.Ads Namespace

Namespace hierarchy

Classes

Class | Description
AdsBinaryReader | Derives from BinaryReader and reads primitive as well as PLC data types as binary values.
AdsBinaryWriter | Derives from BinaryWriter and writes primitive and PLC data types in binary to a stream.
AdsDatatypeNotSupportedException | The exception that is thrown when a ADS datatype is not supported.
AdsErrorException | The exception that is thrown when a Ads error occurs.
AdsException | Base class for all exceptions thrown by this class.
AdsInvalidNotificationException | This AdsInvalidNotificationException is created if the length of the notification data is 0. This indicates that the notification handle is not valid any more. This exception is passed to the AdsNotificationErrorEvent.
AdsNotificationErrorEventArgs | Provides data for AdsNotificationErrorEvent of the class TcAdsClient.
AdsNotificationEventArgs | Provides data for AdsNotificationEvent of the class TcAdsClient.
AdsNotificationExEventArgs | Provides data for AdsNotificationExEvent of the class TcAdsClient.
AdsStateChangedEventArgs | Provides data for AdsStateChangedEvent of the class TcAdsClient.
AdsStream | The class AdsStream is a stream class used for Ads communication.
AdsSymbolVersionChangedEventArgs | Provides data for AdsSymbolVersionChangedEvent of the class TcAdsClient.
AmsAddress | Ams/Ads Address
AmsNetId | AMS/ADS Net ID
AmsRouterNotificationEventArgs | Provides data for AmsRouterNotificationEvent of the class TcAdsClient.
TcAdsClient | The class TcAdsClient is a wrapper for the TcAdsdll.dll and enables synchronous access to an Ads device.
TcAdsSymbolInfo | The class TcAdsSymbolInfo represents a symbol loaded by an instance of the TcAdsSymbolInfoLoader class.
TcAdsSymbolInfoCollection | Represents a collection of TcAdsSymbolInfo objects.
TcAdsSymbolInfoLoader | The class TcAdsSymbolInfoLoader is responsible for downloading the list of declared variables from an ADS Server.

Interfaces

Interface | Description
ITcAdsSymbol | Defines an Interface for reading the ADS symbol information.

Structures

Structure | Description
AdsVersion | The structure contains the version number, revision number and build number.
DeviceInfo | The structure contains the name and the version information of the device.
StateInfo | The structure contains the Ads state and device state.

Delegates

Delegate | Description
AdsNotificationErrorEventHandler | Event handler for the AdsNotificationError event in the class TcAdsClient.
AdsNotificationEventHandler | Event handler for the AdsNotification event in the class TcAdsClient.
AdsNotificationExEventHandler | Event handler for the AdsNotification event in the class TcAdsClient.
AdsStateChangedEventHandler | Event handler for the AdsStateChanged event in the class TcAdsClient.
AmsRouterNotificationEventHandler | Event handler for the AmsRouterNotification event in the class TcAdsClient.

Enumerations

Enumeration | Description
AdsDatatypeId | ADS data types.
AdsErrorCode | Describes the Ads error that occured.
AdsReservedIndexGroups | Describes predefined Index-Groups.
AdsReservedIndexOffsets | Describes predefined Index-Offsets.
AdsState | Describes the AdsState.
AdsTransMode | Determines at what time the AdsSyncNotification-Event is fired.
AmsPort | AmsPorts
AmsRouterState | State of the Ams Router.


Notes on the documentation

This description is only intended for the use of trained specialists in control and automation engineering who are familiar with the applicable national standards.
It is essential that the following notes and explanations are followed when installing and commissioning these components.

The responsible staff must ensure that the application or use of the products described satisfy all the requirements for safety, including all the relevant laws, regulations, guidelines and standards.

Disclaimer

The documentation has been prepared with care. The products described are, however, constantly under development.
For that reason the documentation is not in every case checked for consistency with performance data, standards or other characteristics.
In the event that it contains technical or editorial errors, we retain the right to make alterations at any time and without warning.
No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation.

Trademarks

Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE® and XFC® are registered trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owners.

Patent Pending

The TwinCAT Technology is covered, including but not limited to the following patent applications and patents:
EP0851348, US6167425 with corresponding applications or registrations in various other countries.

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a patent, utility model or design.


AdsBinaryReader Class

Derives from BinaryReader and reads primitive as well as PLC data types as binary values.

For a list of all members of this type, see AdsBinaryReader Members.

System.Object
System.IO.BinaryReader
TwinCAT.Ads.AdsBinaryReader

public class AdsBinaryReader : BinaryReader,

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsBinaryReader Members | TwinCAT.Ads Namespace


AdsBinaryReader Members

Public Instance Constructors

AdsBinaryReader Constructor Initializes a new instance of the AdsBinaryReader class based on the supplied stream.

Public Instance Properties

BaseStream (inherited from System.IO.BinaryReader) Select the method name to go to the Microsoft documentation.

Public Instance Methods

Close (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
PeekChar (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
Read (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
Read (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
Read (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadBoolean (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadByte (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadBytes (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadChar (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadChars (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadDecimal (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadDouble (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadInt16 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadInt32 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadInt64 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadPlcDATE | Reads a PLC Date type from the current stream.
ReadPlcString | Reads a PLC string from the current stream.
ReadPlcTIME | Reads a PLC Time type from the current stream.
ReadSByte (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadSingle (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadString (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadUInt16 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadUInt32 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadUInt64 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

AdsBinaryReader Class | TwinCAT.Ads Namespace


AdsBinaryReader Constructor

Initializes a new instance of the AdsBinaryReader class based on the supplied stream.

public AdsBinaryReader(
AdsStreamstream
);

Parameters

stream
A stream.

See Also

AdsBinaryReader Class | TwinCAT.Ads Namespace


AdsBinaryReader Methods

The methods of the AdsBinaryReader class are listed below. For a complete list of AdsBinaryReader class members, see the AdsBinaryReader Members topic.

Public Instance Methods

Close (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
PeekChar (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
Read (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
Read (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
Read (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadBoolean (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadByte (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadBytes (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadChar (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadChars (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadDecimal (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadDouble (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadInt16 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadInt32 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadInt64 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadPlcDATE | Reads a PLC Date type from the current stream.
ReadPlcString | Reads a PLC string from the current stream.
ReadPlcTIME | Reads a PLC Time type from the current stream.
ReadSByte (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadSingle (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadString (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadUInt16 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadUInt32 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ReadUInt64 (inherited from BinaryReader) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

AdsBinaryReader Class | TwinCAT.Ads Namespace


AdsBinaryReader.ReadPlcDATE Method

Reads a PLC Date type from the current stream.

public DateTime ReadPlcDATE();

Return Value

The date being read.

See Also

AdsBinaryReader Class | TwinCAT.Ads Namespace


AdsBinaryReader.ReadPlcString Method

Reads a PLC string from the current stream.

public string ReadPlcString(
intlength
);

Parameters

length
The length of the string in the PLC (without the terminating zero character).
Examples:
sTest : STRING(30); (* length = 30 *)
sDefault : STRING; (* length = 80 *)

Return Value

The string being read.

See Also

AdsBinaryReader Class | TwinCAT.Ads Namespace


AdsBinaryReader.ReadPlcTIME Method

Reads a PLC Time type from the current stream.

public TimeSpan ReadPlcTIME();

Return Value

The time being read.

See Also

AdsBinaryReader Class | TwinCAT.Ads Namespace


AdsBinaryWriter Class

Derives from BinaryWriter and writes primitive and PLC data types in binary to a stream.

For a list of all members of this type, see AdsBinaryWriter Members.

System.Object
System.IO.BinaryWriter
TwinCAT.Ads.AdsBinaryWriter

public class AdsBinaryWriter : BinaryWriter,

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsBinaryWriter Members | TwinCAT.Ads Namespace


AdsBinaryWriter Members

Public Instance Constructors

AdsBinaryWriter Constructor Initializes a new instance of the AdsBinaryWriter class based on the supplied stream.

Public Instance Properties

BaseStream (inherited from System.IO.BinaryWriter) Select the method name to go to the Microsoft documentation.

Public Instance Methods

Close (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
Flush (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
Seek (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
WritePlcString | Writes a string as a PLC string to the current stream.
WritePlcType | Overloaded. Writes a date as PLC date type to the current stream.

See Also

AdsBinaryWriter Class | TwinCAT.Ads Namespace


AdsBinaryWriter Constructor

Initializes a new instance of the AdsBinaryWriter class based on the supplied stream.

public AdsBinaryWriter(
AdsStreamstream
);

Parameters

stream

See Also

AdsBinaryWriter Class | TwinCAT.Ads Namespace


AdsBinaryWriter Methods

The methods of the AdsBinaryWriter class are listed below. For a complete list of AdsBinaryWriter class members, see the AdsBinaryWriter Members topic.

Public Instance Methods

Close (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
Flush (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
Seek (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
Write (inherited from BinaryWriter) | Select the method name to go to the Microsoft documentation.
WritePlcString | Writes a string as a PLC string to the current stream.
WritePlcType | Overloaded. Writes a date as PLC date type to the current stream.

See Also

AdsBinaryWriter Class | TwinCAT.Ads Namespace


AdsBinaryWriter.WritePlcString Method

Writes a string as a PLC string to the current stream.

public void WritePlcString(
stringvalue,
intlength
);

Parameters

value
The string to write to the stream.
length
The length of the string in the PLC (without the terminating zero character).
Examples:
sTest : STRING(30); (* length = 30 *)
sDefault : STRING; (* length = 80 *)

See Also

AdsBinaryWriter Class | TwinCAT.Ads Namespace


WritePlcType Method

TwinCAT.Ads

AdsBinaryWriter.WritePlcType

Writes a date as PLC date type to the current stream.

Overload List

Writes a date as PLC date type to the current stream.

public void WritePlcType(DateTime);

Writes a time span as PLC time type to the current stream.

public void WritePlcType(TimeSpan);

See Also

AdsBinaryWriter Class | TwinCAT.Ads Namespace


AdsBinaryWriter.WritePlcType Method (DateTime)

Writes a date as PLC date type to the current stream.

public void WritePlcType(
DateTimevalue
);

Parameters

value
The date to write to the stream.

See Also

AdsBinaryWriter Class | TwinCAT.Ads Namespace | AdsBinaryWriter.WritePlcType Overload List


AdsBinaryWriter.WritePlcType Method (TimeSpan)

Writes a time span as PLC time type to the current stream.

public void WritePlcType(
TimeSpanvalue
);

Parameters

value
The time span to write to the stream.

See Also

AdsBinaryWriter Class | TwinCAT.Ads Namespace | AdsBinaryWriter.WritePlcType Overload List


AdsDatatypeId Enumeration

ADS data types.

public enum AdsDatatypeId

Members

Member Name | Description
ADST_VOID |
ADST_INT8 |
ADST_UINT8 |
ADST_INT16 |
ADST_UINT16 |
ADST_INT32 |
ADST_UINT32 |
ADST_INT64 |
ADST_UINT64 |
ADST_REAL32 |
ADST_REAL64 |
ADST_BIGTYPE |
ADST_STRING |
ADST_WSTRING |
ADST_REAL80 |
ADST_BIT |
ADST_MAXTYPES |

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AdsDatatypeNotSupportedException Class

The exception that is thrown when a ADS datatype is not supported.

For a list of all members of this type, see AdsDatatypeNotSupportedException Members.

System.Object
System.Exception
System.ApplicationException
TwinCAT.Ads.AdsException
TwinCAT.Ads.AdsDatatypeNotSupportedException

public class AdsDatatypeNotSupportedException : AdsException,

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsDatatypeNotSupportedException Members | TwinCAT.Ads Namespace


AdsDatatypeNotSupportedException Members

Public Instance Constructors

AdsDatatypeNotSupportedException Overloaded. Initialize a new instance of the AdsDatatypeNotSupportedException class.

Public Instance Properties

Data (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
HelpLink (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
InnerException (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Message (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Source (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
StackTrace (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
TargetSite (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetBaseException (inherited from Exception) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetObjectData (inherited from Exception) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Exception) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Exception) | Select the method name to go to the Microsoft documentation.

See Also

AdsDatatypeNotSupportedException Class | TwinCAT.Ads Namespace


AdsDatatypeNotSupportedException Constructor

TwinCAT.Ads

AdsDatatypeNotSupportedException

Initiailizes a new Instance of the AdsDatatypeNotSupportedException class.

Overload List

Initiailizes a new Instance of the AdsDatatypeNotSupportedException class.

public AdsDatatypeNotSupportedException();

Initiailizes a new Instance of the AdsDatatypeNotSupportedException class.

public AdsDatatypeNotSupportedException(string);

Initiailizes a new Instance of the AdsDatatypeNotSupportedException class.

public AdsDatatypeNotSupportedException(string,Exception);

See Also

AdsDatatypeNotSupportedException Class | TwinCAT.Ads Namespace


AdsDatatypeNotSupportedException Constructor ()

Initiailizes a new Instance of the AdsDatatypeNotSupportedException class.

public AdsDatatypeNotSupportedException();

See Also

AdsDatatypeNotSupportedException Class | TwinCAT.Ads Namespace | AdsDatatypeNotSupportedException Constructor Overload List


AdsDatatypeNotSupportedException Constructor (String)

Initiailizes a new Instance of the AdsDatatypeNotSupportedException class.

public AdsDatatypeNotSupportedException(
stringmessage
);

See Also

AdsDatatypeNotSupportedException Class | TwinCAT.Ads Namespace | AdsDatatypeNotSupportedException Constructor Overload List


AdsDatatypeNotSupportedException Constructor (String, Exception)

Initiailizes a new Instance of the AdsDatatypeNotSupportedException class.

public AdsDatatypeNotSupportedException(
stringmessage,
ExceptioninnerException
);

See Also

AdsDatatypeNotSupportedException Class | TwinCAT.Ads Namespace | AdsDatatypeNotSupportedException Constructor Overload List


AdsErrorCode Enumeration

Describes the Ads error that occured.

public enum AdsErrorCode

Members

Member Name | Description
NoError | No Error. Error code: 0(0x000).
InternalError | Internal Error. Error code: 1(0x001).
NoRTime | No Rtime. Error code: 2(0x002).
LockedMemoryError | Allocation locked memory error. Error code: 3(0x003).
MailBoxError | Insert mailbox error. Error code: 4(0x004).
WrongHMsg | Wrong receive HMSG. Error code: 5(0x005).
TargetPortNotFound | Target port not found. Error code: 6(0x006).
TargetMachineNotFound | Target machine not found. Error code: 7(0x007).
UnknownCommandID | Unknown command ID. Error code: 8(0x008).
BadTaskID | Bad task ID. Error code: 9(0x009).
NoIO | No IO. Error code: 10(0x00A).
UnknownAmsCommand | Unknown AMS command. Error code: 11(0x00B).
Win32Error | Win 32 error. Error code: 12(0x00C).
PortNotConnected | Port is not connected. Error code: 13(0x00D).
InvalidAmsLength | Invalid AMS length. Error code: 14(0x00E).
InvalidAmsNetID | Invalid AMS Net ID. Error code: 15(0x00F).
LowInstallLevel | Low Installation level. Error code: 16(0x010).
NoDebug | No debug available. Error code: 17(0x011).
PortDisabled | Port disabled. Error code: 18(0x012).
PortConnected | Port is already connected. Error code: 19(0x013).
AmsSyncWin32Error | AMS Sync Win32 error. Error code: 20(0x014).
SyncTimeOut | AMS Sync timeout. Error code: 21(0x015).
AmsSyncAmsError | AMS Sync AMS error Error code: 22(0x016).
AmsSyncNoIndexMap | AMS Sync no index map. Error code: 23(0x017).
InvalidAmsPort | Invalid AMS port. Error code: 24(0x018).
NoMemory | No memory. Error code: 25(0x019).
TCPSendError | TCP send error. Error code: 26(0x01A).
HostUnreachable | Host unreachable. Error code: 27(0x1B).
NoLockedMemory | Router: no locked memory. Error code: 1280(0x500).
MailboxFull | Router: mailbox full. Error code: 1282(0x501).
DeviceError | error class <device error"> Error code: 1792(0x700).
DeviceServiceNotSupported | Service is not supported by server. Error code: 1793(0x701).
DeviceInvalidGroup | Invalid index group. Error code: 1794(0x702).
DeviceInvalidOffset | Invalid index offset. Error code: 1795(0x703).
DeviceInvalidAccess | Reading/writing not permitted. Error code: 1796(0x704).
DeviceInvalidSize | Parameter size not correct. Error code: 1797(0x705).
DeviceInvalidData | Invalid parameter value(s). Error code: 1798(0x706).
DeviceNotReady | Device is not in a ready state. Error code: 1799(0x707).
DeviceBusy | Device is busy. Error code: 1800(0x708).
DeviceInvalidContext | Invalid context (must be in Windows). Error code: 1801(0x709).
DeviceNoMemory | Out of memory. Error code: 1802(0x70a).
DeviceInavlidParam | Invalid parameter value(s). Error code: 1803(0x70b).
DeviceNotFound | Not found(files, ...). Error code: 1804(0x70c).
DeviceSyntaxError | Syntax error in command or file. Error code: 1805(0x70d).
DeviceIncompatible | Objects do not match. Error code: 1806(0x70e).
DeviceExists | Object already exists. Error code: 1807(0x70f).
DeviceSymbolNotFound | Symbol not found. Error code: 1808(0x710).
DeviceSymbolVersionInvalid | Symbol version is invalid. Error code: 1809(0x711).
DeviceInvalidState | Server is not i a valid state. Error code: 1810(0x712).
DeviceTransModeNotSupported | ADS transmode is not supported. Error code: 1811(0x713).
DeviceNotifyHandleInvalid | Notification handle is invalid. Error code: 1812(0x714).
DeviceClientUnknown | Notification vlient not registered. Error code: 1813(0x715).
DeviceNoMoreHandles | No more notification handles. Error code: 1814(0x716).
DeviceInvalidWatchsize | Size for watch to big. Error code: 1815(0x717).
DeviceNotInitialized | Device is not initialized. Errocr code: 1818(0x718).
DeviceTimeOut | Devicee has a timeout. Error code: 1817(0x719).
DeviceNoInterface | Query interface has failed. Error code: 1818(0x71A).
DeviceInvalidInterface | Wrong interface required. Error code: 1819(0x71B).
DeviceInvalidCLSID | Class ID is invalid. Error code: 1820(0x71C).
DeviceInvalidObjectID | Object ID is invalid. Error code: 1821(0x71D).
ClientError | Error class <client error> Error code: 1856(0x740).
ClientInvalidParameter | Parameter at service is invalid. Error code: 1857(0x741).
ClientListEmpty | Polling list is empty. Error code: 1858(0x742).
ClientVaraiableInUse | Variable connection is already in use. Error code: 1859(0x743).
ClientDuplicateInvokeID | Invoke ID already in use. Error code: 1860(0x744).
ClientSyncTimeOut | Timeout has elapsed. Error code: 1861(x745).
ClientW32OR | Error in win32 subsystem. Error code: 1862(0x746).
ClientTimeoutInvalid | Timeout value is invalid. Error code: 1863(0x747).
ClientPortNotOpen | Ads port is not opened. Error code: 1864(0x748).
ClientNoAmsAddr | No AMS addr. Error code: 1865(0x749).
ClientSyncInternal | An internal in ADS sync has occured. Error code: 1872(0x750).
ClientAddHash | Hash table overflow. Error code: 1873(0x751).
ClientRemoveHash | There are no more symbols in the hash table. Error code: 1874(0x752).
ClientNoMoreSymbols | There are no more symbols in cache. Error code: 1875(0x753).
ClientSyncResInvalid | An invalid response has been received. Error code: 1876(0x754).
ClientSyncPortLocked | Sync port is locked. Error code: 1877(0x755).
ClientQueueFull | Client queue is full

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AdsErrorException Class

The exception that is thrown when a Ads error occurs.

For a list of all members of this type, see AdsErrorException Members.

System.Object
System.Exception
System.ApplicationException
TwinCAT.Ads.AdsException
TwinCAT.Ads.AdsErrorException

public class AdsErrorException : AdsException,

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsErrorException Members | TwinCAT.Ads Namespace


AdsErrorException Members

Public Instance Constructors

AdsErrorException Overloaded. Initialize a new instance of the AdsErrorException class.

Public Instance Properties

Data (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
ErrorCode | Gets the error code of the Exception.
HelpLink (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
InnerException (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Message (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Source (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
StackTrace (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
TargetSite (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetBaseException (inherited from Exception) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetObjectData (inherited from Exception) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Exception) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Exception) | Select the method name to go to the Microsoft documentation.

See Also

AdsErrorException Class | TwinCAT.Ads Namespace


AdsErrorException Constructor

TwinCAT.Ads

AdsErrorException

Initializes a new Instance of the AdsErrorException class.

Overload List

Initializes a new Instance of the AdsErrorException class.

public AdsErrorException();

Initializes a new Instance of the AdsErrorException class.

public AdsErrorException(string,AdsErrorCode);

See Also

AdsErrorException Class | TwinCAT.Ads Namespace


AdsErrorException Constructor ()

Initializes a new Instance of the AdsErrorException class.

public AdsErrorException();

See Also

AdsErrorException Class | TwinCAT.Ads Namespace | AdsErrorException Constructor Overload List


AdsErrorException Constructor (String, AdsErrorCode)

Initializes a new Instance of the AdsErrorException class.

public AdsErrorException(
stringmessage,
AdsErrorCodeerrorCode
);

See Also

AdsErrorException Class | TwinCAT.Ads Namespace | AdsErrorException Constructor Overload List


AdsErrorException Properties

The properties of the AdsErrorException class are listed below. For a complete list of AdsErrorException class members, see the AdsErrorException Members topic.

Public Instance Properties

Data (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
ErrorCode | Gets the error code of the Exception.
HelpLink (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
InnerException (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Message (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Source (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
StackTrace (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
TargetSite (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.

See Also

AdsErrorException Class | TwinCAT.Ads Namespace


AdsErrorException.ErrorCode Property

Gets the error code of the Exception.

public AdsErrorCode ErrorCode {get;}

See Also

AdsErrorException Class | TwinCAT.Ads Namespace


AdsException Class

Base class for all exceptions thrown by this class.

For a list of all members of this type, see AdsException Members.

System.Object
System.Exception
System.ApplicationException
TwinCAT.Ads.AdsException
TwinCAT.Ads.AdsDatatypeNotSupportedException
TwinCAT.Ads.AdsErrorException
TwinCAT.Ads.AdsInvalidNotificationException

public class AdsException : ApplicationException,

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsException Members | TwinCAT.Ads Namespace


AdsException Members

Public Instance Constructors

AdsException Overloaded. Initialize a new instance of the AdsException class.

Public Instance Properties

Data (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
HelpLink (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
InnerException (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Message (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Source (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
StackTrace (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
TargetSite (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetBaseException (inherited from Exception) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetObjectData (inherited from Exception) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Exception) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Exception) | Select the method name to go to the Microsoft documentation.

See Also

AdsException Class | TwinCAT.Ads Namespace


AdsException Constructor

TwinCAT.Ads

AdsException

Initializes a new Instance of the AdsException class.

Overload List

Initializes a new Instance of the AdsException class.

public AdsException();

Initializes a new Instance of the AdsException class.

public AdsException(string);

Initializes a new Instance of the AdsException class.

public AdsException(string,Exception);

See Also

AdsException Class | TwinCAT.Ads Namespace


AdsException Constructor ()

Initializes a new Instance of the AdsException class.

public AdsException();

See Also

AdsException Class | TwinCAT.Ads Namespace | AdsException Constructor Overload List


AdsException Constructor (String)

Initializes a new Instance of the AdsException class.

public AdsException(
stringmessage
);

See Also

AdsException Class | TwinCAT.Ads Namespace | AdsException Constructor Overload List


AdsException Constructor (String, Exception)

Initializes a new Instance of the AdsException class.

public AdsException(
stringmessage,
ExceptioninnerException
);

See Also

AdsException Class | TwinCAT.Ads Namespace | AdsException Constructor Overload List


AdsInvalidNotificationException Class

This AdsInvalidNotificationException is created if the length of the notification data is 0. This indicates that the notification handle is not valid any more. This exception is passed to the AdsNotificationErrorEvent.

For a list of all members of this type, see AdsInvalidNotificationException Members.

System.Object
System.Exception
System.ApplicationException
TwinCAT.Ads.AdsException
TwinCAT.Ads.AdsInvalidNotificationException

public sealed class AdsInvalidNotificationException : AdsException,

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsInvalidNotificationException Members | TwinCAT.Ads Namespace


AdsInvalidNotificationException Members

Public Instance Properties

Data (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Handle | Handle of the notification.
HelpLink (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
InnerException (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Message (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Source (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
StackTrace (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
TargetSite (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
TimeStamp | Timestamp.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetBaseException (inherited from Exception) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetObjectData (inherited from Exception) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Exception) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Exception) | Select the method name to go to the Microsoft documentation.

See Also

AdsInvalidNotificationException Class | TwinCAT.Ads Namespace


AdsInvalidNotificationException Properties

The properties of the AdsInvalidNotificationException class are listed below. For a complete list of AdsInvalidNotificationException class members, see the AdsInvalidNotificationException Members topic.

Public Instance Properties

Data (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Handle | Handle of the notification.
HelpLink (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
InnerException (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Message (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
Source (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
StackTrace (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
TargetSite (inherited from System.Exception) | Select the method name to go to the Microsoft documentation.
TimeStamp | Timestamp.

See Also

AdsInvalidNotificationException Class | TwinCAT.Ads Namespace


AdsInvalidNotificationException.Handle Property

Handle of the notification.

public int Handle {get;}

See Also

AdsInvalidNotificationException Class | TwinCAT.Ads Namespace


AdsInvalidNotificationException.TimeStamp Property

Timestamp.

public long TimeStamp {get;}

See Also

AdsInvalidNotificationException Class | TwinCAT.Ads Namespace


AdsNotificationErrorEventArgs Class

Provides data for AdsNotificationErrorEvent of the class TcAdsClient.

For a list of all members of this type, see AdsNotificationErrorEventArgs Members.

System.Object
System.EventArgs
TwinCAT.Ads.AdsNotificationErrorEventArgs

public sealed class AdsNotificationErrorEventArgs : EventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsNotificationErrorEventArgs Members | TwinCAT.Ads Namespace


AdsNotificationErrorEventArgs Members

Public Instance Constructors

AdsNotificationErrorEventArgs Constructor Initializes a new instance of the AdsNotificationErrorEventArgs class.

Public Instance Properties

Exception Exception that was caught while handling notifications.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

AdsNotificationErrorEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationErrorEventArgs Constructor

Initializes a new instance of the AdsNotificationErrorEventArgs class.

public AdsNotificationErrorEventArgs(
Exceptione
);

Parameters

e
Exception that was caught while handling notifications.

See Also

AdsNotificationErrorEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationErrorEventArgs Properties

The properties of the AdsNotificationErrorEventArgs class are listed below. For a complete list of AdsNotificationErrorEventArgs class members, see the AdsNotificationErrorEventArgs Members topic.

Public Instance Properties

Exception Exception that was caught while handling notifications.

See Also

AdsNotificationErrorEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationErrorEventArgs.Exception Property

Exception that was caught while handling notifications.

public System.Exception Exception {get;}

See Also

AdsNotificationErrorEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationErrorEventHandler Delegate

Event handler for the AdsNotificationError event in the class TcAdsClient.

public delegate void AdsNotificationErrorEventHandler(
objectsender,
AdsNotificationErrorEventArgse
);

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AdsNotificationEventArgs Class

Provides data for AdsNotificationEvent of the class TcAdsClient.

For a list of all members of this type, see AdsNotificationEventArgs Members.

System.Object
System.EventArgs
TwinCAT.Ads.AdsNotificationEventArgs

public sealed class AdsNotificationEventArgs : EventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsNotificationEventArgs Members | TwinCAT.Ads Namespace


AdsNotificationEventArgs Members

Public Instance Constructors

AdsNotificationEventArgs Constructor Initializes a new instance of the AdsStream class AdsSyncNotificationEventArgs.

Public Instance Properties

DataStream | Streams that holds the notification data.
Length | Gets the Length of the data in the stream.
NotificationHandle | Gets the handle of the connection.
Offset | Gets the Offset of the data in the stream.
TimeStamp | Gets the timestamp.
UserData | Gets the user object. This object is passed by to AddDeviceNotification and can be used to store data.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

AdsNotificationEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationEventArgs Constructor

Initializes a new instance of the AdsStream class AdsSyncNotificationEventArgs.

public AdsNotificationEventArgs(
longtimeStamp,
objectuserData,
intnotificationHandle,
intlength,
intoffset,
AdsStreamdataStream
);

Parameters

timeStamp
Timespamp.
userData
An object, that is passed by AddDeviceNotification.
notificationHandle
Handle of the connection.
length
Length of the data in dataStream.
offset
The offset of the data in dataStream .
dataStream
Stream that is used to store the data.

See Also

AdsNotificationEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationEventArgs Properties

The properties of the AdsNotificationEventArgs class are listed below. For a complete list of AdsNotificationEventArgs class members, see the AdsNotificationEventArgs Members topic.

Public Instance Properties

DataStream | Streams that holds the notification data.
Length | Gets the Length of the data in the stream.
NotificationHandle | Gets the handle of the connection.
Offset | Gets the Offset of the data in the stream.
TimeStamp | Gets the timestamp.
UserData | Gets the user object. This object is passed by to AddDeviceNotification and can be used to store data.

See Also

AdsNotificationEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationEventArgs.DataStream Property

Streams that holds the notification data.

public AdsStream DataStream {get;}

See Also

AdsNotificationEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationEventArgs.Length Property

Gets the Length of the data in the stream.

public int Length {get;}

See Also

AdsNotificationEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationEventArgs.NotificationHandle Property

Gets the handle of the connection.

public int NotificationHandle {get;}

See Also

AdsNotificationEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationEventArgs.Offset Property

Gets the Offset of the data in the stream.

public int Offset {get;}

See Also

AdsNotificationEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationEventArgs.TimeStamp Property

Gets the timestamp.

public long TimeStamp {get;}

See Also

AdsNotificationEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationEventArgs.UserData Property

Gets the user object. This object is passed by to AddDeviceNotification and can be used to store data.

public object UserData {get;}

See Also

AdsNotificationEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationEventHandler Delegate

Event handler for the AdsNotification event in the class TcAdsClient.

public delegate void AdsNotificationEventHandler(
objectsender,
AdsNotificationEventArgse
);

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AdsNotificationExEventArgs Class

Provides data for AdsNotificationExEvent of the class TcAdsClient.

For a list of all members of this type, see AdsNotificationExEventArgs Members.

System.Object
System.EventArgs
TwinCAT.Ads.AdsNotificationExEventArgs

public sealed class AdsNotificationExEventArgs : EventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsNotificationExEventArgs Members | TwinCAT.Ads Namespace


AdsNotificationExEventArgs Members

Public Instance Constructors

AdsNotificationExEventArgs Constructor Initializes a new instance of the AdsStream class AdsSyncNotificationEventArgs.

Public Instance Properties

NotificationHandle | Gets the handle of the connection.
TimeStamp | Gets the timestamp.
UserData | Gets the user object. This object is passed by to AddDeviceNotification and can be used to store data.
Value | Value of the ads variable.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

AdsNotificationExEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationExEventArgs Constructor

Initializes a new instance of the AdsStream class AdsSyncNotificationEventArgs.

public AdsNotificationExEventArgs(
longtimeStamp,
objectuserData,
intnotificationHandle,
objectvalue
);

Parameters

timeStamp
Timestamp.
userData
An object, that is passed by AddDeviceNotificationEx.
notificationHandle
Handle of the connection.
value
Value of the ADS variable.

See Also

AdsNotificationExEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationExEventArgs Properties

The properties of the AdsNotificationExEventArgs class are listed below. For a complete list of AdsNotificationExEventArgs class members, see the AdsNotificationExEventArgs Members topic.

Public Instance Properties

NotificationHandle | Gets the handle of the connection.
TimeStamp | Gets the timestamp.
UserData | Gets the user object. This object is passed by to AddDeviceNotification and can be used to store data.
Value | Value of the ads variable.

See Also

AdsNotificationExEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationExEventArgs.NotificationHandle Property

Gets the handle of the connection.

public int NotificationHandle {get;}

See Also

AdsNotificationExEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationExEventArgs.TimeStamp Property

Gets the timestamp.

public long TimeStamp {get;}

See Also

AdsNotificationExEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationExEventArgs.UserData Property

Gets the user object. This object is passed by to AddDeviceNotification and can be used to store data.

public object UserData {get;}

See Also

AdsNotificationExEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationExEventArgs.Value Property

Value of the ads variable.

public object Value {get;}

See Also

AdsNotificationExEventArgs Class | TwinCAT.Ads Namespace


AdsNotificationExEventHandler Delegate

Event handler for the AdsNotification event in the class TcAdsClient.

public delegate void AdsNotificationExEventHandler(
objectsender,
AdsNotificationExEventArgse
);

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AdsReservedIndexGroups Enumeration

Describes predefined Index-Groups.

public enum AdsReservedIndexGroups

Members

Member Name | Description
PlcRWMB |
PlcRWMX |
PlcRWRB |
PlcRWDB |
SymbolTable |
SymbolName |
SymbolValue |
SymbolHandleByName |
SymbolValueByName |
SymbolValueByHandle |
SymbolReleaseHandle |
SymbolInfoByName |
SymbolVersion |
SymbolInfoByNameEx |
SymbolDownload |
SymbolUpload |
SymbolUploadInfo |
SymbolNote |
IOImageRWIB |
IOImageRWIX |
IOImageRWOB |
IOImageRWOX |
IOImageClearI |
IOImageClearO |
DeviceData |

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AdsReservedIndexOffsets Enumeration

Describes predefined Index-Offsets.

public enum AdsReservedIndexOffsets

Members

Member Name | Description
DeviceDataAdsState |
DeviceDataDeviceState |
DeviceDataConfigID |

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AdsState Enumeration

Describes the AdsState.

public enum AdsState

Members

Member Name | Description
Invalid | invalided state
Idle | idle state
Reset | reset state
Init | initialized
Start | started
Run | running
Stop | stopped
SaveConfig | saved configuration
LoadConfig | load configuration
PowerFailure | power failure
PowerGood | power good
Error | error state
Shutdown | shutting down
Suspend | suspended
Resume | resumed
Config | system is in config mode
Reconfig | system should restart in config mode
Maxstates |

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AdsStateChangedEventArgs Class

Provides data for AdsStateChangedEvent of the class TcAdsClient.

For a list of all members of this type, see AdsStateChangedEventArgs Members.

System.Object
System.EventArgs
TwinCAT.Ads.AdsStateChangedEventArgs

public sealed class AdsStateChangedEventArgs : EventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsStateChangedEventArgs Members | TwinCAT.Ads Namespace


AdsStateChangedEventArgs Members

Public Instance Constructors

AdsStateChangedEventArgs Overloaded. Initialize a new instance of the AdsStateChangedEventArgs class.

Public Instance Properties

State Current state of the ADS device.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

AdsStateChangedEventArgs Class | TwinCAT.Ads Namespace


AdsStateChangedEventArgs Constructor

TwinCAT.Ads

AdsStateChangedEventArgs

Initializes a new instance of the AdsStateChangedEventArgs class.

Overload List

Initializes a new instance of the AdsStateChangedEventArgs class.

public AdsStateChangedEventArgs(StateInfo);

Initializes a new instance of the AdsStateChangedEventArgs class.

public AdsStateChangedEventArgs(AdsStateChangedEventArgs);

See Also

AdsStateChangedEventArgs Class | TwinCAT.Ads Namespace


AdsStateChangedEventArgs Constructor (StateInfo)

Initializes a new instance of the AdsStateChangedEventArgs class.

public AdsStateChangedEventArgs(
StateInfostate
);

Parameters

state
Current state of the ADS device.

See Also

AdsStateChangedEventArgs Class | TwinCAT.Ads Namespace | AdsStateChangedEventArgs Constructor Overload List


AdsStateChangedEventArgs Constructor (AdsStateChangedEventArgs)

Initializes a new instance of the AdsStateChangedEventArgs class.

public AdsStateChangedEventArgs(
AdsStateChangedEventArgseventArgs
);

Parameters

eventArgs

See Also

AdsStateChangedEventArgs Class | TwinCAT.Ads Namespace | AdsStateChangedEventArgs Constructor Overload List


AdsStateChangedEventArgs Properties

The properties of the AdsStateChangedEventArgs class are listed below. For a complete list of AdsStateChangedEventArgs class members, see the AdsStateChangedEventArgs Members topic.

Public Instance Properties

State Current state of the ADS device.

See Also

AdsStateChangedEventArgs Class | TwinCAT.Ads Namespace


AdsStateChangedEventArgs.State Property

Current state of the ADS device.

public StateInfo State {get;}

See Also

AdsStateChangedEventArgs Class | TwinCAT.Ads Namespace


AdsStateChangedEventHandler Delegate

Event handler for the AdsStateChanged event in the class TcAdsClient.

public delegate void AdsStateChangedEventHandler(
objectsender,
AdsStateChangedEventArgse
);

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AdsStream Class

The class AdsStream is a stream class used for Ads communication.

For a list of all members of this type, see AdsStream Members.

System.Object
System.MarshalByRefObject
System.IO.Stream
System.IO.MemoryStream
TwinCAT.Ads.AdsStream

public class AdsStream : MemoryStream,

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsStream Members | TwinCAT.Ads Namespace


AdsStream Members

Public Instance Constructors

AdsStream Overloaded. Initialize a new instance of the AdsStream class.

Public Instance Properties

CanRead (inherited from System.IO.MemoryStream) | Select the method name to go to the Microsoft documentation.
CanSeek (inherited from System.IO.MemoryStream) | Select the method name to go to the Microsoft documentation.
CanTimeout (inherited from System.IO.Stream) | Select the method name to go to the Microsoft documentation.
CanWrite (inherited from System.IO.MemoryStream) | Select the method name to go to the Microsoft documentation.
Capacity (inherited from System.IO.MemoryStream) | Select the method name to go to the Microsoft documentation.
Length (inherited from System.IO.MemoryStream) | Select the method name to go to the Microsoft documentation.
Position (inherited from System.IO.MemoryStream) | Select the method name to go to the Microsoft documentation.
ReadTimeout (inherited from System.IO.Stream) | Select the method name to go to the Microsoft documentation.
WriteTimeout (inherited from System.IO.Stream) | Select the method name to go to the Microsoft documentation.

Public Instance Methods

BeginRead (inherited from Stream) | Select the method name to go to the Microsoft documentation.
BeginWrite (inherited from Stream) | Select the method name to go to the Microsoft documentation.
Close (inherited from Stream) | Select the method name to go to the Microsoft documentation.
CreateObjRef (inherited from MarshalByRefObject) | Select the method name to go to the Microsoft documentation.
Dispose (inherited from Stream) | Select the method name to go to the Microsoft documentation.
EndRead (inherited from Stream) | Select the method name to go to the Microsoft documentation.
EndWrite (inherited from Stream) | Select the method name to go to the Microsoft documentation.
Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
Flush (inherited from MemoryStream) | Select the method name to go to the Microsoft documentation.
GetBuffer (inherited from MemoryStream) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetLifetimeService (inherited from MarshalByRefObject) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
InitializeLifetimeService (inherited from MarshalByRefObject) | Select the method name to go to the Microsoft documentation.
Read (inherited from MemoryStream) | Select the method name to go to the Microsoft documentation.
ReadByte (inherited from MemoryStream) | Select the method name to go to the Microsoft documentation.
Seek (inherited from MemoryStream) | Select the method name to go to the Microsoft documentation.
SetLength (inherited from MemoryStream) | Select the method name to go to the Microsoft documentation.
ToArray (inherited from MemoryStream) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.
Write (inherited from MemoryStream) | Select the method name to go to the Microsoft documentation.
WriteByte (inherited from MemoryStream) | Select the method name to go to the Microsoft documentation.
WriteTo (inherited from MemoryStream) | Select the method name to go to the Microsoft documentation.

See Also

AdsStream Class | TwinCAT.Ads Namespace


AdsStream Constructor

TwinCAT.Ads

AdsStream

Initializes a new instance of the AdsStream class.

Overload List

Initializes a new instance of the AdsStream class.

public AdsStream(int);

Initializes a new instance of the AdsStream class, based on the specified region of a byte array.

public AdsStream(byte[],int,int);

Initializes a new instance of the AdsStream class, based on a byte array.

public AdsStream(byte[]);

See Also

AdsStream Class | TwinCAT.Ads Namespace


AdsStream Constructor (Int32)

Initializes a new instance of the AdsStream class.

public AdsStream(
intlength
);

Parameters

length
Length of the stream in bytes.

See Also

AdsStream Class | TwinCAT.Ads Namespace | AdsStream Constructor Overload List


AdsStream Constructor (Byte[], Int32, Int32)

Initializes a new instance of the AdsStream class, based on the specified region of a byte array.

public AdsStream(
byte[]buffer,
intoffset,
intlength
);

Parameters

buffer
The array of bytes from which to create this stream.
offset
The offset in buffer at which the stream begins.
length
The length of the stream in bytes.

See Also

AdsStream Class | TwinCAT.Ads Namespace | AdsStream Constructor Overload List


AdsStream Constructor (Byte[])

Initializes a new instance of the AdsStream class, based on a byte array.

public AdsStream(
byte[]buffer
);

Parameters

buffer
The array of bytes from which to create this stream.

See Also

AdsStream Class | TwinCAT.Ads Namespace | AdsStream Constructor Overload List


AdsSymbolVersionChangedEventArgs Class

Provides data for AdsSymbolVersionChangedEvent of the class TcAdsClient.

For a list of all members of this type, see AdsSymbolVersionChangedEventArgs Members.

System.Object
System.EventArgs
TwinCAT.Ads.AdsSymbolVersionChangedEventArgs

public sealed class AdsSymbolVersionChangedEventArgs : EventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsSymbolVersionChangedEventArgs Members | TwinCAT.Ads Namespace


AdsSymbolVersionChangedEventArgs Members

Public Instance Constructors

AdsSymbolVersionChangedEventArgs Overloaded. Initialize a new instance of the AdsSymbolVersionChangedEventArgs class.

Public Instance Properties

SymbolVersion Current symbol version device.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

AdsSymbolVersionChangedEventArgs Class | TwinCAT.Ads Namespace


AdsSymbolVersionChangedEventArgs Constructor

TwinCAT.Ads

AdsSymbolVersionChangedEventArgs

Initializes a new instance of the AdsSymbolVersionChangedEventArgs class.

Overload List

Initializes a new instance of the AdsSymbolVersionChangedEventArgs class.

public AdsSymbolVersionChangedEventArgs(byte);

Initializes a new instance of the AdsSymbolVersionChangedEventArgs class.

public AdsSymbolVersionChangedEventArgs(AdsSymbolVersionChangedEventArgs);

See Also

AdsSymbolVersionChangedEventArgs Class | TwinCAT.Ads Namespace


AdsSymbolVersionChangedEventArgs Constructor (Byte)

Initializes a new instance of the AdsSymbolVersionChangedEventArgs class.

public AdsSymbolVersionChangedEventArgs(
bytesymbolVersion
);

Parameters

symbolVersion
Current symbol version.

See Also

AdsSymbolVersionChangedEventArgs Class | TwinCAT.Ads Namespace | AdsSymbolVersionChangedEventArgs Constructor Overload List


AdsSymbolVersionChangedEventArgs Constructor (AdsSymbolVersionChangedEventArgs)

Initializes a new instance of the AdsSymbolVersionChangedEventArgs class.

public AdsSymbolVersionChangedEventArgs(
AdsSymbolVersionChangedEventArgseventArgs
);

Parameters

eventArgs

See Also

AdsSymbolVersionChangedEventArgs Class | TwinCAT.Ads Namespace | AdsSymbolVersionChangedEventArgs Constructor Overload List


AdsSymbolVersionChangedEventArgs Properties

The properties of the AdsSymbolVersionChangedEventArgs class are listed below. For a complete list of AdsSymbolVersionChangedEventArgs class members, see the AdsSymbolVersionChangedEventArgs Members topic.

Public Instance Properties

SymbolVersion Current symbol version device.

See Also

AdsSymbolVersionChangedEventArgs Class | TwinCAT.Ads Namespace


AdsSymbolVersionChangedEventArgs.SymbolVersion Property

Current symbol version device.

public short SymbolVersion {get;}

See Also

AdsSymbolVersionChangedEventArgs Class | TwinCAT.Ads Namespace


AdsTransMode Enumeration

Determines at what time the AdsSyncNotification-Event is fired.

public enum AdsTransMode

Members

Member Name | Description
Cyclic | The AdsSyncNotification-Event is fired cyclically.
OnChange | The AdsSyncNotification-Event is fired when the data changes.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AdsVersion Structure

The structure contains the version number, revision number and build number.

For a list of all members of this type, see AdsVersion Members.

System.Object
System.ValueType
TwinCAT.Ads.AdsVersion

public struct AdsVersion

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AdsVersion Members | TwinCAT.Ads Namespace


AdsVersion Members

Public Instance Properties

Build | Gets or sets the build number.
Revision | Gets or sets the revision number.
Version | Gets or sets the version number.

Public Instance Methods

Equals (inherited from ValueType) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from ValueType) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from ValueType) | Select the method name to go to the Microsoft documentation.

See Also

AdsVersion Class | TwinCAT.Ads Namespace


AdsVersion Properties

The properties of the AdsVersion class are listed below. For a complete list of AdsVersion class members, see the AdsVersion Members topic.

Public Instance Properties

Build | Gets or sets the build number.
Revision | Gets or sets the revision number.
Version | Gets or sets the version number.

See Also

AdsVersion Class | TwinCAT.Ads Namespace


AdsVersion.Build Property

Gets or sets the build number.

public int Build {get; set;}

See Also

AdsVersion Class | TwinCAT.Ads Namespace


AdsVersion.Revision Property

Gets or sets the revision number.

public byte Revision {get; set;}

See Also

AdsVersion Class | TwinCAT.Ads Namespace


AdsVersion.Version Property

Gets or sets the version number.

public byte Version {get; set;}

See Also

AdsVersion Class | TwinCAT.Ads Namespace


AmsAddress Class

Ams/Ads Address

For a list of all members of this type, see AmsAddress Members.

System.Object
TwinCAT.Ads.AmsAddress

public class AmsAddress

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AmsAddress Members | TwinCAT.Ads Namespace


AmsAddress Members

Public Static (Shared) Operators

Equality Operator | Operator==
Inequality Operator | Operator-=

Public Instance Constructors

AmsAddress Overloaded. Initialize a new instance of the AmsAddress class.

Public Instance Properties

NetId | Gets the NetId
Port | Gets the Port number

Public Instance Methods

Equals | Equals
GetHashCode | Gets the HashCode of the Address
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString | Converts the Address to String 'NetId:Port'

See Also

AmsAddress Class | TwinCAT.Ads Namespace


AmsAddress Constructor

TwinCAT.Ads

AmsAddress

Copy constructor

Overload List

Copy constructor

public AmsAddress(AmsAddress);

Constructor

public AmsAddress(AmsNetId,AmsPort);

Constructor

public AmsAddress(AmsNetId,int);

Constructor

public AmsAddress(string,AmsPort);

Constructor

public AmsAddress(string,int);

Constructor

public AmsAddress(byte[],AmsPort);

Constructor

public AmsAddress(byte[],int);

Constructor

public AmsAddress(AmsPort);

Constructor

public AmsAddress(int);

See Also

AmsAddress Class | TwinCAT.Ads Namespace


AmsAddress Constructor (AmsAddress)

Copy constructor

public AmsAddress(
AmsAddressaddress
);

Parameters

address

See Also

AmsAddress Class | TwinCAT.Ads Namespace | AmsAddress Constructor Overload List


AmsAddress Constructor (AmsNetId, AmsPort)

Constructor

public AmsAddress(
AmsNetIdnetId,
AmsPortport
);

Parameters

netId
port

See Also

AmsAddress Class | TwinCAT.Ads Namespace | AmsAddress Constructor Overload List


AmsAddress Constructor (AmsNetId, Int32)

Constructor

public AmsAddress(
AmsNetIdnetId,
intport
);

Parameters

netId
Net Id
port
Port

See Also

AmsAddress Class | TwinCAT.Ads Namespace | AmsAddress Constructor Overload List


AmsAddress Constructor (String, AmsPort)

Constructor

public AmsAddress(
stringnetId,
AmsPortport
);

Parameters

netId
port

See Also

AmsAddress Class | TwinCAT.Ads Namespace | AmsAddress Constructor Overload List


AmsAddress Constructor (String, Int32)

Constructor

public AmsAddress(
stringnetId,
intport
);

Parameters

netId
port

See Also

AmsAddress Class | TwinCAT.Ads Namespace | AmsAddress Constructor Overload List


AmsAddress Constructor (Byte[], AmsPort)

Constructor

public AmsAddress(
byte[]netId,
AmsPortport
);

Parameters

netId
port

See Also

AmsAddress Class | TwinCAT.Ads Namespace | AmsAddress Constructor Overload List


AmsAddress Constructor (Byte[], Int32)

Constructor

public AmsAddress(
byte[]netId,
intport
);

Parameters

netId
port

See Also

AmsAddress Class | TwinCAT.Ads Namespace | AmsAddress Constructor Overload List


AmsAddress Constructor (AmsPort)

Constructor

public AmsAddress(
AmsPortport
);

Parameters

port

See Also

AmsAddress Class | TwinCAT.Ads Namespace | AmsAddress Constructor Overload List


AmsAddress Constructor (Int32)

Constructor

public AmsAddress(
intport
);

Parameters

port

See Also

AmsAddress Class | TwinCAT.Ads Namespace | AmsAddress Constructor Overload List


AmsAddress Properties

The properties of the AmsAddress class are listed below. For a complete list of AmsAddress class members, see the AmsAddress Members topic.

Public Instance Properties

NetId | Gets the NetId
Port | Gets the Port number

See Also

AmsAddress Class | TwinCAT.Ads Namespace


AmsAddress.NetId Property

Gets the NetId

public AmsNetId NetId {get; set;}

See Also

AmsAddress Class | TwinCAT.Ads Namespace


AmsAddress.Port Property

Gets the Port number

public int Port {get; set;}

See Also

AmsAddress Class | TwinCAT.Ads Namespace


AmsAddress Methods

The methods of the AmsAddress class are listed below. For a complete list of AmsAddress class members, see the AmsAddress Members topic.

Public Instance Methods

Equals | Equals
GetHashCode | Gets the HashCode of the Address
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString | Converts the Address to String 'NetId:Port'

See Also

AmsAddress Class | TwinCAT.Ads Namespace


AmsAddress.Equals Method

Equals

public override bool Equals(
objectobj
);

Parameters

obj

Return Value

See Also

AmsAddress Class | TwinCAT.Ads Namespace


AmsAddress.GetHashCode Method

Gets the HashCode of the Address

public override int GetHashCode();

Return Value

See Also

AmsAddress Class | TwinCAT.Ads Namespace


AmsAddress.ToString Method

Converts the Address to String 'NetId:Port'

public override string ToString();

Return Value

See Also

AmsAddress Class | TwinCAT.Ads Namespace


AmsAddress Operators

The operators of the AmsAddress class are listed below. For a complete list of AmsAddress class members, see the AmsAddress Members topic.

Public Static (Shared) Operators

Equality Operator | Operator==
Inequality Operator | Operator-=

See Also

AmsAddress Class | AmsAddress Members | TwinCAT.Ads Namespace


AmsAddress Constructor

Operator==

public static bool operator ==(
AmsAddresso1,
AmsAddresso2
);

Parameters

o1
o2

Return Value

See Also

AmsAddress Class | TwinCAT.Ads Namespace


AmsAddress Constructor

Operator-=

public static bool operator !=(
AmsAddresso1,
AmsAddresso2
);

Parameters

o1
o2

Return Value

See Also

AmsAddress Class | TwinCAT.Ads Namespace


AmsNetId Class

AMS/ADS Net ID

For a list of all members of this type, see AmsNetId Members.

System.Object
TwinCAT.Ads.AmsNetId

public class AmsNetId

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AmsNetId Members | TwinCAT.Ads Namespace


AmsNetId Members

Public Static (Shared) Properties

Empty | Creates an empty NetId ("0.0.0.0.0.0")
Local | Gets the Local Net ID (System service must be running)
LocalHost | Creates the local NetId ("127.0.0.1.1.1")

Public Static (Shared) Methods

GetNetIdString | Gets the netId string from the byte array
NetIdsEqual | Compares the NetIds
Parse | Parses a net ID and creates a new AmsNetId object

Public Static (Shared) Operators

Equality Operator | Operator==
Inequality Operator | Operator-=

Public Instance Constructors

AmsNetId Overloaded. Initialize a new instance of the AmsNetId class.

Public Instance Properties

IsLocal Is the Address Local?

Public Instance Methods

Clone | Clones the NetId
Equals | Equals
GetHashCode | Gets the HashCode of the Address
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
NetIdsEqual | Compares the netIds
ToBytes | Converts the NetId object to byte array
ToString | Converts the netId to string

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId Constructor

TwinCAT.Ads

AmsNetId

Constructor

Overload List

Constructor

public AmsNetId(string);

Constructor

public AmsNetId(byte[]);

Copy Constructor

public AmsNetId(AmsNetId);

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId Constructor (String)

Constructor

public AmsNetId(
stringnetId
);

Parameters

netId

See Also

AmsNetId Class | TwinCAT.Ads Namespace | AmsNetId Constructor Overload List


AmsNetId Constructor (Byte[])

Constructor

public AmsNetId(
byte[]netId
);

Parameters

netId

See Also

AmsNetId Class | TwinCAT.Ads Namespace | AmsNetId Constructor Overload List


AmsNetId Constructor (AmsNetId)

Copy Constructor

public AmsNetId(
AmsNetIdnetId
);

Parameters

netId

See Also

AmsNetId Class | TwinCAT.Ads Namespace | AmsNetId Constructor Overload List


AmsNetId Properties

The properties of the AmsNetId class are listed below. For a complete list of AmsNetId class members, see the AmsNetId Members topic.

Public Static (Shared) Properties

Empty | Creates an empty NetId ("0.0.0.0.0.0")
Local | Gets the Local Net ID (System service must be running)
LocalHost | Creates the local NetId ("127.0.0.1.1.1")

Public Instance Properties

IsLocal Is the Address Local?

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId.Empty Property

Creates an empty NetId ("0.0.0.0.0.0")

public static AmsNetId Empty {get;}

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId.IsLocal Property

Is the Address Local?

public bool IsLocal {get;}

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId.Local Property

Gets the Local Net ID (System service must be running)

public static AmsNetId Local {get;}

Remarks

The system service must be running

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId.LocalHost Property

Creates the local NetId ("127.0.0.1.1.1")

public static AmsNetId LocalHost {get;}

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId Methods

The methods of the AmsNetId class are listed below. For a complete list of AmsNetId class members, see the AmsNetId Members topic.

Public Static (Shared) Methods

GetNetIdString | Gets the netId string from the byte array
NetIdsEqual | Compares the NetIds
Parse | Parses a net ID and creates a new AmsNetId object

Public Instance Methods

Clone | Clones the NetId
Equals | Equals
GetHashCode | Gets the HashCode of the Address
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
NetIdsEqual | Compares the netIds
ToBytes | Converts the NetId object to byte array
ToString | Converts the netId to string

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId.Clone Method

Clones the NetId

public AmsNetId Clone();

Return Value

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId.Equals Method

Equals

public override bool Equals(
objectobj
);

Parameters

obj

Return Value

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId.GetHashCode Method

Gets the HashCode of the Address

public override int GetHashCode();

Return Value

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId.GetNetIdString Method

Gets the netId string from the byte array

public static string GetNetIdString(
byte[]netId
);

Parameters

netId

Return Value

See Also

AmsNetId Class | TwinCAT.Ads Namespace


NetIdsEqual Method

TwinCAT.Ads

AmsNetId.NetIdsEqual

Compares the netIds

Overload List

Compares the NetIds

public static bool NetIdsEqual(byte[],byte[]);

Compares the netIds

public bool NetIdsEqual(byte[]);

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId.NetIdsEqual Method (Byte[])

Compares the netIds

public bool NetIdsEqual(
byte[]netId
);

Parameters

netId

Return Value

See Also

AmsNetId Class | TwinCAT.Ads Namespace | AmsNetId.NetIdsEqual Overload List


AmsNetId.NetIdsEqual Method (Byte[], Byte[])

Compares the NetIds

public static bool NetIdsEqual(
byte[]netId1,
byte[]netId2
);

Parameters

netId1
netId2

Return Value

See Also

AmsNetId Class | TwinCAT.Ads Namespace | AmsNetId.NetIdsEqual Overload List


AmsNetId.Parse Method

Parses a net ID and creates a new AmsNetId object

public static AmsNetId Parse(
stringnetId
);

Parameters

netId

Return Value

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId.ToBytes Method

Converts the NetId object to byte array

public byte[] ToBytes();

Return Value

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId.ToString Method

Converts the netId to string

public override string ToString();

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId Operators

The operators of the AmsNetId class are listed below. For a complete list of AmsNetId class members, see the AmsNetId Members topic.

Public Static (Shared) Operators

Equality Operator | Operator==
Inequality Operator | Operator-=

See Also

AmsNetId Class | AmsNetId Members | TwinCAT.Ads Namespace


AmsNetId Constructor

Operator==

public static bool operator ==(
AmsNetIdo1,
AmsNetIdo2
);

Parameters

o1
o2

Return Value

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsNetId Constructor

Operator-=

public static bool operator !=(
AmsNetIdo1,
AmsNetIdo2
);

Parameters

o1
o2

Return Value

See Also

AmsNetId Class | TwinCAT.Ads Namespace


AmsPort Enumeration

AmsPorts

public enum AmsPort

Members

Member Name | Description
Router | AmsRouter
Debugger | AmsDebugger
Logger | Logger
EventLog | Event Logger
R0_Realtime | R0 Realtime
R0_Trace | R0 Trace
R0_IO | R0 IO
R0_NC | NC (R0)
R0_NCSAF | R0 Satzausführung
R0_NCSVB | R0 Satzvorbereitung
R0_ISG | R0 ISG
R0_CNC | R0 CNC
R0_LINE | R0 Line
R0_PLC | R0 PLC
PlcRuntime1 | PLC RuntimeSystem 1
PlcRuntime2 | PLC RöuntimeSystem 2
PlcRuntime3 | PLC RuntimeSystem 3
PlcRuntime4 | PLC RuntimeSystem 4
CamshaftController | Camshaft Controller (R0)
R0_CAMTOOL | R0 CAM Tool
R0_USER | R0 User
SystemService | System Service (AMSPORT_R3_SYSSERV, 10000)
R3_CTRLPROG |
R3_SYSCTRL |
R3_SYSSAMPLER |
R3_TCPRAWCONN |
R3_TCPIPSERVER |
R3_SYSMANAGER |
R3_SMSSERVER |
R3_MODBUSSERVER |
R3_S7SERVER |
R3_PLCCONTROL |
R3_NCCTRL |
R3_NCINTERPRETER |
R3_STRECKECTRL |
R3_CAMCTRL |
R3_SCOPE |
R3_SINECH1 |
R3_CONTROLNET |
R3_OPCSERVER |
R3_OPCCLIENT |
USEDEFAULT |

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AmsRouterNotificationEventArgs Class

Provides data for AmsRouterNotificationEvent of the class TcAdsClient.

For a list of all members of this type, see AmsRouterNotificationEventArgs Members.

System.Object
System.EventArgs
TwinCAT.Ads.AmsRouterNotificationEventArgs

public sealed class AmsRouterNotificationEventArgs : EventArgs

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

AmsRouterNotificationEventArgs Members | TwinCAT.Ads Namespace


AmsRouterNotificationEventArgs Members

Public Instance Constructors

AmsRouterNotificationEventArgs Constructor Initializes a new instance of the AmsRouterNotificationEventArgs class.

Public Instance Properties

State Current state of the Ams Router.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

AmsRouterNotificationEventArgs Class | TwinCAT.Ads Namespace


AmsRouterNotificationEventArgs Constructor

Initializes a new instance of the AmsRouterNotificationEventArgs class.

public AmsRouterNotificationEventArgs(
AmsRouterStatestate
);

Parameters

state
The current state of the Router.

See Also

AmsRouterNotificationEventArgs Class | TwinCAT.Ads Namespace


AmsRouterNotificationEventArgs Properties

The properties of the AmsRouterNotificationEventArgs class are listed below. For a complete list of AmsRouterNotificationEventArgs class members, see the AmsRouterNotificationEventArgs Members topic.

Public Instance Properties

State Current state of the Ams Router.

See Also

AmsRouterNotificationEventArgs Class | TwinCAT.Ads Namespace


AmsRouterNotificationEventArgs.State Property

Current state of the Ams Router.

public AmsRouterState State {get;}

See Also

AmsRouterNotificationEventArgs Class | TwinCAT.Ads Namespace


AmsRouterNotificationEventHandler Delegate

Event handler for the AmsRouterNotification event in the class TcAdsClient.

public delegate void AmsRouterNotificationEventHandler(
objectsender,
AmsRouterNotificationEventArgse
);

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


AmsRouterState Enumeration

State of the Ams Router.

public enum AmsRouterState

Members

Member Name | Description
Stop | Ams Router is stopped.
Start | Ams Router is started.
Removed | Ams Router has been removed.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TwinCAT.Ads Namespace


DeviceInfo Structure

The structure contains the name and the version information of the device.

For a list of all members of this type, see DeviceInfo Members.

System.Object
System.ValueType
TwinCAT.Ads.DeviceInfo

public struct DeviceInfo

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

DeviceInfo Members | TwinCAT.Ads Namespace


DeviceInfo Members

Public Instance Properties

Name | Gets or sets the name of the device.
Version | Gets or sets the version information.

Public Instance Methods

Equals (inherited from ValueType) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from ValueType) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from ValueType) | Select the method name to go to the Microsoft documentation.

See Also

DeviceInfo Class | TwinCAT.Ads Namespace


DeviceInfo Properties

The properties of the DeviceInfo class are listed below. For a complete list of DeviceInfo class members, see the DeviceInfo Members topic.

Public Instance Properties

Name | Gets or sets the name of the device.
Version | Gets or sets the vesion information.

See Also

DeviceInfo Class | TwinCAT.Ads Namespace


DeviceInfo.Name Property

Gets or sets the name of the device.

public string Name {get; set;}

See Also

DeviceInfo Class | TwinCAT.Ads Namespace


DeviceInfo.Version Property

Gets or sets the version information.

public AdsVersion Version {get; set;}

See Also

DeviceInfo Class | TwinCAT.Ads Namespace


ITcAdsSymbol Interface

Defines an Interface for reading the ADS symbol information.

For a list of all members of this type, see ITcAdsSymbol Members.

public interface ITcAdsSymbol

Types that implement ITcAdsSymbol

Type | Description
TcAdsSymbolInfo | The class TcAdsSymbolInfo represents a symbol loaded by an instance of the TcAdsSymbolInfoLoader class.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

ITcAdsSymbol Members | TwinCAT.Ads Namespace


ITcAdsSymbol Members

Public Instance Properties

Comment | Gets the comment behind the variable declaration.
Datatype | Data type of the symbol.
IndexGroup | Gets the index group of the symbol.
IndexOffset | Gets the index offset of the symbol.
Name | Gets the name of the symbol.
Size | Gets the size of the symbol.
Type | Gets the name of the symbol data type.

See Also

ITcAdsSymbol Interface | TwinCAT.Ads Namespace


ITcAdsSymbol Properties

The properties of the ITcAdsSymbol class are listed below. For a complete list of ITcAdsSymbol class members, see the ITcAdsSymbol Members topic.

Public Instance Properties

Comment | Gets the comment behind the variable declaration.
Datatype | Data type of the symbol.
IndexGroup | Gets the index group of the symbol.
IndexOffset | Gets the index offset of the symbol.
Name | Gets the name of the symbol.
Size | Gets the size of the symbol.
Type | Gets the name of the symbol data type.

See Also

ITcAdsSymbol Interface | TwinCAT.Ads Namespace


ITcAdsSymbol.Comment Property

Gets the comment behind the variable declaration.

string Comment {get;}

Property Value

Comment behind the variable declaration.

See Also

ITcAdsSymbol Interface | TwinCAT.Ads Namespace


ITcAdsSymbol.Datatype Property

Data type of the symbol.

        AdsDatatypeId Datatype {get;}

Property Value

Data type of the symbol.

See Also

ITcAdsSymbol Interface | TwinCAT.Ads Namespace


ITcAdsSymbol.IndexGroup Property

Gets the index group of the symbol.

long IndexGroup {get;}

Property Value

Index group of the symbol.

See Also

ITcAdsSymbol Interface | TwinCAT.Ads Namespace


ITcAdsSymbol.IndexOffset Property

Gets the index offset of the symbol.

long IndexOffset {get;}

Property Value

Index offset of the symbol.

See Also

ITcAdsSymbol Interface | TwinCAT.Ads Namespace


ITcAdsSymbol.Name Property

Gets the name of the symbol.

string Name {get;}

Property Value

Name of the symbol.

See Also

ITcAdsSymbol Interface | TwinCAT.Ads Namespace


ITcAdsSymbol.Size Property

Gets the size of the symbol.

int Size {get;}

Property Value

Size of the symbol.

See Also

ITcAdsSymbol Interface | TwinCAT.Ads Namespace


ITcAdsSymbol.Type Property

Gets the name of the symbol data type.

string Type {get;}

Property Value

Name of the symbol data type.

See Also

ITcAdsSymbol Interface | TwinCAT.Ads Namespace


StateInfo Structure

The structure contains the Ads state and device state.

For a list of all members of this type, see StateInfo Members.

System.Object
System.ValueType
TwinCAT.Ads.StateInfo

public struct StateInfo

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

StateInfo Members | TwinCAT.Ads Namespace


StateInfo Members

Public Instance Constructors

StateInfo Constructor Initializes a new Instance of the StateInfo struct.

Public Instance Properties

AdsState | Gets or sets the Ads state.
DeviceState | Gets or sets the device state.

Public Instance Methods

Equals (inherited from ValueType) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from ValueType) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from ValueType) | Select the method name to go to the Microsoft documentation.

See Also

StateInfo Class | TwinCAT.Ads Namespace


StateInfo Constructor

Initializes a new Instance of the StateInfo struct.

public StateInfo(
AdsStateadsState,
shortdeviceState
);

Parameters

adsState
Ads state.
deviceState
Device state.

See Also

StateInfo Class | TwinCAT.Ads Namespace


StateInfo Properties

The properties of the StateInfo class are listed below. For a complete list of StateInfo class members, see the StateInfo Members topic.

Public Instance Properties

AdsState | Gets or sets the Ads state.
DeviceState | Gets or sets the device state.

See Also

StateInfo Class | TwinCAT.Ads Namespace


StateInfo.AdsState Property

Gets or sets the Ads state.

public AdsState AdsState {get; set;}

See Also

StateInfo Class | TwinCAT.Ads Namespace


StateInfo.DeviceState Property

Gets or sets the device state.

public short DeviceState {get; set;}

See Also

StateInfo Class | TwinCAT.Ads Namespace


TcAdsClient Class

The class TcAdsClient is a wrapper for the TcAdsdll.dll and enables synchronous access to an Ads device.

For a list of all members of this type, see TcAdsClient Members.

System.Object
TwinCAT.Ads.TcAdsClient

public class TcAdsClient :

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TcAdsClient Members | TwinCAT.Ads Namespace


TcAdsClient Members

Public Instance Constructors

TcAdsClient Constructor Initializes a new instance of the class TcAdsClient.

Public Instance Properties

ClientCycle | Gets or sets a value indicating whether the TcAdsClient object uses a client cylce for the notificatons.
ClientNetID | Get the AmsNetId of the ADS client.
ClientPort | Gets the port number of the ADS client.
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.
IsLocal | Gets a value indicating whether the ADS client is connected to a ADS Server on the local computer.
RouterState | Gets the current state of the local AMS router.
ServerNetID | Gets the AmsNetId of the ADS server.
ServerPort | Gets the port number of the ADS server.
Synchronize | Gets or sets a value indicating whether the TcAdsClient object synchronizes the incoming notifcations.
Timeout | Sets the timeout for the ads communication. Unit is in ms.

Public Instance Methods

AddDeviceNotification | Overloaded. Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.
AddDeviceNotificationEx | Overloaded. Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.
Connect | Overloaded. Establishes a connection to a ADS device.
CreateSymbolInfoLoader | Creates a new instance of the TcAdsSymbolInfoLoader class. With the help of this object one can load the symbol information of the ADS device.
CreateVariableHandle | Generates a unique handle for an ADS variable.
DeleteDeviceNotification | Deletes an existing notification.
DeleteVariableHandle | Releases the handle of a ADS variable again.
Dispose | Releases the resources used by TcAdsClient.
Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
Read | Overloaded. Reads data synchronously from an ADS device and writes it to the given stream.
ReadAny | Overloaded. 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.
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 | Overloaded. Reads the value of a symbol and returns the value as objcet. 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 | Overloaded. Writes data synchronously to an ADS device and then Reads data from this device.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.
Write | Overloaded. Writes data synchronously to an ADS device.
WriteAny | Overloaded. Writes an object synchronously to an ADS device.
WriteControl | Overloaded. Changes the ADS status and the device status of an ADS server.
WriteSymbol | Overloaded. Writes the passed object value to the specified ADS symbol.The parameter type must have the same layout as the ADS symbol.

Public Instance Events

AdsNotification | Occurs when the Ads device sends a notification to the client.
AdsNotificationError | Occurs when a exception has occured during notification management.
AdsNotificationEx | Occurs when the Ads devices sends a notification to the client.
AdsStateChanged | Occurs when the ADS state changes.
AdsSymbolVersionChanged | Occurs when the symbol version changes.
AmsRouterNotification | Occurs when the state of the local Router has changed.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient Constructor

Initializes a new instance of the class TcAdsClient.

public TcAdsClient();

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient Properties

The properties of the TcAdsClient class are listed below. For a complete list of TcAdsClient class members, see the TcAdsClient Members topic.

Public Instance Properties

ClientCycle | Gets or sets a value indicating whether the TcAdsClient object uses a client cylce for the notificatons.
ClientNetID | Get the AmsNetId of the ADS client.
ClientPort | Gets the port number of the ADS client.
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.
IsLocal | Gets a value indicating whether the ADS client is connected to a ADS Server on the local computer.
RouterState | Gets the current state of the local AMS router.
ServerNetID | Gets the AmsNetId of the ADS server.
ServerPort | Gets the port number of the ADS server.
Synchronize | Gets or sets a value indicating whether the TcAdsClient object synchronizes the incoming notifcations.
Timeout | Sets the timeout for the ads communication. Unit is in ms.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.ClientCycle Property

Gets or sets a value indicating whether the TcAdsClient object uses a client cylce for the notificatons.

public bool ClientCycle {get; set;}

Remarks

If ClientCycle is set to false, the ADS that has been addressed writes the data cyclically to the TcAdsClient object. The smallest possible time is the cycle time of the ADS device. For the PLC, this is the task cycle time. The cycle time can be handled in 1 ms steps. If you enter 0 ms as the cycle time, then the data is sent to the TcAdsClient object with every cycle of the ADS device task. If ClientCylce is set to true, the TcAdsClient object polls the variables cyclically. The timer that initiates the read / write runs in Windows NT/2000 user mode, which means that the time behaviour strongly depends on the loading of the system.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.ClientNetID Property

Get the AmsNetId of the ADS client.

public string ClientNetID {get;}

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.ClientPort Property

Gets the port number of the ADS client.

public int ClientPort {get;}

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.IsConnected Property

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.

public bool IsConnected {get;}

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.IsLocal Property

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

public bool IsLocal {get;}

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.RouterState Property

Gets the current state of the local AMS router.

public AmsRouterState RouterState {get;}

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.ServerNetID Property

Gets the AmsNetId of the ADS server.

public string ServerNetID {get;}

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.ServerPort Property

Gets the port number of the ADS server.

public int ServerPort {get;}

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.Synchronize Property

Gets or sets a value indicating whether the TcAdsClient object synchronizes the incoming notifcations.

public bool Synchronize {get; set;}

Remarks

If Synchronize is set to true, the notifications are synchronized onto the Main thread. This is necessary for Windows Forms projects. In Console Application this property should be set to false.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.Timeout Property

Sets the timeout for the ads communication. Unit is in ms.

public int Timeout {get; set;}

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient Methods

The methods of the TcAdsClient class are listed below. For a complete list of TcAdsClient class members, see the TcAdsClient Members topic.

Public Instance Methods

AddDeviceNotification | Overloaded. Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.
AddDeviceNotificationEx | Overloaded. Connects a variable to the ADS client. The ADS client will be notified by the AdsNotification event.
Connect | Overloaded. Establishes a connection to a ADS device.
CreateSymbolInfoLoader | Creates a new instance of the TcAdsSymbolInfoLoader class. With the help of this object one can load the symbol information of the ADS device.
CreateVariableHandle | Generates a unique handle for an ADS variable.
DeleteDeviceNotification | Deletes an existing notification.
DeleteVariableHandle | Releases the handle of a ADS variable again.
Dispose | Releases the resources used by TcAdsClient.
Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
Read | Overloaded. Reads data synchronously from an ADS device and writes it to the given stream.
ReadAny | Overloaded. 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.
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 | Overloaded. Reads the value of a symbol and returns the value as objcet. 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 | Overloaded. Writes data synchronously to an ADS device and then Reads data from this device.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.
Write | Overloaded. Writes data synchronously to an ADS device.
WriteAny | Overloaded. Writes an object synchronously to an ADS device.
WriteControl | Overloaded. Changes the ADS status and the device status of an ADS server.
WriteSymbol | Overloaded. Writes the passed object value to the specified ADS symbol.The parameter type must have the same layout as the ADS symbol.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


AddDeviceNotification Method

TwinCAT.Ads

TcAdsClient.AddDeviceNotification

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

Overload List

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

public int AddDeviceNotification(int,int,AdsStream,int,int,AdsTransMode,int,int,object);

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

public int AddDeviceNotification(int,int,AdsStream,AdsTransMode,int,int,object);

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

public int AddDeviceNotification(long,long,AdsStream,int,int,AdsTransMode,int,int,object);

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

public int AddDeviceNotification(long,long,AdsStream,AdsTransMode,int,int,object);

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

public int AddDeviceNotification(string,AdsStream,int,int,AdsTransMode,int,int,object);

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

public int AddDeviceNotification(string,AdsStream,AdsTransMode,int,int,object);

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.AddDeviceNotification Method (Int32, Int32, AdsStream, Int32, Int32, AdsTransMode, Int32, Int32, Object)

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

public int AddDeviceNotification(
intindexGroup,
intindexOffset,
AdsStreamdataStream,
intoffset,
intlength,
AdsTransModetransMode,
intcycleTime,
intmaxDelay,
objectuserData
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
The stream that should receive the data.
offset
Offset of the data in dataStream.
length
Length of the data in dataStream.
transMode
Specifies if the event should be fired cyclically or only if the variable has changed.
cycleTime
The ADS server checks whether the variable has changed after this time interval. Unit is in ms.
maxDelay
The AdsNotification event is fired at the latest when this time has elapsed. The unit is ms.
userData
This object can be used to store user specific data.

Return Value

The handle of the notification.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.AddDeviceNotification Overload List


TcAdsClient.AddDeviceNotification Method (Int32, Int32, AdsStream, AdsTransMode, Int32, Int32, Object)

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

public int AddDeviceNotification(
intindexGroup,
intindexOffset,
AdsStreamdataStream,
AdsTransModetransMode,
intcycleTime,
intmaxDelay,
objectuserData
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
The stream that should receive the data.
transMode
Specifies if the event should be fired cyclically or only if the variable has changed.
cycleTime
The ADS server checks whether the variable has changed after this time interval. Unit is in ms.
maxDelay
The AdsNotification event is fired at the latest when this time has elapsed. The unit is ms.
userData
This object can be used to store user specific data.

Return Value

The handle of the notification.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.AddDeviceNotification Overload List


TcAdsClient.AddDeviceNotification Method (Int64, Int64, AdsStream, Int32, Int32, AdsTransMode, Int32, Int32, Object)

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

public int AddDeviceNotification(
longindexGroup,
longindexOffset,
AdsStreamdataStream,
intoffset,
intlength,
AdsTransModetransMode,
intcycleTime,
intmaxDelay,
objectuserData
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
The stream that should receive the data.
offset
Offset of the data in dataStream.
length
Length of the data in dataStream.
transMode
Specifies if the event should be fired cyclically or only if the variable has changed.
cycleTime
The ADS server checks whether the variable has changed after this time interval. Unit is in ms.
maxDelay
The AdsNotification event is fired at the latest when this time has elapsed. The unit is ms.
userData
This object can be used to store user specific data.

Return Value

The handle of the notification.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.AddDeviceNotification Overload List


TcAdsClient.AddDeviceNotification Method (Int64, Int64, AdsStream, AdsTransMode, Int32, Int32, Object)

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

public int AddDeviceNotification(
longindexGroup,
longindexOffset,
AdsStreamdataStream,
AdsTransModetransMode,
intcycleTime,
intmaxDelay,
objectuserData
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
The stream that should receive the data.
transMode
Specifies if the event should be fired cyclically or only if the variable has changed.
cycleTime
The ADS server checks whether the variable has changed after this time interval. Unit is in ms.
maxDelay
The AdsNotification event is fired at the latest when this time has elapsed. The unit is ms.
userData
This object can be used to store user specific data.

Return Value

The handle of the notification.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.AddDeviceNotification Overload List


TcAdsClient.AddDeviceNotification Method (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.

public int AddDeviceNotification(
stringvariableName,
AdsStreamdataStream,
intoffset,
intlength,
AdsTransModetransMode,
intcycleTime,
intmaxDelay,
objectuserData
);

Parameters

variableName
Name of the ADS variable.
dataStream
The stream that should receive the data.
offset
Offset of the data in dataStream.
length
Length of the data in dataStream.
transMode
Specifies if the event should be fired cyclically or only if the variable has changed.
cycleTime
The ADS server checks whether the variable has changed after this time interval. Unit is in ms.
maxDelay
The AdsNotification event is fired at the latest when this time has elapsed. The unit is ms.
userData
This object can be used to store user specific data.

Return Value

The handle of the notification.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.AddDeviceNotification Overload List


TcAdsClient.AddDeviceNotification Method (String, AdsStream, AdsTransMode, Int32, Int32, Object)

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

public int AddDeviceNotification(
stringvariableName,
AdsStreamdataStream,
AdsTransModetransMode,
intcycleTime,
intmaxDelay,
objectuserData
);

Parameters

variableName
Name of the ADS variable.
dataStream
The stream that should receive the data.
transMode
Specifies if the event should be fired cyclically or only if the variable has changed.
cycleTime
The ADS server checks whether the variable has changed after this time interval. Unit is in ms.
maxDelay
The AdsNotification event is fired at the latest when this time has elapsed. The unit is ms.
userData
This object can be used to store user specific data.

Return Value

The handle of the notification.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.AddDeviceNotification Overload List


AddDeviceNotificationEx Method

TwinCAT.Ads

TcAdsClient.AddDeviceNotificationEx

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

Overload List

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

public int AddDeviceNotificationEx(long,long,AdsTransMode,int,int,object,Type);

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.

public int AddDeviceNotificationEx(long,long,AdsTransMode,int,int,object,Type,int[]);

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

public int AddDeviceNotificationEx(string,AdsTransMode,int,int,object,Type);

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

public int AddDeviceNotificationEx(string,AdsTransMode,int,int,object,Type,int[]);

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.AddDeviceNotificationEx Method (Int64, Int64, AdsTransMode, Int32, Int32, Object, Type)

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

public int AddDeviceNotificationEx(
longindexGroup,
longindexOffset,
AdsTransModetransMode,
intcycleTime,
intmaxDelay,
objectuserData,
Typetype
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
transMode
Specifies if the event should be fired cyclically or only if the variable has changed.
cycleTime
The ADS server checks whether the variable has changed after this time interval. Unit is in ms.
maxDelay
The AdsNotification event is fired at the latest when this time has elapsed. The unit is ms.
userData
This object can be used to store user specific data.
type
Type of the object stored in the event argument.

Return Value

The handle of the notification.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.AddDeviceNotificationEx Overload List


TcAdsClient.AddDeviceNotificationEx Method (Int64, Int64, 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.

public int AddDeviceNotificationEx(
longindexGroup,
longindexOffset,
AdsTransModetransMode,
intcycleTime,
intmaxDelay,
objectuserData,
Typetype,
int[]args
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
transMode
Specifies if the event should be fired cyclically or only if the variable has changed.
cycleTime
The ADS server checks whether the variable has changed after this time interval. Unit is in ms.
maxDelay
The AdsNotification event is fired at the latest when this time has elapsed. The unit is ms.
userData
This object can be used to store user specific data.
type
Type of the object s0000tored in the event argument.
args
Additional arguments.

Return Value

The handle of the notification.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.AddDeviceNotificationEx Overload List


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

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

public int AddDeviceNotificationEx(
stringvariableName,
AdsTransModetransMode,
intcycleTime,
intmaxDelay,
objectuserData,
Typetype
);

Parameters

variableName
Name of the ADS variable.
transMode
Specifies if the event should be fired cyclically or only if the variable has changed.
cycleTime
The ADS server checks whether the variable has changed after this time interval. Unit is in ms.
maxDelay
The AdsNotification event is fired at the latest when this time has elapsed. The unit is ms.
userData
This object can be used to store user specific data.
type
Type of the object stored in the event argument.

Return Value

The handle of the notification.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.AddDeviceNotificationEx Overload List


TcAdsClient.AddDeviceNotificationEx Method (String, AdsTransMode, Int32, Int32, Object, Type, Int32[])

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

public int AddDeviceNotificationEx(
stringvariableName,
AdsTransModetransMode,
intcycleTime,
intmaxDelay,
objectuserData,
Typetype,
int[]args
);

Parameters

variableName
Name of the ADS variable.
transMode
Specifies if the event should be fired cyclically or only if the variable has changed.
cycleTime
The ADS server checks whether the variable has changed after this time interval. Unit is in ms.
maxDelay
The AdsNotification event is fired at the latest when this time has elapsed. The unit is ms.
userData
This object can be used to store user specific data.
type
Type of the object stored in the event argument.
args
Additional arguments.

Return Value

The handle of the notification.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.AddDeviceNotificationEx Overload List


Connect Method

TwinCAT.Ads

TcAdsClient.Connect

Establishes a connection to a ADS device.

Overload List

Establishes a connection to a ADS device.

public void Connect(string,int);

Establishes a connection to a ADS device.

public void Connect(byte[],int);

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

public void Connect(int);

Establishes a connection to a ADS device.

public void Connect(AmsNetId,int);

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.Connect Method (Byte[], Int32)

Establishes a connection to a ADS device.

public void Connect(
byte[]netID,
intsrvPort
);

Parameters

netID
NetId of the ADS server.
srvPort
Port number of the ADS server.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Connect Overload List


TcAdsClient.Connect Method (Int32)

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

public void Connect(
intsrvPort
);

Parameters

srvPort
Port number of the ADS server.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Connect Overload List


TcAdsClient.Connect Method (String, Int32)

Establishes a connection to a ADS device.

public void Connect(
stringnetID,
intsrvPort
);

Parameters

netID
NetId of the ADS server.
srvPort
Port number of the ADS server.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Connect Overload List


TcAdsClient.Connect Method (AmsNetId, Int32)

Establishes a connection to a ADS device.

public void Connect(
AmsNetIdnetID,
intsrvPort
);

Parameters

netID
NetId of the ADS server.
srvPort
Port number of the ADS server.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Connect Overload List


TcAdsClient.CreateSymbolInfoLoader Method

Creates a new instance of the TcAdsSymbolInfoLoader class. With the help of this object one can load the symbol information of the ADS device.

public TcAdsSymbolInfoLoader CreateSymbolInfoLoader();

Return Value

Instance of the TcAdsSymbolInfoLoader class.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.CreateVariableHandle Method

Generates a unique handle for an ADS variable.

public int CreateVariableHandle(
stringvariableName
);

Parameters

variableName
Name of the ADS variable

Return Value

The handle of the ADS Variable.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.DeleteDeviceNotification Method

Deletes an existing notification.

public void DeleteDeviceNotification(
intnotificationHandle
);

Parameters

notificationHandle
Handle of the notification.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.DeleteVariableHandle Method

Releases the handle of a ADS variable again.

public void DeleteVariableHandle(
intvariableHandle
);

Parameters

variableHandle
Handle of the ADS variable

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.Dispose Method

Releases the resources used by TcAdsClient.

public  void Dispose();

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


Read Method

TwinCAT.Ads

TcAdsClient.Read

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

Overload List

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

public int Read(int,int,AdsStream,int,int);

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

public int Read(int,int,AdsStream);

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

public int Read(long,long,AdsStream,int,int);

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

public int Read(long,long,AdsStream);

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

public int Read(int,AdsStream,int,int);

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

public int Read(int,AdsStream);

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.Read Method (Int32, Int32, AdsStream)

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

public int Read(
intindexGroup,
intindexOffset,
AdsStreamdataStream
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
Stream that receives the data.

Return Value

Number of succesfully returned data bytes.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Read Overload List


TcAdsClient.Read Method (Int32, Int32, AdsStream, Int32, Int32)

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

public int Read(
intindexGroup,
intindexOffset,
AdsStreamdataStream,
intoffset,
intlength
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
Stream that receives the data.
offset
Offset of the data in dataStream.
length
Length of the data in dataStream.

Return Value

Number of succesfully returned data bytes.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Read Overload List


TcAdsClient.Read Method (Int32, AdsStream)

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

public int Read(
intvariableHandle,
AdsStreamdataStream
);

Parameters

variableHandle
Handle of the ADS variable
dataStream
Stream that receives the data.

Return Value

Number of succesfully returned data bytes.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Read Overload List


TcAdsClient.Read Method (Int32, AdsStream, Int32, Int32)

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

public int Read(
intvariableHandle,
AdsStreamdataStream,
intoffset,
intlength
);

Parameters

variableHandle
Handle of the ADS variable
dataStream
Stream that receives the data.
offset
Offset of the data in dataStream.
length
Length of the data in dataStream.

Return Value

Number of succesfully returned data bytes.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Read Overload List


TcAdsClient.Read Method (Int64, Int64, AdsStream)

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

public int Read(
longindexGroup,
longindexOffset,
AdsStreamdataStream
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
Stream that receives the data.

Return Value

Number of succesfully returned data bytes.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Read Overload List


TcAdsClient.Read Method (Int64, Int64, AdsStream, Int32, Int32)

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

public int Read(
longindexGroup,
longindexOffset,
AdsStreamdataStream,
intoffset,
intlength
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
Stream that receives the data.
offset
Offset of the data in dataStream.
length
Length of the data in dataStream.

Return Value

Number of succesfully returned data bytes.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Read Overload List


ReadAny Method

TwinCAT.Ads

TcAdsClient.ReadAny

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

Overload List

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.

public object ReadAny(int,Type,int[]);

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

public object ReadAny(int,Type);

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.

public object ReadAny(long,long,Type,int[]);

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

public object ReadAny(long,long,Type);

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.ReadAny Method (Int32, Type)

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

public object ReadAny(
intvariableHandle,
Typetype
);

Parameters

variableHandle
Handle of the ADS variable.
type
Type of the object to be read.
Folowing types are supported:
.NET Type | C# Type | VB Type | Delphi Prism (Oxygene for .NET) Type | Equivalent PLC Type | Description
System.UInt32 | uint | - | Longword, Cardinal | UDINT, DWORD |
System.Int32 | int | Integer | Integer, Longint | DINT |
Systen.UInt16 | ushort | - | Word | UINT, WORD |
System.Int16 | short | Short | Smallint | INT |
System.Byte | byte | Byte | Byte | BYTE, USINT |
System.Double | double | Double | Double, Real | LREAL |
System.Single | float | Single | Single | REAL |
System.Bool | bool | Boolean | Boolean | BOOL |
System.SByte | - | - | Shortint | SINT |
Classes and structures, that can be marshaled (not possible with the Compact Framework(CE) |  |  |  |  | Classes are to be favored, as the individual elements can be initialized. This is especially important for array elements.

In case the method was successfull, the read data will be returned as a object. The type of the object is equal to the type passed in the parameter type. Because some data types(arrays and strings) need additional information, an overload of the method ReadAny exists, that takes an additional parameter args. E.g. with strings one has to pass an integer array of the length 1.

Return Value

The object the read data is written to.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.ReadAny Overload List


TcAdsClient.ReadAny Method (Int32, 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.

public object ReadAny(
intvariableHandle,
Typetype,
int[]args
);

Parameters

variableHandle
Handle of the ADS variable.
type
Type of the object to be read.
args
Additional arguments.

Folowing types are supported:

.NET Type | C# Type | VB Type | Delphi Prism (Oxygene for .NET) Type | Equivalent PLC Type | Description
System.UInt32 | uint | - | Longword, Cardinal | UDINT, DWORD |
System.Int32 | int | Integer | Integer, Longint | DINT |
Systen.UInt16 | ushort | - | Word | UINT, WORD |
System.Int16 | short | Short | Smallint | INT |
System.Byte | byte | Byte | Byte | BYTE, USINT |
System.Double | double | Double | Double, Real | LREAL |
System.Single | float | Single | Single | REAL |
System.Bool | bool | Boolean | Boolean | BOOL |
System.SByte | - | - | Shortint | SINT |
1 dimensional arrays of the previous types. |  |  |  |  | The length n of the array is passed in the parameter args: args = new Integer(){ n }
System.String | string | String | String | STRING | The length n of the string is passed in the parameter args: args = new Integer(){ n }. If no length is specified in the PLC n must be set to 80
Classes and structures, that can be marshaled (not possible with the Compact Framework(CE)) |  |  |  |  | Classes are to be favored, as the individual elements can be initialized. This is especially important for array elements.

In case the method was successfull, the read data will be returned as a object. The type of the object is equal to the type passed in the parameter type. Because some data types(arrays and strings) need additional information, an overload of the method ReadAny exists, that takes an additional parameter args. E.g. with strings one has to pass an integer array of the length 1.

Return Value

The object the read data is written to.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.ReadAny Overload List


TcAdsClient.ReadAny Method (Int64, Int64, Type)

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

public object ReadAny(
longindexGroup,
longindexOffset,
Typetype
);

Parameters

indexGroup
Index group of the ADS variable.
indexOffset
Index offset of the ADS variable.
type
Type of the object to be read.
Folowing types are supported:
.NET Type | C# Type | VB Type | Delphi Prism (Oxygene for .NET) Type | Equivalent PLC Type | Description
System.UInt32 | uint | - | Longword, Cardinal | UDINT, DWORD |
System.Int32 | int | Integer | Integer, Longint | DINT |
Systen.UInt16 | ushort | - | Word | UINT, WORD |
System.Int16 | short | Short | Smallint | INT |
System.Byte | byte | Byte | Byte | BYTE, USINT |
System.Double | double | Double | Double, Real | LREAL |
System.Single | float | Single | Single | REAL |
System.Bool | bool | Boolean | Boolean | BOOL |
System.SByte | - | - | Shortint | SINT |
Classes and structures, that can be marshaled (not possible with the Compact Framework(CE)) |  |  |  |  | Classes are to be favored, as the individual elements can be initialized. This is especially important for array elements.

In case the method was successfull, the read data will be returned as a object. The type of the object is equal to the type passed in the parameter type. Because some data types(arrays and strings) need additional information, an overload of the method ReadAny exists, that takes an additional parameter args. E.g. with strings one has to pass an integer array of the length 1.

Return Value

The object the read data is written to.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.ReadAny Overload List


TcAdsClient.ReadAny Method (Int64, Int64, 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.

public object ReadAny(
longindexGroup,
longindexOffset,
Typetype,
int[]args
);

Parameters

indexGroup
Index group of the ADS variable.
indexOffset
Index offset of the ADS variable.
type
Type of the object to be read.
args
Additional arguments.

Folowing types are supported:

.NET Type | C# Type | VB Type | Delphi Prism (Oxygene for .NET) Type | Equivalent PLC Type | Description
System.UInt32 | uint | - | Longword, Cardinal | UDINT, DWORD |
System.Int32 | int | Integer | Integer, Longint | DINT |
Systen.UInt16 | ushort | - | Word | UINT, WORD |
System.Int16 | short | Short | Smallint | INT |
System.Byte | byte | Byte | Byte | BYTE, USINT |
System.Double | double | Double | Double, Real | LREAL |
System.Single | float | Single | Single | REAL |
System.Bool | bool | Boolean | Boolean | BOOL |
System.SByte | - | - | Shortint | SINT |
1 dimensional arrays of the previous types. |  |  |  |  | The length n of the array is passed in the parameter args: args = new Integer(){ n }
System.String | string | String | String | STRING | The length n of the string is passed in the parameter args: args = new Integer(){ n }. If no length is specified in the PLC n must be set to 80
Classes and structures, that can be marshaled (not possible with the Compact Framework(CE)) |  |  |  |  | Classes are to be favored, as the individual elements can be initialized. This is especially important for array elements.

In case the method was successfull, the read data will be returned as a object. The type of the object is equal to the type passed in the parameter type. Because some data types(arrays and strings) need additional information, an overload of the method ReadAny exists, that takes an additional parameter args. E.g. with strings one has to pass an integer array of the length 1.

Return Value

The object the read data is written to.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.ReadAny Overload List


TcAdsClient.ReadDeviceInfo Method

Reads the identification and version number of an ADS server.

public DeviceInfo ReadDeviceInfo();

Return Value

DeviceInfo struct containing the name of the device and the version information.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.ReadState Method

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

public StateInfo ReadState();

Return Value

The ADS statue and device status.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


ReadSymbol Method

TwinCAT.Ads

TcAdsClient.ReadSymbol

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

Overload List

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

public object ReadSymbol(string,Type,bool);

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.

public object ReadSymbol(ITcAdsSymbol);

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.ReadSymbol Method (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.

public object ReadSymbol(
stringname,
Typetype,
boolreloadSymbolInfo
);

Parameters

name
Name of the ADS symbol.
type
Managed type of the ADS symbol.
reloadSymbolInfo

Return Value

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.ReadSymbol Overload List


TcAdsClient.ReadSymbol Method (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.

public object ReadSymbol(
ITcAdsSymbolsymbol
);

Parameters

symbol
The symbol that should be read.

Return Value

The value of the symbol as an object.

Exceptions

Exception Type | Condition
AdsDatatypeNotSupportedException | Thrown when a ADS datatype is not supported.
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.ReadSymbol Overload List


TcAdsClient.ReadSymbolInfo Method

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

public ITcAdsSymbol ReadSymbolInfo(
stringname
);

Parameters

name
Name of the symbol.

Return Value

A ITcAdsSymbol containing the requested symbol information or null if symbol could not be found.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


ReadWrite Method

TwinCAT.Ads

TcAdsClient.ReadWrite

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

Overload List

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

public int ReadWrite(long,long,AdsStream,int,int,AdsStream,int,int);

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

public int ReadWrite(int,int,AdsStream,int,int,AdsStream,int,int);

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

public int ReadWrite(int,int,AdsStream,AdsStream);

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

public int ReadWrite(long,long,AdsStream,AdsStream);

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.ReadWrite Method (Int32, Int32, AdsStream, Int32, Int32, AdsStream, Int32, Int32)

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

public int ReadWrite(
intindexGroup,
intindexOffset,
AdsStreamrdDataStream,
intrdOffset,
intrdLength,
AdsStreamwrDataStream,
intwrOffset,
intwrLength
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
rdDataStream
Stream that receives the data that has been read.
rdOffset
Offset of the data in rdDataStream.
rdLength
Length of the data in rdDataStream.
wrDataStream
Stream that contains the data that should be written.
wrOffset
Offset of the data in wrDataStream.
wrLength
Lenght of the data in wrDataStream.

Return Value

Number of succesfully returned data bytes.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.ReadWrite Overload List


TcAdsClient.ReadWrite Method (Int32, Int32, AdsStream, AdsStream)

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

public int ReadWrite(
intindexGroup,
intindexOffset,
AdsStreamrdDataStream,
AdsStreamwrDataStream
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
rdDataStream
Stream that receives the data that has been read.
wrDataStream
Stream that contains the data that should be written.

Return Value

Number of succesfully returned data bytes.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.ReadWrite Overload List


TcAdsClient.ReadWrite Method (Int64, Int64, AdsStream, Int32, Int32, AdsStream, Int32, Int32)

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

public int ReadWrite(
longindexGroup,
longindexOffset,
AdsStreamrdDataStream,
intrdOffset,
intrdLength,
AdsStreamwrDataStream,
intwrOffset,
intwrLength
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
rdDataStream
Stream that receives the data that has been read.
rdOffset
Offset of the data in rdDataStream.
rdLength
Length of the data in rdDataStream.
wrDataStream
Stream that contains the data that should be written.
wrOffset
Offset of the data in wrDataStream.
wrLength
Lenght of the data in wrDataStream.

Return Value

Number of succesfully returned data bytes.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.ReadWrite Overload List


TcAdsClient.ReadWrite Method (Int64, Int64, AdsStream, AdsStream)

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

public int ReadWrite(
longindexGroup,
longindexOffset,
AdsStreamrdDataStream,
AdsStreamwrDataStream
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
rdDataStream
Stream that receives the data that has been read.
wrDataStream
Stream that contains the data that should be written.

Return Value

Number of succesfully returned data bytes.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.ReadWrite Overload List


Write Method

TwinCAT.Ads

TcAdsClient.Write

Writes data synchronously to an ADS device.

Overload List

Writes data synchronously to an ADS device.

public void Write(int,int,AdsStream,int,int);

Writes data synchronously to an ADS device.

public void Write(int,int,AdsStream);

Writes data synchronously to an ADS device.

public void Write(int,int);

Writes data synchronously to an ADS device.

public void Write(long,long,AdsStream,int,int);

Writes data synchronously to an ADS device.

public void Write(long,long,AdsStream);

Writes data synchronously to an ADS device.

public void Write(long,long);

Writes data synchronously to an ADS device.

public void Write(int,AdsStream,int,int);

Writes data synchronously to an ADS device.

public void Write(int,AdsStream);

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.Write Method (Int32, Int32)

Writes data synchronously to an ADS device.

public void Write(
intindexGroup,
intindexOffset
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Write Overload List


TcAdsClient.Write Method (Int32, Int32, AdsStream)

Writes data synchronously to an ADS device.

public void Write(
intindexGroup,
intindexOffset,
AdsStreamdataStream
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
Stream that receives the data.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Write Overload List


TcAdsClient.Write Method (Int32, Int32, AdsStream, Int32, Int32)

Writes data synchronously to an ADS device.

public void Write(
intindexGroup,
intindexOffset,
AdsStreamdataStream,
intoffset,
intlength
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
Stream that contains the data.
offset
Offset of the data in dataStream.
length
Length of the data in dataStream.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Write Overload List


TcAdsClient.Write Method (Int32, AdsStream)

Writes data synchronously to an ADS device.

public void Write(
intvariableHandle,
AdsStreamdataStream
);

Parameters

variableHandle
Handle of the ADS variable
dataStream
Stream that receives the data.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Write Overload List


TcAdsClient.Write Method (Int32, AdsStream, Int32, Int32)

Writes data synchronously to an ADS device.

public void Write(
intvariableHandle,
AdsStreamdataStream,
intoffset,
intlength
);

Parameters

variableHandle
Handle of the ADS variable
dataStream
Stream that contains the data.
offset
Offset of the data in dataStream.
length
Length of the data in dataStream.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Write Overload List


TcAdsClient.Write Method (Int64, Int64)

Writes data synchronously to an ADS device.

public void Write(
longindexGroup,
longindexOffset
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Write Overload List


TcAdsClient.Write Method (Int64, Int64, AdsStream)

Writes data synchronously to an ADS device.

public void Write(
longindexGroup,
longindexOffset,
AdsStreamdataStream
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
Stream that receives the data.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Write Overload List


TcAdsClient.Write Method (Int64, Int64, AdsStream, Int32, Int32)

Writes data synchronously to an ADS device.

public void Write(
longindexGroup,
longindexOffset,
AdsStreamdataStream,
intoffset,
intlength
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
dataStream
Stream that contains the data.
offset
Offset of the data in dataStream.
length
Length of the data in dataStream.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.Write Overload List


WriteAny Method

TwinCAT.Ads

TcAdsClient.WriteAny

Writes an object synchronously to an ADS device.

Overload List

Writes an object synchronously to an ADS device.

public void WriteAny(long,long,object);

Writes an object synchronously to an ADS device.

public void WriteAny(int,object);

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.

public void WriteAny(long,long,object,int[]);

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.

public void WriteAny(int,object,int[]);

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.WriteAny Method (Int32, Object)

Writes an object synchronously to an ADS device.

public void WriteAny(
intvariableHandle,
objectvalue
);

Parameters

variableHandle
Handle of the ADS variable.
value
Object to write to the ADS device.

The parameter value is a reference to the object, that should be written to the PLC variable. The type of the object value must be equal to one of the below types.

.NET Type | C# Type | VB Type | Delphi Prism (Oxygene for .NET) Type | Equivalent PLC Type | Description
System.UInt32 | uint | - | Longword, Cardinal | UDINT, DWORD |
System.Int32 | int | Integer | Integer, Longint | DINT |
Systen.UInt16 | ushort | - | Word | UINT, WORD |
System.Int16 | short | Short | Smallint | INT |
System.Byte | byte | Byte | Byte | BYTE, USINT |
System.Double | double | Double | Double, Real | LREAL |
System.Single | float | Single | Single | REAL |
System.Bool | bool | Boolean | Boolean | BOOL |
System.SByte | - | - | Shortint | SINT |
1 dimensional arrays of the previous types. |  |  |  |  | Here one does not have to pass the number of elements, because this information is already available in the parameter value.
Classes and structures, that can be marshaled (not possible with the Compact Framework (CE)) |  |  |  |  | Classes are to be favored, as the individual elements can be initialized. This is especially important for array elements.

Because some data types (strings) need additional information, an overload of the method WriteAny exists, that takes an additional parameter args.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.WriteAny Overload List


TcAdsClient.WriteAny Method (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.

public void WriteAny(
intvariableHandle,
objectvalue,
int[]args
);

Parameters

variableHandle
Handle of the ADS variable.
value
Object to write to the ADS device.
args
Additional arguments.

The parameter value is a reference to the object, that should be written to the PLC variable. The type of the object value must be equal to one of the below types.

.NET Type | C# Type | VB Type | Delphi Prism (Oxygene for .NET) Type | Equivalent PLC Type | Description
System.UInt32 | uint | - | Longword, Cardinal | UDINT, DWORD |
System.Int32 | int | Integer | Integer, Longint | DINT |
Systen.UInt16 | ushort | - | Word | UINT, WORD |
System.Int16 | short | Short | Smallint | INT |
System.Byte | byte | Byte | Byte | BYTE, USINT |
System.Double | double | Double | Double, Real | LREAL |
System.Single | float | Single | Single | REAL |
System.Bool | bool | Boolean | Boolean | BOOL |
System.SByte | - | - | Shortint | SINT |
1 dimensional arrays of the previous types. |  |  |  |  | Here one does not have to pass the number of elements, because this information is already available in the parameter value.
System.String | string | String | String | STRING | The length n of the string is passed in the parameter args: args = new Integer(){ n }. If no length is specified in the PLC n must be set to 80
Classes and structures, that can be marshaled (not possible with the Compact Framework (CE)) |  |  |  |  | Classes are to be favored, as the individual elements can be initialized. This is especially important for array elements.

Because some data types (strings) need additional information, an overload of the method WriteAny exists, that takes an additional parameter args.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.WriteAny Overload List


TcAdsClient.WriteAny Method (Int64, Int64, Object)

Writes an object synchronously to an ADS device.

public void WriteAny(
longindexGroup,
longindexOffset,
objectvalue
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
value
Object to write to the ADS device.

The parameter value is a reference to the object, that should be written to the PLC variable. The type of the object value must be equal to one of the below types.

.NET Type | C# Type | VB Type | Delphi Prism (Oxygene for .NET) Type | Equivalent PLC Type | Description
System.UInt32 | uint | - | Longword, Cardinal | UDINT, DWORD |
System.Int32 | int | Integer | Integer, Longint | DINT |
Systen.UInt16 | ushort | - | Word | UINT, WORD |
System.Int16 | short | Short | Smallint | INT |
System.Byte | byte | Byte | Byte | BYTE, USINT |
System.Double | double | Double | Double, Real | LREAL |
System.Single | float | Single | Single | REAL |
System.Bool | bool | Boolean | Boolean | BOOL |
System.SByte | - | - | Shortint | SINT |
1 dimensional arrays of the previous types. |  |  |  |  | Here one does not have to pass the number of elements, because this information is already available in the parameter value.
Classes and structures, that can be marshaled (not possible with the Compact Framework (CE)) |  |  |  |  | Classes are to be favored, as the individual elements can be initialized. This is especially important for array elements.

Because some data types (strings) need additional information, an overload of the method WriteAny exists, that takes an additional parameter args.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.WriteAny Overload List


TcAdsClient.WriteAny Method (Int64, Int64, 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.

public void WriteAny(
longindexGroup,
longindexOffset,
objectvalue,
int[]args
);

Parameters

indexGroup
Contains the index group number of the requested ADS service.
indexOffset
Contains the index offset number of the requested ADS service.
value
Object to write to the ADS device.
args
Additional arguments.

The parameter value is a reference to the object, that should be written to the PLC variable. The type of the object value must be equal to one of the below types.

.NET Type | C# Type | VB Type | Delphi Prism (Oxygene for .NET) Type | Equivalent PLC Type | Description
System.UInt32 | uint | - | Longword, Cardinal | UDINT, DWORD |
System.Int32 | int | Integer | Integer, Longint | DINT |
Systen.UInt16 | ushort | - | Word | UINT, WORD |
System.Int16 | short | Short | Smallint | INT |
System.Byte | byte | Byte | Byte | BYTE, USINT |
System.Double | double | Double | Double, Real | LREAL |
System.Single | float | Single | Single | REAL |
System.Bool | bool | Boolean | Boolean | BOOL |
System.SByte | - | - | Shortint | SINT |
1 dimensional arrays of the previous types. |  |  |  |  | Here one does not have to pass the number of elements, because this information is already available in the parameter value.
System.String | string | String | String | STRING | The length n of the string is passed in the parameter args: args = new Integer(){ n }. If no length is specified in the PLC n must be set to 80
Classes and structures, that can be marshaled (not possible with the Compact Framework (CE)) |  |  |  |  | Classes are to be favored, as the individual elements can be initialized. This is especially important for array elements.

Because some data types (strings) need additional information, an overload of the method WriteAny exists, that takes an additional parameter args.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.WriteAny Overload List


WriteControl Method

TwinCAT.Ads

TcAdsClient.WriteControl

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

Overload List

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

public void WriteControl(StateInfo,AdsStream,int,int);

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

public void WriteControl(StateInfo);

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.WriteControl Method (StateInfo)

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

public void WriteControl(
StateInfostateInfo
);

Parameters

stateInfo
New ADS status and device status.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.WriteControl Overload List


TcAdsClient.WriteControl Method (StateInfo, AdsStream, Int32, Int32)

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

public void WriteControl(
StateInfostateInfo,
AdsStreamdataStream,
intoffset,
intlength
);

Parameters

stateInfo
New ADS status and device status.
dataStream
Stream that contains the data that should be sent to the ADS device
offset
Offset of the data in the stream.
length
Length of the data in the stream.

Exceptions

Exception Type | Condition
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.WriteControl Overload List


WriteSymbol Method

TwinCAT.Ads

TcAdsClient.WriteSymbol

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

Overload List

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

public void WriteSymbol(string,object,bool);

Writes a value to the symbol. Strings and all primitive datatypes(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 datatype of the symbol.

public void WriteSymbol(ITcAdsSymbol,object);

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.WriteSymbol Method (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.

public void WriteSymbol(
stringname,
objectvalue,
boolreloadSymbolInfo
);

Parameters

name
Name of the ADS symbol.
value
Object holding the value to be written to the ADS symbol
reloadSymbolInfo

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.WriteSymbol Overload List


TcAdsClient.WriteSymbol Method (ITcAdsSymbol, Object)

Writes a value to the symbol. Strings and all primitive datatypes(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 datatype of the symbol.

public void WriteSymbol(
ITcAdsSymbolsymbol,
objectval
);

Parameters

symbol
The symbol the value is written to.
val
The value to write.

Exceptions

Exception Type | Condition
AdsDatatypeNotSupportedException | Thrown when a ADS datatype is not supported.
AdsErrorException | Thrown when the ADS call fails.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace | TcAdsClient.WriteSymbol Overload List


TcAdsClient Events

The events of the TcAdsClient class are listed below. For a complete list of TcAdsClient class members, see the TcAdsClient Members topic.

Public Instance Events

AdsNotification | Occurs when the Ads device sends a notification to the client.
AdsNotificationError | Occurs when a exception has occured during notification management.
AdsNotificationEx | Occurs when the Ads devices sends a notification to the client.
AdsStateChanged | Occurs when the ADS state changes.
AdsSymbolVersionChanged | Occurs when the symbol version changes.
AmsRouterNotification | Occurs when the state of the local Router has changed.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.AdsNotification Event

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

public AdsNotificationEventHandler AdsNotification;

Event Data

The event handler receives a AdsNotificationEventArgs containing data related to the AdsNotification event. The following AdsNotificationEventArgs properties provide information specific to this event.

Property | Description
DataStream | Streams that holds the notification data.
Length | Gets the Length of the data in the stream.
NotificationHandle | Gets the handle of the connection.
Offset | Gets the Offset of the data in the stream.
TimeStamp | Gets the timestamp.
UserData | Gets the user object. This object is passed by to AddDeviceNotification and can be used to store data.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.AdsNotificationError Event

Occurs when a exception has occured during notification management.

public AdsNotificationErrorEventHandler AdsNotificationError;

Event Data

The event handler receives a AdsNotificationErrorEventArgs containing data related to the AdsNotificationError event. The following AdsNotificationErrorEventArgs properties provide information specific to this event.

Property | Description
Exception | Exception that was caught while handling notifications.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.AdsNotificationEx Event

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

public AdsNotificationExEventHandler AdsNotificationEx;

Event Data

The event handler receives a AdsNotificationExEventArgs containing data related to the AdsNotificationEx event. The following AdsNotificationExEventArgs properties provide information specific to this event.

Property | Description
NotificationHandle | Gets the handle of the connection.
TimeStamp | Gets the timestamp.
UserData | Gets the user object. This object is passed by to AddDeviceNotification and can be used to store data.
Value | Value of the ads variable.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.AdsStateChanged Event

Occurs when the ADS state changes.

public AdsStateChangedEventHandler AdsStateChanged;

Event Data

The event handler receives a AdsStateChangedEventArgs containing data related to the AdsStateChanged event. The following AdsStateChangedEventArgs properties provide information specific to this event.

Property | Description
State | Current state of the ADS device.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.AdsSymbolVersionChanged Event

Occurs when the symbol version changes.

public EventHandler AdsSymbolVersionChanged;

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsClient.AmsRouterNotification Event

Occurs when the state of the local Router has changed.

public AmsRouterNotificationEventHandler AmsRouterNotification;

Event Data

The event handler receives a AmsRouterNotificationEventArgs containing data related to the AmsRouterNotification event. The following AmsRouterNotificationEventArgs properties provide information specific to this event.

Property | Description
State | Current state of the Ams Router.

See Also

TcAdsClient Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo Class

The class TcAdsSymbolInfo represents a symbol loaded by an instance of the TcAdsSymbolInfoLoader class.

For a list of all members of this type, see TcAdsSymbolInfo Members.

System.Object
TwinCAT.Ads.TcAdsSymbolInfo

public class TcAdsSymbolInfo :

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TcAdsSymbolInfo Members | TwinCAT.Ads Namespace


TcAdsSymbolInfo Members

Public Instance Properties

Comment | Gets the comment behind the variable declaration.
Datatype | Data type of the symbol.
FirstSubSymbol | Gets the next sub symbol of this symbol.
IndexGroup | Gets the index group of the symbol.
IndexOffset | Gets the index offset of the symbol.
Name | Gets the name of the symbol.
NextSymbol | Gets the next sibling of this symbol.
Parent | Gets the parent of this symbol.
ShortName | Gets the name of the symbol (short form without prefixed names of the parents).
Size | Gets the size of the symbol.
SubSymbolCount | Gets the number of sub symbols.
SubSymbols | Gets the sub symbols of this symbol as a collection of TcAdsSymbolInfo objects.
Type | Gets the name of the symbol data type.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo Properties

The properties of the TcAdsSymbolInfo class are listed below. For a complete list of TcAdsSymbolInfo class members, see the TcAdsSymbolInfo Members topic.

Public Instance Properties

Comment | Gets the comment behind the variable declaration.
Datatype | Data type of the symbol.
FirstSubSymbol | Gets the next sub symbol of this symbol.
IndexGroup | Gets the index group of the symbol.
IndexOffset | Gets the index offset of the symbol.
Name | Gets the name of the symbol.
NextSymbol | Gets the next sibling of this symbol.
Parent | Gets the parent of this symbol.
ShortName | Gets the name of the symbol (short form without prefixed names of the parents).
Size | Gets the size of the symbol.
SubSymbolCount | Gets the number of sub symbols.
SubSymbols | Gets the sub symbols of this symbol as a collection of TcAdsSymbolInfo objects.
Type | Gets the name of the symbol data type.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.Comment Property

Gets the comment behind the variable declaration.

public string Comment { get;}

Property Value

Comment behind the variable declaration.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.Datatype Property

Data type of the symbol.

public AdsDatatypeId Datatype { get;}

Property Value

Data type of the symbol.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.FirstSubSymbol Property

Gets the next sub symbol of this symbol.

public TcAdsSymbolInfo FirstSubSymbol {get;}

Property Value

Next sub symbol.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.IndexGroup Property

Gets the index group of the symbol.

public long IndexGroup { get;}

Property Value

Index group of the symbol.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.IndexOffset Property

Gets the index offset of the symbol.

public long IndexOffset { get;}

Property Value

Index offset of the symbol.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.Name Property

Gets the name of the symbol.

public string Name { get;}

Property Value

Name of the symbol.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.NextSymbol Property

Gets the next sibling of this symbol.

public TcAdsSymbolInfo NextSymbol {get;}

Property Value

Next sibling of this symbol.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.Parent Property

Gets the parent of this symbol.

public TcAdsSymbolInfo Parent {get;}

Property Value

Parent of this symbol

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.ShortName Property

Gets the name of the symbol (short form without prefixed names of the parents).

public string ShortName {get;}

Property Value

Full name of the symbol.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.Size Property

Gets the size of the symbol.

public int Size { get;}

Property Value

Size of the symbol.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.SubSymbolCount Property

Gets the number of sub symbols.

public int SubSymbolCount {get;}

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.SubSymbols Property

Gets the sub symbols of this symbol as a collection of TcAdsSymbolInfo objects.

public TcAdsSymbolInfoCollection SubSymbols {get;}

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfo.Type Property

Gets the name of the symbol data type.

public string Type { get;}

Property Value

Name of the symbol data type.

See Also

TcAdsSymbolInfo Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoCollection Class

Represents a collection of TcAdsSymbolInfo objects.

For a list of all members of this type, see TcAdsSymbolInfoCollection Members.

System.Object
TwinCAT.Ads.TcAdsSymbolInfoCollection

public class TcAdsSymbolInfoCollection : ,

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TcAdsSymbolInfoCollection Members | TwinCAT.Ads Namespace


TcAdsSymbolInfoCollection Members

Public Instance Properties

Count | Gets the number of elements contained in the collection.
IsSynchronized | Gets a value indicating whether access to the collection is synchronized (thread-safe).
Item | Gets the element at the specified index.
SyncRoot | Gets an object that can be used to synchronize access to the collection.

Public Instance Methods

CopyTo | Copies the elements of the collection to an Array, starting at a particular Array index.
Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetEnumerator | Returns an enumerator that can iterate through ths symbols in this collection.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

TcAdsSymbolInfoCollection Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoCollection Properties

The properties of the TcAdsSymbolInfoCollection class are listed below. For a complete list of TcAdsSymbolInfoCollection class members, see the TcAdsSymbolInfoCollection Members topic.

Public Instance Properties

Count | Gets the number of elements contained in the collection.
IsSynchronized | Gets a value indicating whether access to the collection is synchronized (thread-safe).
Item | Gets the element at the specified index.
SyncRoot | Gets an object that can be used to synchronize access to the collection.

See Also

TcAdsSymbolInfoCollection Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoCollection.Count Property

Gets the number of elements contained in the collection.

public int Count {virtual get;}

See Also

TcAdsSymbolInfoCollection Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoCollection.IsSynchronized Property

Gets a value indicating whether access to the collection is synchronized (thread-safe).

public bool IsSynchronized {virtual get;}

See Also

TcAdsSymbolInfoCollection Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoCollection.Item Property

Gets the element at the specified index.

public TcAdsSymbolInfo this[
   int index
] {get;}

See Also

TcAdsSymbolInfoCollection Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoCollection.SyncRoot Property

Gets an object that can be used to synchronize access to the collection.

public object SyncRoot {virtual get;}

See Also

TcAdsSymbolInfoCollection Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoCollection Methods

The methods of the TcAdsSymbolInfoCollection class are listed below. For a complete list of TcAdsSymbolInfoCollection class members, see the TcAdsSymbolInfoCollection Members topic.

Public Instance Methods

CopyTo | Copies the elements of the collection to an Array, starting at a particular Array index.
Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetEnumerator | Returns an enumerator that can iterate through ths symbols in this collection.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

TcAdsSymbolInfoCollection Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoCollection.CopyTo Method

Copies the elements of the collection to an Array, starting at a particular Array index.

public virtual void CopyTo(
Arrayarray,
intindex
);

Parameters

array
The one-dimensional Array that is the destination of the elements copied from the collection. The Array must have zero-based indexing.
index
The zero-based index in array at which copying begins.

See Also

TcAdsSymbolInfoCollection Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoCollection.GetEnumerator Method

Returns an enumerator that can iterate through ths symbols in this collection.

public virtual IEnumerator GetEnumerator();

Return Value

An IEnumerator that can be used to iterate through all symbols in this collection.

See Also

TcAdsSymbolInfoCollection Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoLoader Class

The class TcAdsSymbolInfoLoader is responsible for downloading the list of declared variables from an ADS Server.

For a list of all members of this type, see TcAdsSymbolInfoLoader Members.

System.Object
TwinCAT.Ads.TcAdsSymbolInfoLoader

public class TcAdsSymbolInfoLoader :

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Requirements

Namespace: TwinCAT.Ads

Assembly: TwinCAT.Ads (in TwinCAT.Ads.dll)

See Also

TcAdsSymbolInfoLoader Members | TwinCAT.Ads Namespace


TcAdsSymbolInfoLoader Members

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
FindSymbol | Call this method to find a symbol in the list.
GetEnumerator | Returns an enumerator that can iterate through all symbols.
GetFirstSymbol | Call this method to get the first symbol.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetSymbolCount | Call this method to get the number of declared symbols.
GetSymbols | Loads the declared symbols from the ADS device and returns them as a collection of TcAdsSymbolInfo objects.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

TcAdsSymbolInfoLoader Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoLoader Methods

The methods of the TcAdsSymbolInfoLoader class are listed below. For a complete list of TcAdsSymbolInfoLoader class members, see the TcAdsSymbolInfoLoader Members topic.

Public Instance Methods

Equals (inherited from Object) | Select the method name to go to the Microsoft documentation.
FindSymbol | Call this method to find a symbol in the list.
GetEnumerator | Returns an enumerator that can iterate through all symbols.
GetFirstSymbol | Call this method to get the first symbol.
GetHashCode (inherited from Object) | Select the method name to go to the Microsoft documentation.
GetSymbolCount | Call this method to get the number of declared symbols.
GetSymbols | Loads the declared symbols from the ADS device and returns them as a collection of TcAdsSymbolInfo objects.
GetType (inherited from Object) | Select the method name to go to the Microsoft documentation.
ToString (inherited from Object) | Select the method name to go to the Microsoft documentation.

See Also

TcAdsSymbolInfoLoader Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoLoader.FindSymbol Method

Call this method to find a symbol in the list.

public TcAdsSymbolInfo FindSymbol(
stringname
);

Parameters

name
Name of the symbol

Remarks

If no symbols have been loaded before, the symbols are loaded from the server, regardless of the parameter forceReload.

Note about the PLC: Please attend to the PLC Control that the 'Symbol-Download' under Project / Options / TwinCAT is activated. For further information please see the manual TwinCAT PLC Control.

Note about NC: The Symbol download has to be activated at each axis. This can de done in the configuration dialog of the axis under General'. The field Create Symbols' has to be marked. See manual of the TwinCAT System Manager.

See Also

TcAdsSymbolInfoLoader Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoLoader.GetEnumerator Method

Returns an enumerator that can iterate through all symbols.

public virtual IEnumerator GetEnumerator();

Return Value

An IEnumerator that can be used to iterate through all symbols.

See Also

TcAdsSymbolInfoLoader Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoLoader.GetFirstSymbol Method

Call this method to get the first symbol.

public TcAdsSymbolInfo GetFirstSymbol(
boolforceReload
);

Parameters

forceReload
True, if a (new) loading of the symbol information from the server is required.

Return Value

Returns the first symbol or null if no symbols are available.

Remarks

If no symbols have been loaded before, the symbols are loaded from the server, regardless of the parameter forceReload. Note about the PLC: Please attend to the PLC Control that the 'Symbol-Download' under Project / Options / TwinCAT is activated. For further information please see the manual TwinCAT PLC Control. Note about NC: The Symbol download has to be activated at each axis. This can de done in the configuration dialog of the axis under General'. The field Create Symbols' has to be marked. See manual of the TwinCAT System Manager.

See Also

TcAdsSymbolInfoLoader Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoLoader.GetSymbolCount Method

Call this method to get the number of declared symbols.

public int GetSymbolCount(
boolforceReload
);

Parameters

forceReload
True, if a (new) loading of the symbol information from the server is required.

Return Value

Returns the number of symbols.

Remarks

If no symbols have been loaded before, the symbols are loaded from the server, regardless of the parameter forceReload. Note about the PLC: Please attend to the PLC Control that the 'Symbol-Download' under Project / Options / TwinCAT is activated. For further information please see the manual TwinCAT PLC Control. Note about NC: The Symbol download has to be activated at each axis. This can de done in the configuration dialog of the axis under General'. The field Create Symbols' has to be marked. See manual of the TwinCAT System Manager.

See Also

TcAdsSymbolInfoLoader Class | TwinCAT.Ads Namespace


TcAdsSymbolInfoLoader.GetSymbols Method

Loads the declared symbols from the ADS device and returns them as a collection of TcAdsSymbolInfo objects.

public TcAdsSymbolInfoCollection GetSymbols(
boolforceReload
);

Parameters

forceReload
True, if a (new) loading of the symbol information from the server is required.

Return Value

A collection of TcAdsSymbolInfo objects

Remarks

If no symbols have been loaded before, the symbols are loaded from the server, regardless of the parameter forceReload.

Note about the PLC: Please attend to the PLC Control that the 'Symbol-Download' under Project / Options / TwinCAT is activated. For further information please see the manual TwinCAT PLC Control.

Note about NC: The Symbol download has to be activated at each axis. This can de done in the configuration dialog of the axis under General'. The field Create Symbols' has to be marked. See manual of the TwinCAT System Manager.

See Also

TcAdsSymbolInfoLoader Class | TwinCAT.Ads Namespace