Unregister-AdsHandle
SYNOPSIS
Unregisters a symbol handle.
SYNTAX
NetIdPortHandle (Default)
Unregister-AdsHandle [-NetId <AmsNetId>] -Port <Int32> [-Handle] <UInt32[]>
[<CommonParameters>]
NetIdPortInfo
Unregister-AdsHandle [-NetId <AmsNetId>] -Port <Int32> [-InputObject] <AdsHandleInfo[]>
[<CommonParameters>]
RouteHandle
Unregister-AdsHandle -Route <IRoute> -Port <Int32> [-Handle] <UInt32[]>
[<CommonParameters>]
RouteInfo
Unregister-AdsHandle -Route <IRoute> -Port <Int32> [-InputObject] <AdsHandleInfo[]>
[<CommonParameters>]
AddressHandle
Unregister-AdsHandle -Address <String> -Port <Int32> [-Handle] <UInt32[]>
[<CommonParameters>]
AddressInfo
Unregister-AdsHandle -Address <String> -Port <Int32> [-InputObject] <AdsHandleInfo[]>
[<CommonParameters>]
SessionHandle
Unregister-AdsHandle -Session <ISession> [-Handle] <UInt32[]>
[<CommonParameters>]
SessionInfo
Unregister-AdsHandle -Session <ISession> [-InputObject] <AdsHandleInfo[]>
[<CommonParameters>]
SessionIdHandle
Unregister-AdsHandle -SessionId <Int32> [-Handle] <UInt32[]>
[<CommonParameters>]
SessionIdInfo
Unregister-AdsHandle -SessionId <Int32> [-InputObject] <AdsHandleInfo[]>
[<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 | Register-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. The AmsNetId.
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. Tab completion: Completes route names from currently reachable ADS systems on the local TwinCAT system. The Route object.
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. Tab completion: Completes route names from currently reachable ADS systems on the local TwinCAT system. The address.
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). The session object.
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). Tab completion: Completes IDs of active TwinCAT sessions (created with New-TcSession). The Session ID.
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. Tab completion: Completes well-known ADS port numbers and names (e.g., 851/Plc1, 10000/SystemService). The port.
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. The port.
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) The Handle Info.
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
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.