Porovnávané verzie
porovnané s
Kľúč
- Tento riadok sa pridal
- Riadok je odstránený.
- Formátovanie sa zmenilo.
INSERTARCHARR action
Function
Modification, or writing of the array values into the archive.
Declaration
| Blok kódu | ||||
|---|---|---|---|---|
| ||||
INSERTARCHARR archIdent, locVarColValueIdent_Rec [,[retIdent_Int], bRecalcStat_Bool] |
Parameters
| 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 the Record type local variable. |
| retIdent_Int | out | Identifier of the Int type - return code: action success (optional parameter). |
| bRecalcStat_Bool | in | Identifier of the Bool type - enables/disables calculation of related statistical historical values (optional parameter, by default the calculations are enabled - @TRUE). |
Description
The action writes the value array for the archive object
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:- _ERR_TRANS_ABORT
- _ERR_TRANS_ERROR
- _ERR_TRANS_IGNORED
- _ERR_NO_ERROR
Note
If the identifier retIdent_Int is not stated, the script has no feedback to detect the action success. Action execution time is short, because it is a request, that is sent to the system.
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.
Example
Writing the value into the archive:
| Blok kódu | ||||
|---|---|---|---|---|
| ||||
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
|
| Blok kódu | ||||
|---|---|---|---|---|
| ||||
; writing INSERTARCHARR H.ArchObj, _data^value, _retCode |
| Blok kódu | ||||
|---|---|---|---|---|
| ||||
; action success test IF _retCode # _ERR_NO_ERROR THEN ; write error ENDIF |