dpSetDescription()

Sets a comment for the datapoint element dp.

The function replaces dpSetComment(), which remains for compatibility!

Synopsis

int dpSetDescription (string dp, langString comment);

Parameters

Parameter Meaning
dp datapoint element to be commented on
comment comment

Return Value

If successful 0, otherwise -1.

Errors

Errors can be retrieved with getLastError(). An error message is issued in the event of incorrect DPs or missing arguments!

Description

The function dpSetDescription() sets a comment for the datapoint element dp. This comment can be retrieved with the help of the function dpGetDescription(). Comments are not archived historically. Comments which have been replaced can therefore no longer be retrieved!

The function replaces dpSetComment(), which is conserved for compatibility.

The use of "@" or another character used as DPCommentSeparator, will result in the datapoint comment being separated at the character. The characters after the first "@" character will be saved as datapoint format, the characters after the second "@" as the datapoint unit. Should the "@"character be needed, the separator character can be changed with the config entry [general] DPCommentSeperator.

Example

A new datapoint is created, a comment is written and then read out again for checking.

main()
{
   dpCreate("number_1","ExampleDP_Int");
// new DP
   dpSetDescription("number_1.","Here is the comment");
   DebugN(dpGetDescription("number_1."));
//output in the log viewer
}

Assignment

Datapoint function, waiting Control function

Availability

CTRL