[r810]: / trunk / mqttsparkplug / mqttsparkplug / SparkplugB / Function Blocks / FB_RemoteDevice / FB_RemoteDevice / svnobj  Maximize  Restore  History

Download this file

18 lines (17 with data), 4.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{attribute 'call_after_init'}
FUNCTION_BLOCK FB_RemoteDevice IMPLEMENTS IRemoteDevice
VAR_INPUT
    itfPrimaryHost : IPrimaryHost;
    Name           : WSTRING;     //Leave blank if you are happy for this to be used as a pool Device
END_VAR
VAR_OUTPUT
    {attribute 'no_copy'}
    itfRemoteDevice : IRemoteDevice := THIS^;
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