Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TcEnumBinding

TcBinding for attaching to ENUM PLC Symbols

Hierarchy

Implements

Index

Constructors

constructor

  • Constructs a binding with information of the Symbol location, and the default Type Parameters

    Parameters

    • symbol: TcSymbol

      The TcSymbol which owns this binding

    • pointer: TcSymbolPointer

      The memory location in the PLC, where the Symbol is located

    • parameters: TcEnumType

      Symbol Type data

    • parent: TcEmitter

      The parent of this Symbol, to whom events are propagated

    • Default value debug: boolean = false

      If enabled, will produce debug information

    Returns TcEnumBinding

Accessors

clearPackages

context

fields

  • get fields(): string[]
  • Access the fields, which are allowed to be written to the PLC Symbol

    Returns string[]

indexGroup

  • get indexGroup(): number

indexOffset

  • get indexOffset(): number

isValid

  • get isValid(): boolean

readOnly

  • get readOnly(): boolean

readPackages

size

  • get size(): number

symbol

Methods

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

checkInput

  • checkInput(value: boolean | number | bigint | string): void

clear

  • clear(): Promise<void>

emit

  • emit(eventName: string | symbol, e: TcEvent): boolean
  • Emits an event of eventName with data e and if parent is present will propagated that event to it, unless stopped

    Parameters

    • eventName: string | symbol

      The event name to emit

    • e: TcEvent

      The Data associated with this event

    Returns boolean

    • True if the event had listeners, false otherwise.

emitChange

emitCleared

emitGet

emitSet

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

fromRaw

getMaxListeners

  • getMaxListeners(): number

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

read

  • read(): Promise<any>

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): this
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

subscribe

  • subscribe(sampling: number, callback: (value: any) => void): Promise<void>
  • Performs a subscription of this TcBinding for monitoring value change

    throws

    TcBindingIsInvalidException - Attempting operation on an invalidated TcBinding

    throws

    TcComIsInvalidException - Attempted to use an Invalid TcCom Object for subscription

    throws

    TcComSubscribeException - Failed to subscribe to the provided pointer

    Parameters

    • sampling: number

      The speed at which change is detected

    • callback: (value: any) => void

      Callback, which is invoked when a change does happened

        • (value: any): void
        • Parameters

          • value: any

          Returns void

    Returns Promise<void>

toRaw

unsubscribe

  • unsubscribe(): Promise<void>

write

  • write(value: any): Promise<any>

Static invalidate

Generated using TypeDoc