Unregister-AdsHandle

SYNOPSIS

Unregisters a symbol handle.

SYNTAX

NetIdPortHandle (Default)

Unregister-AdsHandle [-NetId <AmsNetId>] -Port <Int32> [-Handle] <UInt32[]>
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

NetIdPortInfo

Unregister-AdsHandle [-NetId <AmsNetId>] -Port <Int32> [-InputObject] <AdsHandleInfo[]>
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

RouteHandle

Unregister-AdsHandle -Route <IRoute> -Port <Int32> [-Handle] <UInt32[]> [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

RouteInfo

Unregister-AdsHandle -Route <IRoute> -Port <Int32> [-InputObject] <AdsHandleInfo[]>
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

AddressHandle

Unregister-AdsHandle -Address <String> -Port <Int32> [-Handle] <UInt32[]> [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

AddressInfo

Unregister-AdsHandle -Address <String> -Port <Int32> [-InputObject] <AdsHandleInfo[]>
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

SessionHandle

Unregister-AdsHandle -Session <ISession> [-Handle] <UInt32[]> [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

SessionInfo

Unregister-AdsHandle -Session <ISession> [-InputObject] <AdsHandleInfo[]> [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

SessionIdHandle

Unregister-AdsHandle -SessionId <Int32> [-Handle] <UInt32[]> [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

SessionIdInfo

Unregister-AdsHandle -SessionId <Int32> [-InputObject] <AdsHandleInfo[]> [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

This Cmdlet unregisters an already registered symbol handle from the target system.

The Cmdlet supports raw \[uint\] handles or AdsHandleInfo objects.

EXAMPLES

EXAMPLE 1

PS> $session = New-TcSession -NetId '1.2.3.4.5.6' -Port 851
PS> $handleInfo = $session | get-AdsHandle -Path 'TwinCAT_SystemInfoVarList._AppInfo.ProjectName'
PS> $handleInfo = register-AdsHandle -Path 'TwinCAT_SystemInfoVarList._AppInfo.ProjectName' -Session $s
PS> $handleInfo

InstancePath                                   Result Handle
------------                                   ------  ------
TwinCAT_SystemInfoVarList._AppInfo.ProjectName NoError 0x428000FC (1115685116)

PS> Read-TcValue -Session $session -IndexGroup SymbolValueByHandle -IndexOffset $handleInfo.Handle -Type String

MyProject

PS> $handle | Unregister-AdsHandle -Session $session
PS> $session | Close-tcsession

Opens a new device session, registers a Symbol Handle to the ProjectName of the running PLC Project, Reads the value by handle unregisters the handle and closes the session again.

PARAMETERS

-NetId

The NetId part of the device target address.

Type: AmsNetId
Parameter Sets: NetIdPortHandle, NetIdPortInfo
Aliases:

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

-Route

Specifies the target system.

Type: IRoute
Parameter Sets: RouteHandle, RouteInfo
Aliases: Destination

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

-Address

The target address of the system.

The Address can consist of RouteName, NetId, IPAddress or HostName.

Wildcards are permitted and ArgumentCompleter is supported.

Type: String
Parameter Sets: AddressHandle, AddressInfo
Aliases:

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

-Session

The Session object (instead of specifieng the target system address).

Type: ISession
Parameter Sets: SessionHandle, SessionInfo
Aliases:

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

-SessionId

Specifies the Session (with unique ID) to use (instead of specifying the address).

Type: Int32
Parameter Sets: SessionIdHandle, SessionIdInfo
Aliases:

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

-Port

The address Port to use.

ClearText names for the Port and ArgumentCompleter are supported.

Type: Int32
Parameter Sets: NetIdPortHandle, NetIdPortInfo, RouteHandle, RouteInfo, AddressHandle, AddressInfo
Aliases:

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

-Handle

The instance path of the symbol to read (symbolic access).

This parameter supports wildcards.

Type: UInt32[]
Parameter Sets: NetIdPortHandle, RouteHandle, AddressHandle, SessionHandle, SessionIdHandle
Aliases:

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

-InputObject

The AdsHandleInfo object (produced by Register-AdsHandle Cmdlet)

Type: AdsHandleInfo[]
Parameter Sets: NetIdPortInfo, RouteInfo, AddressInfo, SessionInfo, SessionIdInfo
Aliases: HandleInfo

Required: True
Position: 1
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 (instead of specifieng the target system address).

TwinCAT.Management.Automation.AdsHandleInfo[]

The AdsHandleInfo object (produced by Register-AdsHandle Cmdlet)

OUTPUTS

NOTES