AmsNetId Class

Class representing an Address in the TwinCAT System (AMS/ADS Net ID).

Inheritance Hierarchy

SystemObject
  TwinCAT.AdsAmsNetId

Namespace: TwinCAT.Ads
Assembly: TwinCAT.Ads.Abstractions (in TwinCAT.Ads.Abstractions.dll) Version: 7.0.0+e56d35ccc4675faac24789a4aab60071fc61d470

Syntax

C#

[SerializableAttribute]
public class AmsNetId : IComparable<AmsNetId>, 
    IComparable

The AmsNetId type exposes the following members.

Constructors

 

Name

Description

AmsNetId Class 1:

AmsNetId(AmsNetId)

Copy Constructor

AmsNetId Class 2:

AmsNetId(Byte)

Constructor

AmsNetId Class 3:

AmsNetId(ReadOnlySpanByte)

Initializes a new instance of the AmsNetId class from Memory.

AmsNetId Class 4:

AmsNetId(String)

Constructor

Properties

 

Name

Description

AmsNetId Class 5:

AmsNetId Class 6:

Broadcast

Gets the broadcast address (255.255.255.255.255.255)

AmsNetId Class 7:

AmsNetId Class 8:

Empty

Creates an empty NetId ("0.0.0.0.0.0")

AmsNetId Class 9:

IsBroadcast

Gets a value indicating whether this AmsNetId is the broadcast address (255.255.255.255.255.255)

AmsNetId Class 10:

IsEmpty

Gets a value indicating whether this instance is empty / Uninitialized (AmsNetId: 0.0.0.0.0.0)

AmsNetId Class 11:

IsLocal

Determines, whether the AmsNetId is the Address of the local system (or the LocalHost address).

AmsNetId Class 12:

IsLoopback

Indicates, that this AmsNetId indicates a Loopback (ID: 127.0.0.1.X.X)

AmsNetId Class 13:

IsSubAddress

Gets a value indicating whether this AmsNetId indicates a SubNet.

AmsNetId Class 14:

IsValidRemote

Gets a value indicating whether this AmsNetId is a valid remote.

AmsNetId Class 15:

Item

Gets or sets the Byte with the specified index.

AmsNetId Class 16:

AmsNetId Class 17:

Local

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

AmsNetId Class 18:

AmsNetId Class 19:

LocalHost

Creates the local NetId ("127.0.0.1.1.1")

Methods

 

Name

Description

AmsNetId Class 20:

AsSpan

Returns the AmsNetId as byte Span.

AmsNetId Class 21:

ChangeSubAddress(Byte, Byte)

Creates a new AmsNetId from an existing one with changed SubNet IDs

AmsNetId Class 22:

AmsNetId Class 23:

ChangeSubAddress(AmsNetId, Byte, Byte)

Creates a new AmsNetId from an existing one with changed SubNet IDs

AmsNetId Class 24:

Clone

Clones the NetId

AmsNetId Class 25:

CompareTo(AmsNetId)

Compares the current object with another object of the same type.

AmsNetId Class 26:

CompareTo(Object)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

AmsNetId Class 27:

Equals(Object)

Equals
(Overrides ObjectEquals(Object))

AmsNetId Class 28:

AmsNetId Class 29:

Equals(AmsNetId, AmsNetId)

Determines whether the specified AmsNetIds are equal.

AmsNetId Class 30:

Finalize

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)

AmsNetId Class 31:

AmsNetId Class 32:

FromBinHexString

Creates the AmsNetId from bin hex string.

AmsNetId Class 33:

GetHashCode

Gets the HashCode of the Address
(Overrides ObjectGetHashCode)

AmsNetId Class 34:

GetType

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

AmsNetId Class 35:

IsSameTarget(AmsNetId)

Determines whether the AmsNetIds refer to the same target.

AmsNetId Class 36:

IsSameTarget(AmsNetId, Boolean)

Determines whether the AmsNetIds refer to the same target.

AmsNetId Class 37:

AmsNetId Class 38:

IsSameTarget(AmsNetId, AmsNetId)

Determines whether the AmsNetIds refer to the same target.

AmsNetId Class 39:

AmsNetId Class 40:

IsSameTarget(AmsNetId, AmsNetId, Boolean)

Determines whether the AmsNetIds refer to the same target.

AmsNetId Class 41:

MemberwiseClone

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

AmsNetId Class 42:

NetIdsEqual(Byte)

Compares the netIds

AmsNetId Class 43:

AmsNetId Class 44:

NetIdsEqual(Byte, Byte)

Compares the NetIds

AmsNetId Class 45:

AmsNetId Class 46:

NetIdsEqual(Byte, Byte, Boolean)

Compares the NetIds for SubID equality.

AmsNetId Class 47:

AmsNetId Class 48:

Parse

Converts the string representation of the address to AmsNetId.

AmsNetId Class 49:

ToBinHex

Converts the AmsNetId to a BinHex string.

AmsNetId Class 50:

AmsNetId Class 51:

ToBinHex(AmsNetId)

Converts the specified AmsNetId to a BinHex string.

AmsNetId Class 52:

ToBytes

Converts the NetId object to byte array

AmsNetId Class 53:

ToString

Converts the netId to string
(Overrides ObjectToString)

AmsNetId Class 54:

ToString(String, IFormatProvider)

Returns a String that represents this instance.

AmsNetId Class 55:

AmsNetId Class 56:

TryGetLocalNetId

Gets the Local NetID

AmsNetId Class 57:

AmsNetId Class 58:

TryParse

Converts the string representation of the address to AmsNetId.

AmsNetId Class 59:

TryWriteBytes

Writes the AmsNetId to memory.

Operators

 

Name

Description

AmsNetId Class 60:

AmsNetId Class 61:

Equality(AmsNetId, AmsNetId)

Operator==

AmsNetId Class 62:

AmsNetId Class 63:

Inequality(AmsNetId, AmsNetId)

Implements the != operator.

Remarks

This class is immutable - once created the AmsNetId cannot change. Digits 5 and 6 of the NetId (last 2 bytes) are the SubNet IDs, which are used for local addressing (e.g. to address a specific submodule of a system). The first 4 digits (first 4 bytes) indicate the global ID of the AmsNetId. The SubNet IDs are ignored for comparison and local/remote checks, what means that AmsNetIds with different SubNet IDs but same global ID are considered equal in this context. This also means that the local system can have multiple AmsNetIds, which differ only in the SubNet IDs, but all refer to the same local system.

Reference

TwinCAT.Ads Namespace

Beckhoff Automation GmbH & Co. KG 2001-2026