dpGetAsynch()

Reads values of data point attributes at a particular source time and writes them to variables.

Anmerkung: This function is only meaningful if the data point has been archived!
Anmerkung: If there is no value available at the specified time, the value of the element that was last saved before the query time is returned.

Synopsis

int dpGetAsynch(time t, string|dyn_string dp1, <type1>|<dyn_type1> &var1 [, string|dyn_string dp2, <type2>|<dyn_type2> &var2 ...]);

Parameter

Parameter Meaning
t source time
dp1, dp2, ... data point attributes to be read
Anmerkung: Please note that in the dpGetAsynch function, the parameter dp (data point) cannot be a dyn element, but each data point that you want to query must be specified separately.
var1, var2, ... variables to be written

Return Value

If the function was successfully executed, it returns 0 and in the event of a failure -1. The return value 0 only indicates that the message was correctly sent to Event Manager.

Errors

Independently of the return value, errors can be retrieved with getLastError() (nonexistent data points, missing arguments or no read permission).

Description

The function dpGetAsynch() reads the values of the data point attributes dp1, dp2, ... with the source time t from the database and writes them to the variables var1, var2, ... of the appropriate type.

If an alias is used for a query, this is passed as a parameter to the external query function; function calls for dpQuery() and alertGetPeriod().

With the help of dpGetAsynch() only attributes of the configs "_original", "_online", "_offline" and "_corr" can be retrieved. See also dpGetPeriod(). You can find information on querying whether the values of the required attribute are located in the database. The parameter t1 may not predate 1.1.1970 0:0 (UTC).

If a definition for a config or attribute does not exist, the following defaults are used:

Function Default
dpSet*() _original.._value
dpGet() _online.._value
dpGetAsynch() _offline.._value
dpGetPeriod() _offline.._value
dpConnect() _online.._value
dpDisconnect() _online.._value

Assignment of the valve regulation ratio from March the 5th, 12.30 to the variable x

main()
{
  dpGetAsynch(makeTime(1996, 3, 5, 12, 30), "Valve17.opening:_offline.._value", x);
}

Assignment

Data point function, waiting Control function

Availability

CTRL