Waiting¶
The following functions allow to wait for a certain value of an item:
nxLibWaitForChange¶
-
void nxLibWaitForChange(int32_t *result, const char *itemPath)¶
Wait for any change to the specified item, i.e. a change of value or item type.
- Parameters
result – The error code of the operation. If the item is deleted during the wait operation, the return code will be
NxLibItemInexistent
.itemPath – The path of the item to wait for.
nxLibWaitForType¶
-
void nxLibWaitForType(int32_t *result, const char *itemPath, int32_t nxLibItemType, int32_t waitForEqual)¶
Wait for a type change to the specified item. When the condition to wait for is already satisfied initially, the function returns immediately.
- Parameters
result – The error code of the operation. If the item is deleted during the wait operation, the return code will be
NxLibItemInexistent
.itemPath – The path of the item to wait for.
nxLibItemType – The constant corresponding to the type to wait for. See also
nxLibGetType()
.waitForEqual – When true, the function waits until the item has the specified type, otherwise it waits until the item has a different type than the one specified.
nxLibWaitForStringValue¶
-
void nxLibWaitForStringValue(int32_t *result, const char *itemPath, const char *value, int32_t waitForEqual)¶
Wait for specific string value of an item. When the condition to wait for is already satisfied initially, the function returns immediately.
- Parameters
result – The error code of the operation. If the item is deleted during the wait operation, the return code will be
NxLibItemInexistent
.itemPath – The path of the item to wait for.
value – The value to wait for.
waitForEqual – When true, the function waits until the item has the specified type, otherwise it waits until the item has a different type than the one specified.
nxLibWaitForIntValue¶
-
void nxLibWaitForIntValue(int32_t *result, const char *itemPath, int32_t value, int32_t waitForEqual)¶
Wait for specific integer value of an item. When the condition to wait for is already satisfied initially, the function returns immediately.
Note
According to the behavior of
nxLibGetInt()
the comparison for this condition is done with the rounded item value.- Parameters
result – The error code of the operation. If the item is deleted during the wait operation, the return code will be
NxLibItemInexistent
.itemPath – The path of the item to wait for.
value – The value to wait for.
waitForEqual – When true, the function waits until the item has the specified type, otherwise it waits until the item has a different type than the one specified.
nxLibWaitForDoubleValue¶
-
void nxLibWaitForDoubleValue(int32_t *result, const char *itemPath, double value, int32_t waitForEqual)¶
Wait for specific double value of an item. When the condition to wait for is already satisfied initially, the function returns immediately.
- Parameters
result – The error code of the operation. If the item is deleted during the wait operation, the return code will be
NxLibItemInexistent
.itemPath – The path of the item to wait for.
value – The value to wait for.
waitForEqual – When true, the function waits until the item has the specified type, otherwise it waits until the item has a different type than the one specified.
nxLibWaitForBoolValue¶
-
void nxLibWaitForBoolValue(int32_t *result, const char *itemPath, int32_t value, int32_t waitForEqual)¶
Wait for specific boolean value of an item. When the condition to wait for is already satisfied initially, the function returns immediately.
- Parameters
result – The error code of the operation. If the item is deleted during the wait operation, the return code will be
NxLibItemInexistent
.itemPath – The path of the item to wait for.
value – The value to wait for.
waitForEqual – When true, the function waits until the item has the specified type, otherwise it waits until the item has a different type than the one specified.