%ARC_GetValue function


Function
The function gets the value of the specified object of Historical value in defined time.
Declaration
REAL %ARC_GetValue(
         in archObject,
         TIME in time,
         BOOL in exact
         [,BOOL in valid]
 )
Parameters
archObjectName of object of the Historical value type.
timeArchiving time.
exactThe parameter is important in periodical archiving - defines the behaviour of the function if the archive database does not contain a value with the time specified by the parameter time.
Possible values:
  • @TRUE - the function returns invalid value,
  • @FALSE - the function retrieves the value with nearest older time.

valid

An optional parameter with the same meaning as the VALID|INVALID clauses in the GETARCHVAL action. This parameter can be used to retrieve the last valid (@TRUE) or invalid (@FALSE) value for a given time (ignoring all subsequent values ​​that are not valid or invalid).

Example
The statement in the example below calculates the difference between current value of the object H.Arc1 and its value a minute ago.
 


H.Arch1 - %ARC_GetValue(H.Arch1, %NewTime(@EvalTime,0,0,0,-60),  @FALSE)
Note
The system constant @EvalTime - more information.
Napíšte komentár