Function getParameterEsiExtension

  • Retrieves extended EtherCAT Slave Information (ESI) metadata for a given device parameter.

    This function extracts and constructs additional descriptive and validation information for a device parameter based on the ESI file data, including constraints, default values, units, descriptions, mapping capabilities, and input type hints.

    The returned object extends the base device parameter with ESI-specific metadata that can be used for validation, UI generation, and device communication mapping.

    Returns

    A ParameterEsiExtension object containing extended parameter metadata, such as mandatory flags, min/max constraints, default values, units, bit sizes, descriptions, options, PDO mapping flags, SMM module flag, group information, type keys, and UI input hints.

    Remarks

    • Supports parameter metadata extraction from both the main device profile dictionary and sub-modules (e.g., for modular devices like SMM LW2).
    • For STRING types, the maximum length is adjusted to accommodate firmware limitations.
    • Descriptions and options are parsed and cleaned from JSON-like strings.
    • Handles both variable data type objects and complex objects with sub-items.
    • Logs a warning if no matching device is found for the given product code.
    • Preserves original unit and options for reference or restoration.

    Parameters

    • parameter: Pick<Parameter, "index" | "subindex" | "typeValueKey"> & {
          typeValue?: "intValue" | "uintValue" | "floatValue" | "stringValue" | "rawValue";
      }

      Partial device parameter containing index, subindex, typeValueKey, and optionally typeValue. Identifies the parameter to extend.

    • info: any

      The EtherCAT master or module info object containing descriptions and device dictionaries as parsed from the ESI file. (Type from ecatmod.EtherCATInfo expected but typed as any here.)

    • productCode: number

      The EtherCAT device product code used to locate the matching device description within the ESI data. This product code can typically be read from the device's object dictionary at index 0x1018 (Identity Object), subindex 2.

    Returns ParameterEsiExtension

Generated using TypeDoc