[r891]: / branches / develop / mqttsparkplug / mqttsparkplug / Sparkplug™ MQTT edge and host / Function Blocks / FB_RemoteDevice / FB_RemoteDevice / svnobj  Maximize  Restore  History

Download this file

29 lines (28 with data), 4.9 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
{attribute 'call_after_init'}
    itfRemoteEdge  : IRemoteEdge; // if this is a pool Device, it will be set by the primary node.  if not then attach it yourself to the correct groupID
    // TRUE when metric value is representative of the remote value. 
    // FALSE when Edge or Device dies, or when Host is OFFLINE
    isQualityOK : BOOL;
VAR
    pEdge    : POINTER TO FB_RemoteEdge;
    pPrimary : POINTER TO FB_PrimaryHost;
    _metrics : List; // OF FB_Metric
    //IElement
    _itfPrev : IElement;
    _itfNext : IElement;
    _itfList : IList;
    //IMessageSource
    _informPublishDone        : BOOL;
    _informPublishError       : BOOL;
    _informPublishDoneOrError : ERROR;
    _Message_publishing       : BOOL;
    _SparkplugB               : FB_SparkplugBSimple;
    _TopicProvider            : FB_DeviceTopicProvider;
IF THIS^.itfRemoteEdge <> 0 THEN
    IF __QUERYPOINTER( itfRemoteEdge, pEdge ) THEN
        pEdge^.RegisterDevice( THIS^ );
    END_IF
ELSIF THIS^.itfPrimaryHost <> 0 THEN
    IF __QUERYPOINTER( itfPrimaryHost, pPrimary ) THEN
        pPrimary^.RegisterDevice( THIS^ );
END_IF