Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TcNumericSymbol

Class representing an instance of a PLC Symbol of Numeric 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 Numeric 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: TcNumericType

      The Type parameters of this Symbol

    • Default value debug: boolean = false

      If enabled, will produce debug information

    Returns TcNumericSymbol

Events

$on

Accessors

$binding

$get

  • get $get(): Promise<number>

$lowerBorder

  • get $lowerBorder(): number | bigint
  • Access the minimum value that can be written to this symbol

    Returns number | bigint

$parent

$path

  • get $path(): string

$readOnly

  • get $readOnly(): boolean

$upperBorder

  • get $upperBorder(): number | bigint
  • Access the maximum value that can be written to this symbol

    Returns number | bigint

Methods

$clear

  • $clear(): Promise<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: number): Promise<number>

$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>

Protected __invalidate

  • __invalidate(): void
  • Invalidates the TcBindingof this symbol, as well as, if a callback as provided in case of invalidation - will invoke it

    Returns void

Generated using TypeDoc