INSERTARCHARR archIdent, locVarColValueIdent_Rec [,[retIdent_Int], bRecalcStat_Bool] |
| archIdent | in | Reference to one of (historical) value - (not controlled whether the archive object is used - adding reference to object is enough). |
| locVarColValueIdent_Rec | in | Column identifier of a Record type local variable. |
| retIdent_Int | out | Identifier of Int type - return code: action success (optional parameter). |
| bRecalcStat_Bool | in | Identifier of Bool type - enables/disables calculation of related statistical historical values (optional parameter). |
archIdent. Value array represents the column, to which
the parameter locVarColValueIdent_Rec
refers. Time of writing the values into the archive is defined by the time
of their generation. If the parameter retIdent_Int
is not stated, the action does not wait for confirming the writing. If the
identifier is stated, it gets one of the following values:
If the identifier retIdent_Int is stated, the script waits for the physical writing of the value into the archive database.
Result:
If I will use the action to write a value into the archive without waiting
and then I will read the value, the read value almost certainly will not be
that one written in the previous action.
Calculation of related statistical historical values can be disabled by setting the parameter bRecalcStat_Bool to the value of @FALSE.
RECORD (SD.ArchDemo) _data
INT _value
INT _idx
TIME _bt
INT _retCode
_bt := %StrToTime("8:01:00 16-10-2003")
REDIM _data[60]
; assign any data
_idx := 1
_value := 100
DO_LOOP
EXIT_LOOP _idx > _data\DIM
_data[_idx]^value := _value TIME _bt
_idx := _idx + 1
_value := _value + 1
_bt := %AddTime(_bt, 1)
END_LOOP
|
; writing INSERTARCHARR H.ArchObj, _data^value, _retCode |
; action success test IF _retCode # _ERR_NO_ERROR THEN ; write error ENDIF |