NxLib API Access¶
The GenTL interface provides some custom features to allow direct access to the underlying NxLib API. This can be used to access NxLib functionality which is not wrapped in the GenTL interface.
The features can be used by the same name through both the interface and the remote device modules. When they are used from the remote device module some features automatically consider the module’s device as noted below.
Error Handling¶
Accessing the NxLib API can cause errors from the NxLib in addition to errors from the GenTL interface. To allow access to all relevant information these are not reported through the GenTL API but can be accessed from the EnsensoAPIErrorCode and EnsensoAPIErrorMessage features instead.
You should check EnsensoAPIErrorCode after each operation. It will be 0 when the operation was successful.
EnsensoAPIErrorCode- Type
- Integer
The error code resulting from the last NxLib API operation.
EnsensoAPIErrorMessage- Type
- String
The error message resulting from the last NxLib API operation.
Accessing the JSON Tree¶
To access nodes in the JSON tree set EnsensoJSONPath to the path to the node. Then execute the EnsensoJSONRead or EnsensoJSONWrite command to read or write this node.
EnsensoJSONPath- Type
- String
The path to an NxLib node that is accessed by the EnsensoJSONRead and EnsensoJSONWrite commands.
When using the features through the remote device module the path can be relative to the device node.
EnsensoJSONValue- Type
- String
The value of the NxLib node that was read by the EnsensoJSONRead command or that should be written by the EnsensoJSONWrite command as a JSON string.
EnsensoJSONRead- Type
- Command
Read the current value of the NxLib node at EnsensoJSONPath into EnsensoJSONValue.
NxLib errors which occurred during the operation are written to EnsensoAPIErrorCode and EnsensoAPIErrorMessage.
EnsensoJSONWrite- Type
- Command
Write the JSON value from EnsensoJSONValue into the NxLib node at EnsensoJSONPath. EnsensoJSONValue is updated to the node’s new value after writing.
NxLib errors which occurred during the operation are written to EnsensoAPIErrorCode and EnsensoAPIErrorMessage.
Executing Commands¶
To execute an NxLib command set EnsensoCommandParameters and EnsensoCommandName and then execute the EnsensoCommandExecute command.
When a command is executed through the remote device module the Cameras parameter is automatically set to this device unless it is overwritten in EnsensoCommandParameters.
EnsensoCommandParameters- Type
- String
Parameters for the command to be executed by EnsensoCommandExecute as a JSON string. This can be empty when the command does not need any parameters.
EnsensoCommandName- Type
- String
The name of the NxLib command to be executed by EnsensoCommandExecute.
EnsensoCommandResult- Type
- String
The result of the NxLib command last executed by EnsensoCommandExecute as a JSON string.
EnsensoCommandExecute- Type
- Command
Execute the NxLib command specified by EnsensoCommandParameters and EnsensoCommandName. The result of the command is written to EnsensoCommandResult.
NxLib errors which occurred during the operation are written to EnsensoAPIErrorCode and EnsensoAPIErrorMessage.