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 |