Get-AdsState

SYNOPSIS

Gets the Ads State of a TwinCAT Target.

SYNTAX

NetIdPort (Default)

Get-AdsState [[-NetId] <AmsNetId[]>] [[-Port] <Int32>] [-Quiet] [-StateOnly] [-Force] [-Timeout <Int32>]
 [-Count <Int32>] [-Delay <Int32>] [<CommonParameters>]

AddressStr

Get-AdsState [[-Port] <Int32>] [[-Address] <String[]>] [-Quiet] [-StateOnly] [-Force] [-Timeout <Int32>]
 [-Count <Int32>] [-Delay <Int32>] [<CommonParameters>]

Session

Get-AdsState [[-Port] <Int32>] -Session <ISession[]> [-Quiet] [-StateOnly] [-Force] [-Timeout <Int32>]
 [-Count <Int32>] [-Delay <Int32>] [<CommonParameters>]

SessionId

Get-AdsState [[-Port] <Int32>] -SessionId <Int32[]> [-Quiet] [-StateOnly] [-Force] [-Timeout <Int32>]
 [-Count <Int32>] [-Delay <Int32>] [<CommonParameters>]

Route

Get-AdsState [[-Port] <Int32>] [-InputObject] <IRoute[]> [-Quiet] [-StateOnly] [-Force] [-Timeout <Int32>]
 [-Count <Int32>] [-Delay <Int32>] [<CommonParameters>]

DESCRIPTION

This command let gets the ADS state of a TwinCAT target.

EXAMPLES

Example 1

PS > Get-AdsState 1.2.3.4.5.6

Name   State  OK   Time (ms) Address
----   -----  --   --------- -------
WORK01 Config True 0         1.2.3.4.5.6

Gets the actual AdsState from the remote target with NetId 1.2.3.4.5.6.

Example 2

PS> Get-AdsState

Name   State  OK   Time (ms) Address
----   -----  --   --------- -------
WORK01 Config True 0         1.2.3.4.5.6

Gets the actual AdsState from the Local system.

Example 3

PS> Get-AdsState 1.2.3.4,CX_0130C7

Gets the AdsState of target system with IPAddress 1.2.3.4 and Route name 'CX_0130C7'.

Example 4

PS> get-route | get-adsState

Name      State  OK   Time (ms) Address
----      -----  --   --------- -------
WORK01    Config True 0         1.2.3.4.5.6
CX_0130C7 Config True 0         5.1.48.199.1.1

Get the current target state from all registered routes.

Example 5

PS> get-adsroute | get-adsstate -port 10000 -stateOnly
Invalid
Config

Gets the AdsState information from all actual routes.

Example 6

PS> get-adsroute | get-adsstate -port 10000 -quiet
false
true

Gets availability information from all actual routes.

PARAMETERS

-NetId

The Addresses of the target systems, where to get the AdsState. Tab completion: Completes AmsNetId values from currently reachable routes on the local TwinCAT system. The NetId. Null is not a valid value for the NetId parameter!

Type: AmsNetId[]
Parameter Sets: NetIdPort
Aliases:

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

-Port

The AmsPort of the target system. Tab completion: Completes well-known ADS port numbers and names (e.g., 851/Plc1, 10000/SystemService). The port.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: 10000
Accept pipeline input: False
Accept wildcard characters: False

-Address

The address(es) where to get the State. This can be the RouteName, NetId, the HostName or the IPAddress. Wildcards are permitted. Tab completion: Completes route names from currently reachable ADS systems on the local TwinCAT system. The address.

Type: String[]
Parameter Sets: AddressStr
Aliases:

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

-Session

The Session to use for the Cmdlet. The address.

Type: ISession[]
Parameter Sets: Session
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-SessionId

Specifies the Session (with unique ID) to use for the Cmdlet. Tab completion: Completes IDs of active TwinCAT sessions (created with New-TcSession). The Session ID.

Type: Int32[]
Parameter Sets: SessionId
Aliases:

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

-InputObject

The target systems, where to get the AdsState from. Tab completion: Completes route names from currently reachable ADS systems on the local TwinCAT system. The route.

Type: IRoute[]
Parameter Sets: Route
Aliases: Destination,Route

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Quiet

The quiet mode The Quiet flag accumulates all States and returns a single boolean value if the target is available.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-StateOnly

The StateOnly mode Instead of returning RouteStateInfo objects, the simple AdsState is returned for each requested address.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Force

Forced Mode Forces to read the state independant of 'lost' communication states (without 'FailFast' inception)

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Timeout

The communication ADS timeout in milliseconds. A value of 0 disables the timeout. A value <= 0 sets the Default (5000 ms). The ADS communication timeout in milliseconds.

Type: Int32
Parameter Sets: (All)
Aliases:

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

-Count

Specifies the number of state requests to send. The default value is 1. The number of AdsState request repeats.

Type: Int32
Parameter Sets: (All)
Aliases:

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

-Delay

Specifies the interval between AdsState requests, in seconds. This is used only in combination with the 'Count' parameter. The default value is 1 Second. The Delay time between Tests/pings in seconds/

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 1
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

TwinCAT.ISession[]

TwinCAT.IRoute[]

OUTPUTS

NOTES