dpCopyOriginal()
Copies the original value of the source datapoint to the target datapoint.
Synopsis
void dpCopyOriginal(string dpSource, string dpDestination, int
&error);
Parameters
| Parameter | Meaning |
|---|---|
| dpSource | Source datapoint to be copied |
| dpDestination | Target datapoint including the configuration of the source data point. Note that the dp has to exist and is NOT created by calling the dpCopyOriginal(). |
| error | Return value of the error code |
Return Value
None
Errors
An error code is returned via the variable error, which means the following:
| Error code | Meaning |
|---|---|
| 0 | OK, copying successful |
| -1 | Source DP does not exist. |
| -2 | Destination DP empty |
| -3 | Acknowledgement not possible |
| -4 | Deactivation of alert not possible |
| -5 | Setting of configs produced an error |
| -6 | The query of configs produced an error |
| -7 | The query of the config content produced an error. |
| -10 | The target datapoint does not exist. |
| -11 | Wrong datapoint type. |
| -12 | Source datapoint is identical to the target datapoint. |
Description
The function dpCopyOriginal() copies the original value of the source datapoint to the target datapoint. Also the original values of the sub elements are copied. The datapoint type of the source datapoint has to be same as the type of the target datapoint. The original values of the datapoints can also be copied between different systems (for example, from System1 to System2).
Example
The example copies the original value of the datapoint ExampleDP_Arg1 to ExampleDP_Arg2.
main()
{
string a = "ExampleDP_Arg1";
string b = "ExampleDP_Arg2";
int error;
dpCopyOriginal(a, b, error);
DebugN(error);
}
Note that when a datapoint contains elements the original values of the elements are copied automatically and do not have to be specified separately in the code.
Assignment
Datapoint function
Availability
UI, CTRL
