[r818]: / branches / FeatureBranches / Debuglogging / SparkplugB / Function Blocks / FB_Edge / FB_Edge / NDATA / PublishNDATAEntry / svnobj  Maximize  Restore  History

Download this file

38 lines (33 with data), 6.1 kB

 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
(* 
    Node DATA (NDATA)
    
    NBIRTH message. Any time an input changes on the EoN node, a NDATA message should be generated and published
    The following is a representation of a simple NDATA message on the topic:
        spBv1.0/Sparkplug
 B Devices/NDATA/Raspberry Pi
    
   The 
Group ID
 of this EoN node is: Sparkplug
 B Devices
    
   The 
EoN node ID
 of this EoN node is: Raspberry Pi
    
   *This is an NBIRTH message from the EoN node
*)
{attribute 'hide'}
METHOD PublishNDATAEntry : BOOL
VAR_IN_OUT
    AllMetricsList : LIST;
END_VAR
VAR_OUTPUT
    EncodeError   : BOOL := FALSE;
    Encode_eError : ERROR;
VAR_STAT
    NDATATopic  : WSTRING;
    EncodeDone  : BOOL := FALSE;
PublishNDATAEntry := FALSE;
_SparkplugB.SetSeq();
_SparkplugB.Encode( Enable := TRUE );
REPEAT
    _SparkplugB( AllmetricsList := AllMetricsList );
                WSTRING_TO_STRING( _TopicProvider.wsNDATApublisherTopic ) );
PublishNDATAEntry := EncodeDone OR EncodeError;