getErrorManId()

Returns the manager identifier from getLastError() from the error class.

Synopsis

int getErrorManId(errClass err | dyn_errClass err);

Parameters

Parameter Description
err Return value from getLastError( ). The parameter dyn_errClass returns the element of the LAST (!!) error that occurred.

Return value

The manager identifier relating to the error as an integer. The manager identifier consists of replica (R), system number (S), manager type (T) and number (N) in the following format 0xRRSSTTNN. In non-redundant systems, the replica is 1. In non-distributed systems the system number is 1.

Error

Missing or invalid argument.

Description

The value returned from the Control function getLastError() defines an error class that is composed of several attributes. From this, the manager identifier (replica, system number, manager type and number) can be filtered out with getErrorManId(). In the following example, an error (an incorrect data point name) has been created on purpose so that the error can be caught with the function getLastError() and the related manager (the error is related to) will be returned with the function getErrorManId().

Example

main()
{
  string dpType = "ExampleDP_Int";
                                
  string name = "NewDP$";
                                
  /*Data point name may not contain a $ sign. Here an
  incorrect name is created on purpose so that the error is
  catched via the function getLastError() and the related
  manager(the error is related to) is returned via the function
  getErrorManId()*/
  dyn_errClass err;
  int manId;
  dpCreate(name,dpType); //dpCreate with an incorrect dpName
  err = getLastError();
  manId = getErrorManId(err); //returns the related manager
  identifier
  DebugN("The error relates to manager", manId); 
  //Shows the related manager identifier
}

Assignment

Errors

Availability

CTRL