dpSetTimed()

Assigns values and a source time to the original attributes that can be changed by the user or to the attribute "_corr.._value".

Synopsis

int dpSetTimed(time t, string dp1, <type1> val1[, string dp2, <type2> val2, ...]);

int dpSetTimed(time t, dyn_string dpnames, dyn_anytype values);

Parameters

Parameter Meaning
t Source time
dp1, dp2, ... Original attributes
val1, val2, ... Values to be assigned

Return value

The function dpSetTimed() usually returns 0, in the event of a failure, however, it returns -1.

Errors

Errors can be retrieved with getLastError(). The return value is then the appropriate error code. An alert is issued in the event of non-existent data points, incorrect parameter transfers or spelling errors.

Description

The function dpSetTimed() assigns the values val1, val2, ... and the source time to the original attributes dp1, dp2, ..., which may be changed by the user (the user is allowed to change the original attributes "_value", "_active", "_exp_default", "_exp_inv" und "_per_active" as wel as the user defined bits "_userbit1", "_userbit2" bis "_userbit8". Original attributes are the attributes of the config "_original"), or the attribute "_corr.._value. Any number of pairs of modifiable original attributes and values can be transferred to the function dpSetTimedWait(). The data point attributes are transferred as a string, the data type of the value depends on the attribute in question.

In one dpSetWait() function it is not allowed to assign a value to the same data point attribute several times. In this event only the first assignment is accepted and the other ones are discarded. The return value is 0, an appropriate error can be retrieved with getLastError().

The time t may not predate 1.1.1970 0:0 (UTC).

If there exists no definition for a config or attribute, the following defaults are used and added internal:

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

The history of alert configs whose time is set to 0, is not saved. The last value is, however, saved in the database.

VORSICHT: To avoid an increasing size of the configuration history the time of the configs _alert_hdl and _alert_class can be set with dpSetTimed(0,...). All other configs do not have a configuration history, therefore a dpSetTimed(0,....); is not necessary and also not supported for these configs.

Example

Correction of the value from data point element valve17.opening for the 5. March 1996, 12 h 30:

main()
{
  dpSetTimed(makeTime(1996,3,5,12,30),"valve17.opening:_corr.._value",40.);
}

Assignment

Data point function

Availability

CTRL