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 | METHOD ProcessNDATA VAR_INPUT itfPrimaryHost : IPrimaryHost; END_VAR VAR_IN_OUT newString : WSTRING(gc_sparkplug.supported_string_lengths); newLreal : LREAL; newreal : REAL; newVarInt : DecodedVarInt; pPrimaryHost : POINTER TO FB_PrimaryHost; AllocdMetric : REFERENCE TO FB_RemoteMetric; pExistingMetric : POINTER TO FB_RemoteMetric; // 1. pMessage is already decoded 'PrimaryHost ProcessNDATA MetricNotExisting but haven$'t implemeneted NCMD/Rebirth: %s', WriteDeviceLog( UDINT_TO_DWORD( CmpLog.LogClass.LOG_INFO ), TO_STRING( Error.OhMy_ThatShouldNotHaveHappened ) ); ELSE //update one Update( Metric := itfExistingMetric, Name := newName, DataType := newdatatype, Status := MetricStatus.ONLINE_OK, Timestamp := newtimestamp, String_ := newString, LReal_ := newLreal, Real_ := newreal, VarInt := newVarInt ); END_IF END_WHILE |