Item Value Retrieval¶
nxLibGetJson¶
-
const char *nxLibGetJson(int32_t *result, const char *itemPath, int32_t prettyPrint, int32_t numberPrecision, int32_t allowScientificFormat)¶
Retrieves an item value or an entire subtree in JSON representation.
- Parameters
result – A pointer to a variable for the return code of the operation. The following function specific return codes can occur:
NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibItemInexistent
- The item at the given path does not exist.NxLibItemPathInvalid
- The given path contains forbidden characters.
itemPath – The path of the item to access
prettyPrint – Specify
true
here to format the resulting string with line breaks and tabs.numberPrecision – The floating point precision of the returned numbers.
allowScientificFormat – Specifies whether to allow scientific notation.
- Returns
A JSON string representing the item value or subtree. Please refer to the string type description for information about usage restrictions applying to the returned pointer.
nxLibGetInt¶
-
int32_t nxLibGetInt(int32_t *result, const char *itemPath)¶
Retrieves the value of a Number item as integer.
- Parameters
result – A pointer to a variable for the return code of the operation. The following function specific return codes can occur:
NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibItemInexistent
- The item at the given path does not exist.NxLibItemPathInvalid
- The given path contains forbidden characters.NxLibItemTypeNotCompatible
- The item type you tried to read is of another type than you specified or the item you tried to write cannot be overwritten with the type you specified because its structure is locked.
itemPath – The path of the item to access.
- Returns
The integer value of the item. If the item’s number value was a floating point number, the rounded value will be returned.
nxLibGetDouble¶
-
double nxLibGetDouble(int32_t *result, const char *itemPath)¶
Retrieves the value of a Number item as floating point.
- Parameters
result – A pointer to a variable for the return code of the operation. The following function specific return codes can occur:
NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibItemInexistent
- The item at the given path does not exist.NxLibItemPathInvalid
- The given path contains forbidden characters.NxLibItemTypeNotCompatible
- The item type you tried to read is of another type than you specified or the item you tried to write cannot be overwritten with the type you specified because its structure is locked.
itemPath – The path of the item to access.
- Returns
The floating point value of the item.
nxLibGetBool¶
-
int32_t nxLibGetBool(int32_t *result, const char *itemPath)¶
Retrieves the value of a Boolean item.
- Parameters
result – A pointer to a variable for the return code of the operation. The following function specific return codes can occur:
NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibItemInexistent
- The item at the given path does not exist.NxLibItemPathInvalid
- The given path contains forbidden characters.NxLibItemTypeNotCompatible
- The item type you tried to read is of another type than you specified or the item you tried to write cannot be overwritten with the type you specified because its structure is locked.
itemPath – The path of the item to access.
- Returns
The boolean value of the item.
nxLibGetString¶
-
const char *nxLibGetString(int32_t *result, const char *itemPath)¶
Retrieves the value of a String item.
- Parameters
result – A pointer to a variable for the return code of the operation. The following function specific return codes can occur:
NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibItemInexistent
- The item at the given path does not exist.NxLibItemPathInvalid
- The given path contains forbidden characters.NxLibItemTypeNotCompatible
- The item type you tried to read is of another type than you specified or the item you tried to write cannot be overwritten with the type you specified because its structure is locked.
itemPath – The path of the item to access.
- Returns
The string value of the item. Please refer to the string type description for information about usage restrictions applying to the returned pointer.
nxLibGetBinary¶
-
void nxLibGetBinary(int32_t *result, const char *itemPath, void *destinationBuffer, int32_t bufferSize, int32_t *bytesCopied, double *timestamp)¶
Retrieves data of a Binary item.
- Parameters
result – A pointer to a variable for the return code of the operation. The following function specific return codes can occur:
NxLibInvalidParameters
- One, multiple, or a combination of parameters are invalid.NxLibItemInexistent
- The item at the given path does not exist.NxLibItemPathInvalid
- The given path contains forbidden characters.NxLibItemTypeNotCompatible
- The item type you tried to read is of another type than you specified or the item you tried to write cannot be overwritten with the type you specified because its structure is locked.NxLibBufferTooSmall
- The item could not be copied to the users buffer because the buffer is too small.
itemPath – The path of the item to access.
destinationBuffer – A pointer to the memory, where the item content should be copied.
bufferSize – The size of the destination buffer in bytes.
bytesCopied – A pointer to an integer. The variable will be filled with the actual number of bytes written to the buffer.
timestamp – The current timestamp of the binary blob queried. This pointer can be set to
nullptr
when the timestamp should not be retrieved. The returned value should only be relied upon if the function returnsNxLibOperationSucceeded
.