CALCARCHEXPR archExprIdent_Txt, btIdent_TimA, etIdent_TimA, stepIdent_Int, _ignoreInvalid_Bool, _locVarColValueIdent_Rec, statusIdent_Int[, archivInstance_Int] |
archExprIdent_Txt | in | Value identifier of Text type containing the expression. |
btIdent_TimA | in | Identifier of AbsTime type - interval beginning. |
etIdent_TimA | in | Identifier of AbsTime type - interval end. |
stepIdent_Int | in | Identifier of Int type - time step [s]. |
_ignoreInvalid_Bool | in | Identifier of Bool type - invalid values in expression will be replaced by 0. |
_locVarColValueIdent_Rec | out | Reference to a local variable column of RECORD type - final values. |
statusIdent_Int | out | Identifier of Int type - the success of calculation. |
archivInstance_Int | in | Optional identifier of Int type - identification of archive instance. If the parameter is not defined, the value 0 will replace it. |
TIME _bt, _et INT _step INT _retCode TEXT _expr TEXT _err BOOL _bIgnoreInvalid RECORD NOALIAS (SD.Data) _data _bt := %StrToTime("00:00:00 01-01-2008") _et := %StrToTime("00:00:00 02-01-2008") _step := 1 _bIgnoreInvalid := @TRUE _expr := "H.a + H.GetArchRowCol_Ref[2]^I2 + H.GetArchRowCol_Ref_Col_I1[2]" CALCARCHEXPR _expr, _bt, _et, _step, _bIgnoreInvalid, _data^Value, _retCode IF _retCode = _ERR_NO_ERROR THEN ; processing of result ELSE _err := _ERR_MSG ; extended error description ENDIF |
Owing to the expression parsing works during system running (not during configuration) and if any errors occur, it is possible to obtain their detailed description as value of predefined local variable of Text type _ERR_MSG.