To be completed (add example)
Search the specified model for the instance with an attribute value equal to the specified attribute. If the instance is found, the function returns completion code equal to 0 and the instance id of the instance via the argument <instance>. If the instance is not found, the function returns completion code equal to 0 and 0 via the argument <instance>.
This function can only return one instance value. Therefore this function should not be used if the persistent attribute hash table is not unique.If no attribute hash table is defined for the specified attribute, no sequential search is performed and the function returns an error code.
Related functions: edmiRemoteGetHashedAttrInstanceBN, edmiRemoteGetHashedAttrInstances, edmiRemoteGetHashedAttrInstancesBN
Header:
#include "sdai.h"
Prototype:
EdmiError edmiRemoteGetHashedAttrInstance(SdaiServerContext serverContextId, SdaiModel modelId, SdaiAttr attrId, SdaiString attrStringValue, SdaiInteger attrIntegerValue, SdaiInstance *instance, SdaiInvocationId *edmiInvocationId);
Arguments:
serverContextId |
Context identification, from edmiDefineServerContext |
modelId |
The modelId that uniquely identifies the edmModel in the remote EDMdatabase. |
attrId |
A numeric attributeId that uniquely identifies the attribute in the remote _EDMdatabase_ . |
attrStringValue |
If the attribute is of <string type>, use this argument to specify the attribute value to search for. |
attrIntegerValue |
If the attribute is of <integer type>, use this argument to specify the attribute value to search for. |
*instance |
Address of the variable where the searched instance id is returned. |
*edmiInvocationId |
Currently not used. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an _EDMinterface_ error code. Use edmiGetErrorText to get the error text corresponding to the error code.
Example:
EdmiError rstat;