Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TcStructType

Class representing a Structures, Function_Blocks and Unions Types in the Target PLC.

Hierarchy

Index

Constructors

Protected constructor

  • Constructs a TcBooleanType to represent Structures, Function_Blocks and Unions Types in the Target PLC

    Parameters

    • context: TcContext

      The TcContext, to which this Type belongs

    • typeData: TcTypeInfo | TcStructType

      The information, from which the TcType is build

    • Default value children: { key: string; type: TcType }[] = []

      The Children Types, that are part of this structure

    • Default value debug: boolean = false

      If enabled, will produce debug information

    Returns TcStructType

Accessors

adst

  • get adst(): number

children

  • get children(): { key: string; type: TcType }[]

context

defaultBuffer

  • get defaultBuffer(): Buffer | undefined
  • set defaultBuffer(val: Buffer | undefined): void

defaultValue

  • get defaultValue(): any
  • set defaultValue(val: any): void

ignored

  • get ignored(): boolean
  • set ignored(val: boolean): void

name

  • get name(): string

offset

  • get offset(): number
  • set offset(val: number): void
  • The memory offset, relative to its parent, if the TcType is a child

    Returns number

  • The memory offset, relative to its parent, if the TcType is a child

    Parameters

    • val: number

    Returns void

onChange

  • get onChange(): string
  • set onChange(val: string): void
  • Alias to use, in place of the default 'changed' event, when a TcSymbol of this type is constructed

    Returns string

  • Alias to use, in place of the default 'changed' event, when a TcSymbol of this type is constructed

    Parameters

    • val: string

    Returns void

onClear

  • get onClear(): string
  • set onClear(val: string): void
  • Alias to use, in place of the default 'cleared' event, when a TcSymbol of this type is constructed

    Returns string

  • Alias to use, in place of the default 'cleared' event, when a TcSymbol of this type is constructed

    Parameters

    • val: string

    Returns void

onGet

  • get onGet(): string
  • set onGet(val: string): void
  • Alias to use, in place of the default 'get' event, when a TcSymbol of this type is constructed

    Returns string

  • Alias to use, in place of the default 'get' event, when a TcSymbol of this type is constructed

    Parameters

    • val: string

    Returns void

onSet

  • get onSet(): string
  • set onSet(val: string): void
  • Alias to use, in place of the default 'set' event, when a TcSymbol of this type is constructed

    Returns string

  • Alias to use, in place of the default 'set' event, when a TcSymbol of this type is constructed

    Parameters

    • val: string

    Returns void

readOnly

  • get readOnly(): boolean
  • set readOnly(val: boolean): void

rpcMethods

  • get rpcMethods(): string[]
  • List of all RPC Methods available for this structure

    Returns string[]

size

  • get size(): number
  • set size(val: number): void

Methods

Protected __clone

  • Internal function for applying mutations to the created clone. Used for code reduction

    throws

    TcComIsInvalidException - Attempting to use an invalidated TcCom Object

    throws

    TcComToRawException - Error occurred when transforming value to raw data

    Parameters

    • type: TcType

      the TcType, which can be potentially mutated

    • Optional mutator: TcTypeBase

      The mutator which can be applied to the TcType

    Returns Promise<TcType | undefined>

    • Either the clone TcType or undefined if cloning failed

Protected __getParameter

  • __getParameter(name: string, value: string): void
  • Internal function, which analyses attribute data from the Type ADS Data and adjusts aspects of this TcType

    Mutations supported :

    • ReadOnly
    • Ignored
    • OnSet
    • OnGet
    • OnClear
    • OnChange

    Parameters

    • name: string

      name of the Attribute

    • value: string

      value of the Attribute

    Returns void

clone

  • Creates a clone with an optional mutation of this TcType

    throws

    TcComIsInvalidException - Attempting to use an invalidated TcCom Object

    throws

    TcComToRawException - Error occurred when transforming value to raw data

    Parameters

    • Optional mutator: TcTypeBase

      Optional mutator, which can be applied to the clone

    Returns Promise<TcType | undefined>

    • Either the clone TcType or undefined if cloning failed

extend

  • Extends the current TcType with the provided TcTypeInfo. The default extension can either create a mutation of the current TcType or transform the TcType into an array

    Parameters

    • adsTypeData: TcTypeInfo

      Data with which to extends the TcType

    Returns Promise<TcType | undefined>

    • Either the extends TcType or undefined if extension failed

instance

  • Creates an instance of Type Structure, Function_Block or Union PLC Symbol, based on this TcType

    Parameters

    • path: string

      Path of the created TcSymbol

    • parent: TcSymbol

      Parent of the created TcSymbol

    • pointer: TcSymbolPointer

      Memory location of created TcSymbol in the Target PLC

    • Default value debug: boolean = false

      If enabled, will produce debug information

    Returns TcSymbol

    • An TcSymbol instance of a Symbol of type Structures, Function_Blocks or Union

mutate

  • Clones this TcType and mutates it, with additional attributes from the mutator

    Parameters

    • mutator: TcTypeBase

      Will use the Attributes and Offset to create a mutation of this TcType

    Returns void

Static create

  • Creates an instance of TcStructType

    throws

    TcComIsInvalidException - Attempting to use an invalidated TcCom Object

    throws

    TcComToRawException - Error occurred when transforming value to raw data

    Parameters

    • context: TcContext

      The TcContext, to which this Type belongs

    • typeData: TcTypeInfo | TcStructType

      The information, from which the TcType is build

    • Default value children: { key: string; type: TcType }[] = []

      The Children Types, that are part of this structure

    • Default value debug: boolean = false

      If enabled, will produce debug information

    Returns Promise<TcStructType | undefined>

    • An initialized instance of TcStructType if it is not ignored

Generated using TypeDoc