Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TcNamespaceSymbol

Class representing an instance of a PLC Symbol, which is the initial entry point to the TcSymbol map. These namespaces are usually PROGRAMS and different Variable Lists.

This TcSymbol deduces its IndexOffset, IndexGroup and Size, based on the provided children

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.

This TcSymbol deduces its IndexOffset, IndexGroup and Size, based on the provided children

Index

Constructors

constructor

  • Constructs a TcSymbol, which is designed to interface a namespace Symbol on the Target PLC.

    Parameters

    • path: string

      The Path of this Symbol, relative to its origin point

    • context: TcContext

      The TcContext, that this namespace is apart of

    • parent: TcEmitter

      Parent Emitter, to whom errors are propagated to

    • Default value debug: boolean = false

      If enabled, will produce debug information

    Returns TcNamespaceSymbol

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

Protected __invalidate

  • __invalidate(): void

Generated using TypeDoc