dpCopyOriginal()
Copies the original value of the source data point to the target data point.
Synopsis
void dpCopyOriginal(string dpSource, string dpDestination, int
&error);
Parameters
Parameter | Meaning |
---|---|
dpSource | Source data point to be copied |
dpDestination | Target data point 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 data point does not exist. |
-11 | Wrong data point type. |
-12 | Source data point is identical to the target data point. |
Description
The function dpCopyOriginal() copies the original value of the source data point to the target data point. Also the original values of the sub elements are copied. The data point type of the source data point has to be same as the type of the target data point. The original values of the data points can also be copied between different systems (for example, from System1 to System2).
Example
The example copies the original value of the data point 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 data point contains elements the original values of the elements are copied automatically and do not have to be specified separately in the code.
Assignment
Data point function
Availability
UI, CTRL