Get-AdsRoute

SYNOPSIS

List routes on a TwinCAT System / Broadcast search.

SYNTAX

GetRoutes (Default)

Get-AdsRoute [-BroadcastTimeout <Int32>] [[-Address] <String[]>] [-InputObject <IRoute>]
 [-Access <RouteAccessType>] [-Force] [-ProgressAction <ActionPreference>] [<CommonParameters>]

Broadcast

Get-AdsRoute [-All] [-BroadcastTimeout <Int32>] [-NetAdapter <String[]>] [[-Address] <String[]>]
 [-InputObject <IRoute>] [-Force] [-ProgressAction <ActionPreference>] [<CommonParameters>]

LocalSystem

Get-AdsRoute [-InputObject <IRoute>] [-Local] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

This Cmdlet can list the routes configured on a TwinCAT local/remote system, or start determining all TwinCAT Systems within the current subnet.

EXAMPLES

EXAMPLE 1

PS> Get-AdsRoute
  
Name            NetId             Address       Sub TcVersion   RTSystem
----            -----             -------       --- ---------   ---------
CP-15ECA0       172.17.62.128.1.1 172.17.62.178     [UNKNOWN]   [UNKNOWN]
CP-15ECA1       172.17.62.105.1.1 172.17.62.105     [UNKNOWN]   [UNKNOWN]

Lists all registered local routes.

