Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TcStructureSymbol

Class representing an instance of a PLC Symbol of Structure, Function_Block or UNION Type.

Hierarchy

Indexable

[key: string]: TcSymbol | TcSymbolMethod

TcSymbols are indexable, in case they are structured types, and can nest children TcSymbols. Alternatively, if a TcSymbol has Rpc Methods enabled, this methods can be also invoked over the index.

Index

Constructors

constructor

  • Constructs a TcSymbol, which is designed to interface with a Structure, Function_Block or UNION Symbol on the Target PLC.

    Parameters

    • path: string

      The Path of this Symbol, relative to its origin point

    • parent: TcSymbol

      Potential parent of this TcSymbol and to whom events will propagate to

    • pointer: TcSymbolPointer

      The memory location of the Target PLC Symbol

    • params: TcStructType

      The Type parameters of this Symbol

    • Default value debug: boolean = false

      If enabled, will produce debug information

    Returns TcStructureSymbol

Events

$on

Accessors

$binding

$get

  • get $get(): Promise<{}>

$parent

$path

  • get $path(): string

$readOnly

  • get $readOnly(): boolean

Methods

$clear

  • $clear(): Promise<void>

$each

  • $each(callback: (symbol: TcSymbol, key: string, parent: TcSymbol) => void): void
  • Iterates over all the TcSymbol Children of this `TcSymbol, and passes each of them to the provided callback

    Parameters

    • callback: (symbol: TcSymbol, key: string, parent: TcSymbol) => void

      Callback, to which each TcSymbol Child is passed

    Returns void

$off

  • $off(eventName: string, listener: (e: any) => void): TcSymbol
  • Removes a listener from the specified event

    Parameters

    • eventName: string

      The event name, from which the listener is to be removed

    • listener: (e: any) => void

      The listener, which is to be removed from the specified event

        • (e: any): void
        • Parameters

          • e: any

          Returns void

    Returns TcSymbol

$onInvalidated

  • $onInvalidated(callback: (symbol: TcSymbol) => void): void
  • Attached the provided callback, which will be called when the `TcSymbol becomes invalidated

    Parameters

    • callback: (symbol: TcSymbol) => void

      The function, which is to be called upon invalidation

    Returns void

$once

  • $once(eventName: string, listener: (e: any) => void): TcSymbol
  • Attached a listener to an event, which is only invoked once. For the full list of events, see TcSymbol.$on()

    Parameters

    • eventName: string

      The event name, which the listener will listen for

    • listener: (e: any) => void

      The listener, which is called when the event is emitted

        • (e: any): void
        • Parameters

          • e: any

          Returns void

    Returns TcSymbol

$set

  • $set(value: {}): Promise<{}>

$subscribe

  • $subscribe(sampling?: number): Promise<void>
  • Activates value change detection of the Target PLC Symbol. The sampling rate can be explicitly set, in case the value changes uneseceraly too fast.

    throws

    TcBindingIsInvalidException - Attempting operation on an invalidated TcBinding

    throws

    TcComIsInvalidException - Attempting operation on an invalidated TcCom Object

    throws

    TcComSubscribeException - An error occurred when subscribing to the Symbol

    Parameters

    • Default value sampling: number = 10

      The speed at which change in the Target PLC Symbol value is detected

    Returns Promise<void>

$unsubscribe

  • $unsubscribe(): Promise<void>

Private __addChild

  • __addChild(child: { key: string; symbol: TcSymbol }): void
  • Internal use function, which registers a TcSymbol Child as part of this `TcSymbol

    Parameters

    • child: { key: string; symbol: TcSymbol }

      The Child that is to be registered

    Returns void

Private __addMethod

  • __addMethod(name: string): void
  • Internal use function, which registers an Rpc Method to this Structure

    Parameters

    • name: string

      The name of the method to create

    Returns void

Protected __invalidate

  • __invalidate(): void

Generated using TypeDoc