Options
All
  • Public
  • Public/Protected
  • All
Menu

node-logix

Index

Type aliases

CIPType

CIPType: (string | number)[]

IPAddress

IPAddress: string

Variables

TimeoutError

TimeoutError: any

Functions

BitValue

  • BitValue(value: number, bitno: number): number
  • description

    Returns the specific bit of a words value

    Parameters

    • value: number
    • bitno: number

    Returns number

BitofWord

  • BitofWord(tag: string): boolean
  • description

    Test if the user is trying to write to a bit of a word ex. Tag.1 returns true (Tag = DINT)

    Parameters

    • tag: string

    Returns boolean

_replacePin

  • _replacePin(str?: string, pin: string): string
  • description

    replace pin mapping

    Parameters

    • Default value str: string = ""
    • pin: string

    Returns string

Const flatten

  • flatten(arr: Array<any>): any
  • flatten array

    Parameters

    • arr: Array<any>

    Returns any

getBitOfWord

  • getBitOfWord(tag: string, value: number): undefined | number
  • description

    Takes a tag name, gets the bit from the end of it, then returns that bits value

    Parameters

    • tag: string
    • value: number

    Returns undefined | number

getDevice

  • getDevice(deviceType: string | number): string
  • Parameters

    • deviceType: string | number

    Returns string

getErrorCode

  • getErrorCode(status: number): any
  • Parameters

    • status: number

    Returns any

getVendor

  • getVendor(vendorId: string | number): string
  • Parameters

    • vendorId: string | number

    Returns string

getWordCount

  • getWordCount(start: number, length: number, bits: number): number
  • description

    Get the number of words that the requested bits would occupy. We have to take into account how many bits are in a word and the fact that the number of requested bits can span multipe words

    Parameters

    • start: number
    • length: number
    • bits: number

    Returns number

nameFunction

  • nameFunction(name: string, body: function): function
  • Helper to return dynamic name function

    Parameters

    • name: string
    • body: function
        • (...args: []): any
        • Parameters

          • Rest ...args: []

          Returns any

    Returns function

      • (): any
      • Returns any

parseIdentityResponse

  • description

    we're going to take the packet and parse all the data that is in it.

    Parameters

    • data: Buffer
    • Optional rinfo: RemoteInfo
    • Optional resp: LGXDevice | PLC

    Returns undefined | LGXDevice | PLC

parseLgxTag

  • parseLgxTag(packet: Buffer, programName?: undefined | string): LgxTag

parseTagName

  • parseTagName(tag: string, offset: number): [string, string, Array<number> | number]
  • description

    parse the packet to get the base tag name the offset is so that we can increment the array pointer if need be

    Parameters

    • tag: string
    • offset: number

    Returns [string, string, Array<number> | number]

Generated using TypeDoc