It is more data- and processing- efficient to use aliases for metrics than to use the full metric name.
A setting should be available to enable aliases.
1. send xBIRTH will send both the name and alias.
2. send xDATA will send only the alias.
3. receive xCMD should match first on Alias, but if no Alias is in the metric then it should match on Name.
Release note:
For an Edge, the input to the function UseAliases controls whether aliases are generated and used for each metric in the edge and its child devices.
For a Host, the use of aliases is entirely up to the Edge and its Devices - if the edge births with aliases, FB_Host will send NCMDs with aliases. Similarly if a device is birthed with aliases, FB_Host will send DCMDs with aliases.
From the spec. Only metrics have aliases, i.e. Properties do not have aliases.
"alias
◦ This is an unsigned 64-bit integer representing an optional alias for a Sparkplug B payload.
If supplied in an NBIRTH or DBIRTH it MUST be a unique number across this Edge
Node’s entire set of metrics. In other words, no two metrics for the same Edge Node can
have the same alias. Upon being defined in the NBIRTH or DBIRTH, subsequent messages
can supply only the alias instead of the metric friendly name to reduce overall message size."
So it seems Edge1/Device1 Metrics must have different aliases to Edge1/Device2 Metrics, as well as Edge1 Metrics. So FB_Edge will have to provide a "getNewAlias()", which will return an ever increasing ULINT.
during DBIRTH and NBIRTH, if a metric does not already have an alias, it must request one from itfEdge.getNewAlias() or THIS^.getNewAlias().
an input to the FB_Edge, VAR_INPUT UseAliasing : BOOL := TRUE; will determine whether to calculate and use aliasing.
Last edit: hermsen 2021-10-30
Last edit: hermsen 2021-10-30
Definition;
If use aliases = False then all aliases are 0 and thus not used.
If Use aliases = True then all aliases are unique and start counting with 1,2 etc.
All NCMD's are also sent during xBIRTH with an alias number if the alias mechanism is enabled (TRUE by default).
Last edit: i-campbell 2021-11-11
Diff:
Diff:
completed in host v1.3.0.6 and stack v1.4.3.2