LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Input

opINPUT_DEVICE_LIST (LENGTH, ARRAY, CHANGED)

  • Read all available devices on input and output(chain)
  • Dispatch status unchanged

    Parameters
    (DATA8)LENGTH - Maximum number of device types (normally 32)
    Returns
    (DATA8) ARRAY - First element of DATA8 array of types (normally 32)
    (DATA8) CHANGED - Changed status

    opINPUT_DEVICE (CMD, .....)

  • Read information about device
  • Dispatch status unchanged

    Parameters
    (DATA8)CMD - Specific command parameter


    • CMD = GET_TYPEMODE
      Get device type and mode
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Returns
        (DATA8) TYPE - Device type
      • Returns
        (DATA8) MODE - Device mode [0..7]

    • CMD = GET_NAME
      Get device name
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Parameters
        (DATA8)LENGTH - Maximal length of string returned (-1 = no check)
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

    • CMD = GET_SYMBOL
      Get device symbol
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Parameters
        (DATA8)LENGTH - Maximal length of string returned (-1 = no check)
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

    • CMD = GET_FORMAT
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Returns
        (DATA8) DATASETS - Number of data sets
      • Returns
        (DATA8) FORMAT - Format [0..3]
      • Returns
        (DATA8) MODES - Number of modes [1..8]
      • Returns
        (DATA8) VIEWS - Number of views [1..8]

    • CMD = GET_RAW
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Returns
        (DATA32) VALUE - 32 bit raw value

    • CMD = GET_MODENAME
      Get device mode name
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Parameters
        (DATA8)MODE - Mode
      • Parameters
        (DATA8)LENGTH - Maximal length of string returned (-1 = no check)
      • Returns
        (DATA8) DESTINATION - String variable or handle to string

    • CMD = GET_FIGURES
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Returns
        (DATA8) FIGURES - Total number of figures (inclusive decimal point and decimals
      • Returns
        (DATA8) DECIMALS - Number of decimals

    • CMD = GET_MINMAX
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Returns
        (DATAF) MIN - Min SI value
      • Returns
        (DATAF) MAX - Max SI value

    • CMD = READY_PCT
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Parameters
        (DATA8)TYPE - Device type (0 = don't change type)
      • Parameters
        (DATA8)MODE - Device mode [0..7] (-1 = don't change mode)
      • Parameters
        (DATA8)VALUES - Number of return values
        if (VALUES == 1)
        Returns
        (DATA8) VALUE1 - First value from input

    • CMD = READY_RAW
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Parameters
        (DATA8)TYPE - Device type (0 = don't change type)
      • Parameters
        (DATA8)MODE - Device mode [0..7] (-1 = don't change mode)
      • Parameters
        (DATA8)VALUES - Number of return values
        if (VALUES == 1)
        Returns
        (DATA32) VALUE1 - First value from input

    • CMD = READY_SI
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Parameters
        (DATA8)TYPE - Device type (0 = don't change type)
      • Parameters
        (DATA8)MODE - Device mode [0..7] (-1 = don't change mode)
      • Parameters
        (DATA8)VALUES - Number of return values
        if (VALUES == 1)
        Returns
        (DATAF) VALUE1 - First value from input

    • CMD = GET_CHANGES
      Get positive changes since last clear
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Returns
        (DATAF) VALUE - Positive changes since last clear

    • CMD = GET_BUMPS
      Get negative changes since last clear
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Returns
        (DATAF) VALUE - Negative changes since last clear

    • CMD = CLR_CHANGES
      Clear changes and bumps
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number

    • CMD = CAL_MINMAX
      Apply new minimum and maximum raw value for device type to be used in scaling PCT and SI
      • Parameters
        (DATA8)TYPE - Device type [1..101]
      • Parameters
        (DATA8)MODE - Device mode [0..7]
      • Parameters
        (DATA32)CAL_MIN - 32 bit raw minimum value (Zero)
      • Parameters
        (DATA32)CAL_MAX - 32 bit raw maximum value (Full scale)

    • CMD = CAL_MIN
      Apply new minimum raw value for device type to be used in scaling PCT and SI
      • Parameters
        (DATA8)TYPE - Device type [1..101]
      • Parameters
        (DATA8)MODE - Device mode [0..7]
      • Parameters
        (DATA32)CAL_MIN - 32 bit SI minimum value (Zero)

    • CMD = CAL_MAX
      Apply new maximum raw value for device type to be used in scaling PCT and SI
      • Parameters
        (DATA8)TYPE - Device type [1..101]
      • Parameters
        (DATA8)MODE - Device mode [0..7]
      • Parameters
        (DATA32)CAL_MAX - 32 bit SI maximum value (Full scale)

    • CMD = CAL_DEFAULT
      Apply the default minimum and maximum raw value for device type to be used in scaling PCT and SI
      • Parameters
        (DATA8)TYPE - Device type [1..101]
      • Parameters
        (DATA8)MODE - Device mode [0..7]

    • CMD = SETUP
      Generic setup/read IIC sensors Example
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3]
      • Parameters
        (DATA8)NO - Port number
      • Parameters
        (DATA8)REPEAT - Repeat setup/read "REPEAT" times (0 = infinite)
      • Parameters
        (DATA16)TIME - Time between repeats [10..1000mS] (0 = 10)
      • Parameters
        (DATA8)WRLNG - No of bytes to write
      • Parameters
        (DATA8)WRDATA - DATA8 array (handle) of data to write
      • Parameters
        (DATA8)RDLNG - No of bytes to read
      • Returns
        (DATA8) RDDATA - DATA8 array (handle) to read into

    • CMD = CLR_ALL
      Clear all devices (e.c. counters, angle, ...)
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3] (-1 = all)

    • CMD = STOP_ALL
      Stop all devices (e.c. motors, ...)
      • Parameters
        (DATA8)LAYER - Chain layer number [0..3] (-1 = all)


        opINPUT_READ (LAYER, NO, TYPE, MODE, PCT)
  • Read device value in Percent
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NO - Port number
    (DATA8)TYPE - Device type (0 = don't change type)
    (DATA8)MODE - Device mode [0..7] (-1 = don't change mode)
    Returns
    (DATA8) PCT - Percent value from device

    opINPUT_READSI (LAYER, NO, TYPE, MODE, SI)

  • Read device value in SI units
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NO - Port number
    (DATA8)TYPE - Device type (0 = don't change type)
    (DATA8)MODE - Device mode [0..7] (-1 = don't change mode)
    Returns
    (DATAF) SI - SI unit value from device

    opINPUT_TEST (LAYER, NO, BUSY)

  • Test if device busy (changing type or mode)
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NO - Port number
    Returns
    (DATA8) BUSY - Device busy flag (0 = ready, 1 = busy)

    opINPUT_READY (LAYER, NO)

  • Wait for device ready (wait for valid data)
  • Dispatch status can change to BUSYBREAK

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NO - Port number

    opINPUT_WRITE (LAYER, NO, BYTES, DATA)

  • Write data to device (only UART devices)
  • Dispatch status can change to BUSYBREAK

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NO - Port number
    (DATA8)BYTES - No of bytes to write [1..32]
    (DATA8)DATA - First byte in DATA8 array to write

    opINPUT_READEXT (LAYER, NO, TYPE, MODE, FORMAT, VALUES, VALUE1)

  • Read device value
  • Dispatch status unchanged

    Parameters
    (DATA8)LAYER - Chain layer number [0..3]
    (DATA8)NO - Port number
    (DATA8)TYPE - Device type (0 = don't change type)
    (DATA8)MODE - Device mode [0..7] (-1 = don't change mode)
    (DATA8)FORMAT - Format (PCT, RAW, SI ...)
    (DATA8)VALUES - Number of return values

    if (VALUES == 1)

    Returns
    (FORMAT) VALUE1 - First value from device

    opINPUT_SAMPLE (TIME, SAMPLES, INIT, DEVICES, TYPES, MODES, DATASETS, VALUES)

  • Sample devices (see Example)
  • Dispatch status unchanged

    Parameters
    (DATA32)TIME - Sample time [mS]
    (DATA16)SAMPLES - Number of samples
    (DATA16)INIT - DATA16 array (handle) - to start/reset buffer -> fill array with -1 otherwise don't change
    (DATA8)DEVICES - DATA8 array (handle) with devices to sample
    (DATA8)TYPES - DATA8 array (handle) with types
    (DATA8)MODES - DATA8 array (handle) with modes
    (DATA8)DATASETS - DATA8 array (handle) with data sets
    Returns
    (DATAF) VALUES - DATAF array (handle) with values