Function fillPdoParametersWithMappingEntries

  • Fills in missing PDO mapping entries for each parameter group that starts with a subindex of 0.

    For each group of parameters with the same index and starting at subindex 0, this function:

    1. Adds the existing parameters to the output.
    2. Appends placeholder Parameter entries with incremented subindexes until the total count reaches entriesPerPdo.

    This is useful for ensuring that each PDO mapping table has a consistent number of entries, even if some are unused and need to be filled with default placeholder values.

    Returns

    A new array of Parameter objects where each PDO group is filled with entries up to entriesPerPdo.

    Example

    const params: Parameter[] = [
    { index: 0x1600, subindex: 0, ... },
    { index: 0x1600, subindex: 1, ... },
    ];

    const filled = fillPdoParametersWithMappingEntries(params, 3);
    // filled will include the two original entries plus one default placeholder with subindex 2

    Parameters

    • parameters: Parameter[]

      The list of existing parameters to process.

    • entriesPerPdo: number = 10

      The number of total entries (including placeholders) each PDO should have. Defaults to 10.

    Returns Parameter[]

Generated using TypeDoc