Because only the local port 10000 is addressed, the TcVersion and RTSystem is unknown (the Cmdlet doesn't contact the targets and doesn't produce additional roundtrips.

EXAMPLE 2

PS> get-AdsRoute -All
Name            NetId               Address       Sub Version   RTSystem
----            -----               -------       --- -------   --------
CX-1CEEDA       5.16.136.222.1.1    172.17.62.139     3.1.4020  Win7
CX-20BC62       5.32.188.98.1.1     172.17.62.90      3.1.4020  CE6.0
CX-10A87B       5.16.168.123.1.1    172.17.62.140     2.11.2254 CE7.0
CP-15ECA0       172.17.62.128.1.1   172.17.62.178     3.1.4021  Win7
CX-0A7F60       5.10.127.96.1.1     172.17.62.148     3.1.4020  XP
CX2030-B4018    172.17.60.157.1.1   172.17.60.159     2.11.2256 Win7
CP_11BB16       5.17.187.22.1.1     172.17.60.180     2.11.2038 CE6.0
CX-128CE5       172.17.60.165.1.1   172.17.62.191     2.11.2237 CE7.0
CX-124218       5.18.66.24.1.1      172.17.60.192     3.1.4021  Win7
CX-1D82AA       172.17.62.180.1.1   172.17.62.180     3.1.4021  Win8
CX_0AB4F0       5.10.180.240.1.1    172.17.60.195     2.11.2243 XP
CP-1DFA0A       172.17.62.118.1.1   172.17.62.118     3.1.4021  Win7
CX-AF0001       172.17.62.75.1.1    172.17.62.70      3.1.4020  Win10

Start a Broadcast search from the local system and lists the devices within the connected network.

EXAMPLE 3

PS> Get-AdsRoute -Name "Tc3*"
 
 Name            NetId             Address       Sub Version RTSystem
----            -----             -------       --- ------- --------
TC3TESTA1-CP67X 172.17.62.105.1.1 172.17.62.105     0.0     Unknown

Get the (actual) route assigned to the local system that has the name pattern "Tc3*"

EXAMPLE 4

PS> Get-AdsRoute -All | where TcVersion -lt "3.1.0.0"
Name            NetId              Address       Sub Version   RTSystem
----            -----              -------       --- -------   --------
TC3Test17-C6930 172.17.62.98.1.1   172.17.62.98      2.11.2234 Win7
CX2030-B4018    172.17.60.157.1.1  172.17.60.159     2.11.2256 Win7
CX-10A87B       5.16.168.123.1.1   172.17.62.140     2.11.2254 CE7.0
TC3Test13-C6650 172.17.60.239.1.1  172.17.62.156     2.11.2246 Win7
ECATTest01      172.17.61.6.1.1    172.17.61.31      2.11.2239 Win7
CX-128CE5       172.17.60.165.1.1  172.17.62.191     2.11.2237 CE7.0
CX_0AB4F0       5.10.180.240.1.1   172.17.60.195     2.11.2243 XP
CP_11BB16       5.17.187.22.1.1    172.17.60.180     2.11.2038 CE6.0

Find out all TwinCAT Systems within the network with Version numbers lower than '3.1.0.0'

EXAMPLE 5

PS> $runningAdaptors = @(get-netadapter | Where-Object -Property Status -eq Up)

PS> get-AdsRoute -all -NetAdapterName $runningAdaptors[0].Name -verbose

VERBOSE: Broadcast search from system 'CX_11111' ...
VERBOSE: Broadcasting over the Network Adapter(s) 'Ethernet 1'

Name         NetId                Protocol   TLS   Address          FingerPrint
----         -----                --------   ---   -------          -----------
CX_22222     192.168.0.2.1.1      TcpIP      X     192.168.0.2      xxxxxxxxxxx

VERBOSE: Broadcast search finished. Found '1' route(s)

Determines the first active Network adapter for broadcasting and returns the found targets.

PARAMETERS

-All

Broadcast switch.

If activated a broadcast search is triggered within the local network.

The search can be constrained additionally by the -Address/-Name parameter.

Searching by Address (direct access of targets if no wildcards, otherwise using Broadcast search): - HostName: Searching the target by dns resolution and then via IP (fallback broadcast search filtering DeviceName/Hostname, not working over subnets!) - IPAddress: Directly accessing via IP (works also over subnets) - AmsNetId: Working via Broadcast search (not working over subnet segments!) Searching by Name: Works always via Broadcast search, wildcards permitted

Type: SwitchParameter
Parameter Sets: Broadcast
Aliases: Broadcast

Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-BroadcastTimeout

(Broadcast) Search Timeout in Seconds (Default 0 Seconds) 0 Seconds means that the Length of the search operation will be determined dynamically.

If for a longer period no targets are arriving.

Type: Int32
Parameter Sets: GetRoutes, Broadcast
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-NetAdapter

The Network adapter name of the NetworkAdapter to use.

By default e.g.

Broadcast searches go out via all active Network adapters.

This parameter can be use to restrict this.

Type: String[]
Parameter Sets: Broadcast
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Address

The Name / Address of the route to get.

The address of the route can be coded as NetId, the HostName or the IPAddress in string representation.

Wildcards are permitted.

Type: String[]
Parameter Sets: GetRoutes, Broadcast
Aliases: Name

Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: True

-InputObject

The Destination address specifies the target, where the the routes are determined.

Use this to get the registered routes of a remote system.

The Destination system can be specified by RouteName (route name on local system), AmsNetId, IPAddress or HostName

Type: IRoute
Parameter Sets: (All)
Aliases: Destination

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Access

Defines the strategy how to get the remote routes.

Valid methods are 'Merged', 'Actual', 'Configuration', 'Registry'.

The default value is 'Default' / 'Merged'

Possible values: None, Actual, Registry, Configured, Merged, Default

Type: RouteAccessType
Parameter Sets: GetRoutes
Aliases:
Accepted values: None, Actual, Registry, Configured, Merged, Default

Required: False
Position: Named
Default value: Merged
Accept pipeline input: False
Accept wildcard characters: False

-Local

If set, the local system route will be returned.

By default a list of the actual registered routes will be returned.

Type: SwitchParameter
Parameter Sets: LocalSystem
Aliases: Self

Required: True
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Force

If set, the broadcast search won't use cached routes.

The Route will be determined by broadcast always.

Only available with the -All parameter.

Type: SwitchParameter
Parameter Sets: GetRoutes, Broadcast
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES