1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | (* NBIRTH The NBIRTH message requires the following payload components. The NBIRTH must include a timestamp denoting the DateTime the message was sent from the EoN node. If Template instances will be published by this EoN or any devices, all Template definitions must be published in the NBIRTH. provided in the MQTT CONNECT packet s LW&T payload (NDEATH). This allows backend applications to correlate The NBIRTH message can also include optional Node Control payload components. These are used by a backend o Used by backend application(s) to request a new NBIRTH and DBIRTH(s) from an EoN node. Metric name: Node Control/Next Server o Used by backed application(s) to modify a poll rate on an EoN node. AllMetricsList : LIST; // Contains a list of all metrics which will ever report on in this node VAR InitEncoderErr : ERROR; AddSimpleMetricErr : ERROR; SysTimeRtc.SysTimeRtcHighResGet( pTimestamp := _Timestamp ); InitEncoderErr := _Encoder.InitializePayloadBeforeAddingMetrics( timestamp := _Timestamp ); (* Now all metrics which this node will ever report on, including BdSeq AddAllMetricsListErr := AddAllMetrics( TimeStamp := _Timestamp, AllMetricsList := AllMetricsList ); GetEoNNodeBirthCertificate := AddAllMetricsListErr; IF GetEoNNodeBirthCertificate = ERROR.NO_ERROR THEN msgFmtStr := 'SparkplugBSimple GetNBIRTHCertificate Succes', strArg := '' ); ELSE msgFmtStr := 'SparkplugBSimple GetNBIRTHCertificate Failed', END_IF ELSE GetEoNNodeBirthCertificate := InitEncoderErr; msgFmtStr := 'SparkplugBSimple GetNBIRTHCertificate Failed to init', strArg := '' ); END_IF |