1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | {attribute 'call_after_init'} FUNCTION_BLOCK PUBLIC FB_RemoteMetric IMPLEMENTS IRemoteMetric VAR_INPUT itfPrimaryHost : IPrimaryHost; // FALSE when metric value is representative of the remote value. // TRUE when Edge or Device dies, or when Host is OFFLINE isStale : BOOL := TRUE; VAR pPrimary : POINTER TO FB_PrimaryHost; _name : WSTRING; _Value : BOOL; _TS : T_DateTime; _Status : MetricStatus; _storageMetricHost : FB_HostStorageMetric;//This is just used for storage for the payload // ISimpleStorage IF THIS^.itfMetricOwner <> 0 THEN itfMetricOwner.RegisterMetric( THIS^ ); ELSIF THIS^.itfPrimaryHost <> 0 THEN IF __QUERYPOINTER( itfPrimaryHost, pPrimary ) THEN pPrimary^.RegisterMetric( THIS^ ); END_IF END_IF |