Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TcStructureBinding

TcBinding for attaching to Structures, Function_Blocks or Unions PLC Symbols

Hierarchy

Implements

Index

Constructors

constructor

Accessors

clearPackages

context

indexGroup

  • get indexGroup(): number

indexOffset

  • get indexOffset(): number

isValid

  • get isValid(): boolean

readOnly

  • get readOnly(): boolean

readPackages

size

  • get size(): number

symbol

Methods

Protected __addChild

  • __addChild(child: { binding: TcSymbolBinding; key: string | number }): void

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

callMethod

  • callMethod(path: string, method: string, args: any): Promise<{ outputs?: any; result: any }>
  • Will attempt to invoke the provided method, based on the variable path and the method name, with the provided arguments.

    As of now, no type checking is performed on the passed arguments, and this function acts as a simple through put to the TcCom Module

    throws

    TcComIsInvalidException - Attempted to use an Invalid TcCom Object for subscription

    throws

    TcComMethodCallException - Failed to call the Rpc Method on the PLC Side

    Parameters

    • path: string

      The full path to the Function_Block, whose method is called

    • method: string

      The method name, that is to be called

    • args: any

      All the arguments, as an object, that are passed to the method

    Returns Promise<{ outputs?: any; result: any }>

    • The result of the method call

checkInput

  • checkInput(value: {}): 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