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:
Adds the existing parameters to the output.
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.
constfilled = fillPdoParametersWithMappingEntries(params, 3); // filled will include the two original entries plus one default placeholder with subindex 2
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 atsubindex
0, this function:Parameter
entries with incremented subindexes until the total count reachesentriesPerPdo
.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 toentriesPerPdo
.Example