Close-TcSession

SYNOPSIS

Closes the specified session.

SYNTAX

Default (Default)

Close-TcSession -Id <Int32> [-ProgressAction <ActionPreference>] [<CommonParameters>]

Session

Close-TcSession -InputObject <ISession> [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

This Cmdlet closes the specified Point-To-Point Connection to the TwinCAT Target that is represented by the returned session object.

All registered SessionProvider types of Sessions can be used here.

If using ADS as protocol, this Cmdlet is equivalent to Close/Dispose/Disconnect an ADS Client.

EXAMPLES

EXAMPLE 1

PS> $session = New-TcSession -NetId '1.2.3.4.1.1' -port 851
PS> $session | Get-AdsState

Name    State  OK   Time (ms) Address
----    -----  --   --------- -------
CX_1234 Config True 3         1.2.3.4.1.1:10000

PS> $session | Close-TcSession

Opens a session to the registered route with AmsNetId: 1.2.3.4.1.1 and closes the ADS Session again.:

PARAMETERS

-Id

The session object to close is specified by this session ID.

Type: Int32
Parameter Sets: Default
Aliases:

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

-InputObject

The Session object to close.

Type: ISession
Parameter Sets: Session
Aliases: Session

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
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

TwinCAT.ISession

The Session object to close.

OUTPUTS

NOTES