Porovnávané verzie
porovnané s
Kľúč
- Tento riadok sa pridal
- Riadok je odstránený.
- Formátovanie sa zmenilo.
UPDATEARCHVAL action
Function
Modification, or storing of a value into the archive.
Declaration
Blok kódu | ||||
---|---|---|---|---|
| ||||
UPDATEARCHVAL valueIdent, archIdent [,[retIdent_Int], bRecalcStat_Bool] |
Parameters
valueIdent | in | Identifier of a value that is to be written into the archive. |
archIdent | in | Reference to one of (historical) value - (not controlled whether |
a historical value is used - adding reference to any D2000 object is enough). | ||
retIdent_Int | out | Identifier of the Int type - return code: the action success (optional parameter). |
bRecalcStat_Bool | in | Identifier of the Bool type - enable/disable the calculation of |
depending statistical historical values (optional parameter). Possible values:
|
Description
The action modifies (or store a new) a value into the for the archive object historical value
archIdent
. The value is given by the identifier valueIdent
. Time of its storing into the archive database is the time when the value value valueIdent
occurred occurred. I If the identifier retIdent_Int is not statedspecified, the action doesn't wait for the storing confirmation (it is asynchronous). If the identifier is statedspecified, gains it obtains 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 statedspecified, there is no feedback to detect the action success. Action The action execution time is short, because it is only a request that is sent to the system.
If the identifier is statedspecified, the script waits for the physical storing of a value into the archive database.
ResultConsequence:
If I use the action to store a value into the archive without waiting and then I want to read this value, the read value almost certainly is not this the one , I that was stored in the by previous action.
Calculation of related depending statistical historical values can be disabled by setting the parameter bRecalcStat_Bool to the value of @FALSE.
Example
Storing a value into the archive:
Blok kódu | ||||
---|---|---|---|---|
| ||||
REAL _archVal TIME _archTime INT _retCode |
Blok kódu | ||||
---|---|---|---|---|
| ||||
; archiving time
_archTime := %StrToTime("12:0:0 1-12-2000") |
Blok kódu | ||||
---|---|---|---|---|
| ||||
; prepare a value together with time
_archVal := 1 TIME _archTime |
Blok kódu | ||||
---|---|---|---|---|
| ||||
; storing into the archive
UPDATEARCHVAL _archVal, H.Int, _retCode |
Blok kódu | ||||
---|---|---|---|---|
| ||||
; action success test IF _retCode # _ERR_NO_ERROR THEN ; error at storing ENDIF |