Get-TcDataType

SYNOPSIS

Get the DataTypes from a TwinCAT target system / Device.

SYNTAX

NetIdPort (Default)

Get-TcDataType [[-Name] <String[]>] [-NetId <AmsNetId>] -Port <Int32> [-Force]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

Route

Get-TcDataType [[-Name] <String[]>] -Route <IRoute> -Port <Int32> [-Force] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

AddressStr

Get-TcDataType [[-Name] <String[]>] -Address <String> -Port <Int32> [-Force]
 [-ProgressAction <ActionPreference>] [<CommonParameters>]

Session

Get-TcDataType [[-Name] <String[]>] -Session <ISession> [-Force] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

SessionId

Get-TcDataType [[-Name] <String[]>] -SessionId <Int32> [-Force] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

This Cmdlet get the DataTypes from a target system if symbolic information is provided by the device (Symbol Server running).

The DataTypes can be determined via different Providers (e.g.

ADS, MQTT, OPC, see the '-Provider' parameter.)

EXAMPLES

EXAMPLE 1

PS> Get-TcDataType -port 851
Name                      Size     Category   BaseType
----                      ----     --------   --------
BYTE                      1        Primitive
WORD                      2        Primitive
DINT                      4        Primitive
UDINT                     4        Primitive
DWORD                     4        Primitive
E_ByteEnum                1        Enum       BYTE
FB_Test                   12424    Struct
PLC.PlcAppSystemInfo      256      Struct
PLC.PlcTaskSystemInfo     128      Struct
POINTER TO BYTE           4        Pointer    BYTE
R_Range                   2        Alias      INT (-6..12)
REFERENCE TO BOOL         4        Reference  BOOL
ST_SimpleStruct           166      Struct
STRING(80)                81       String
...

Get the data types from the local system (Port 851):

EXAMPLE 2

PS> $types = Get-TcDataType -Name 'ST_*' -NetId 1.2.3.4.5.6 -Port 851

Gets the DataTypes with name pattern 'ST_*' from the NetId / Port address symbol server.

EXAMPLE 3

PS> $session = New-TcSession -Name 'CX_123456' -port 851
PS> Get-TcDataType -Session $session | where ByteSize -gt 1KB

Gets an ADS-Session/Connection to the target system CX_123456 on port 851, downloads the datatype information and returns all the DataTypes that are larger than 1KB of Size.

PARAMETERS

-Name

The data type name(s) to get.

Wildcards are permitted.

Type: String[]
Parameter Sets: (All)
Aliases:

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

-NetId

The NetID address of the target system where to load the datatypes (Local by default).

Type: AmsNetId
Parameter Sets: NetIdPort
Aliases:

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

-Route

The Route object where to load the datatypes from (RouteTarget.Local by default).

Type: IRoute
Parameter Sets: Route
Aliases: Destination

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

-Address

The address where to load the datatype descriptions.

This can be the RouteName, NetId, the HostName or the IPAddress.

Wildcards are permitted.

Type: String
Parameter Sets: AddressStr
Aliases:

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

-Port

The Port where to load the datatype descriptions.

Type: Int32
Parameter Sets: NetIdPort, Route, AddressStr
Aliases:

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

-Session

The session object to use for datatype upload.

Type: ISession
Parameter Sets: Session
Aliases: InputObject

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

-SessionId

The unique session Identifier that represents the session to ose for the datatype upload.

Type: Int32
Parameter Sets: SessionId
Aliases: Id

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

-Force

Forces to reload the data types (forces to reload the internal cache).

Type: SwitchParameter
Parameter Sets: (All)
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

TwinCAT.ISession

The session object to use for datatype upload.

OUTPUTS

NOTES