dpRename()
The function renames a datapoint.
Synopsis
int dpRename(string oldName, string newName);
Parameter
| Parameter | Meaning |
|---|---|
| oldName | The old datapoint name. |
| newName | The new datapoint name. |
Return value
The function returns 0 if it was executed successfully and -1 in the event of an error.
Errors
Errors can be retrieved with getLastError().
Description
The function renames a datapoint. Refer to nameCheck() for not permitted characters.
Read also the chapter Rename Data points. Note the limitations of the chapter when renaming data points.
Currently all historic queries (dpGetPeriod, alertGetPeriod, dpGetAsynch, dpQuery) are performed using datapoint names and not IDs. When a datapoint is renamed, it's history is no longer accessible for NGA projects.
Example
Renames the datapoint "ExampleDP_Arg2" to ExampleDP_Arg2_new.
main()
{
dpRename("ExampleDP_Arg2", "ExampleDP_Arg2_new");
}
Assignment
Datapoint function
Availability
UI
