AmsNetId.IsSameTarget Method (AmsNetId, AmsNetId, Boolean)

Determines whether the AmsNetIds refer to the same target.

Namespace:  TwinCAT.Ads
Assembly:  TwinCAT.Ads.Abstractions (in TwinCAT.Ads.Abstractions.dll) Version: 6.0.328+39e3229

Syntax

C#

public static bool IsSameTarget(
    AmsNetId netIDA,
    AmsNetId netIDB,
    bool ignoreSubId
)

Parameters

netIDA

Type: TwinCAT.Ads.AmsNetId
NetID of target system A

netIDB

Type: TwinCAT.Ads.AmsNetId
NetID of target system B

ignoreSubId

Type: System.Boolean
Indicates only to check the 4 parts of the address (for SubId check).

Return Value

Type: Boolean
true if the target systems are the same, otherwise false.

Exceptions

Exception

Condition

ArgumentNullException

netIDA

ArgumentNullException

netIDB

Remarks

In comparison to the Equals(Object) or Equals(AmsNetId, AmsNetId) methods, this Method alse checks against the LocalHost ID, which means that LocalHost is the same target as Local

Reference

AmsNetId Class

IsSameTarget Overload

TwinCAT.Ads Namespace

AmsNetId.Equals(Object)

AmsNetId.Equals(AmsNetId, AmsNetId)