groupCreate()
Creates a new datapoint group and passes the name of the created datapoint of the group as well as the error code via parameters.
Synopsis
void groupCreate(langString ls, bool bPrivate, string &newGroup, bool
main, int &iError);
Parameters
| Parameter | Description |
|---|---|
| ls | Name of the datapoint group. |
| bPrivate |
Defines the type of the datapoint group. TRUE= Private datapoint group. FALSE = Public datapoint group. |
| newGroup |
Return value. Name of the datapoint of the new group with the syntax "_DpGroup<NNNNN>_<type>". If the limit of 7999 groups is reached, the function will search for an available group ID starting from the first group. If an available group ID is found, it is used. If no group indices are available, a new group can be created after you delete a group. |
| main |
Defines whether the new group should belong to the main group. TRUE = Main group (_DpGroup<NNNNN>_<type>.Level=1) FALSE = Not main group (_DpGroup<NNNNN>_<type>.Level=0) |
| iError |
Return value. Error code (see below). |
Return value
Name of the datapoint of the created datapoint group and the error code.
Error
The return value of the iError parameter indicates whether an error occurred during the creation of the datapoint group. The following error codes are available:
-
0 = OK, group was created without any failures
-
-1 = The user has not the permission to create a datapoint group
-
-8 = maximum number of datapoint groups reached
-
-9 = Group already exists
-
-10 = The name of the datapoint group is empty (ls parameter)
Description
Creates a new datapoint group and passes the name of the created datapoint of the group as well as the error code via parameters.
Example
The datapoint group MyDpGroup will be created.
main()
{
string newGroup;
int err;
groupCreate("MyDpGroup", false, newGroup, false, err);
DebugN(newGroup, err);
//Returns for example: ["_DpGroup00016_Public"][0]
}
Assignment
Datapoint function
Availability
CTRL
