---
title: "Status Codes and Results"
description: "Module status codes of the LumiScan apps, the execution status of the finders, and the results of a method call on LumiScan Keryx, the ctrlX Data Layer and over OPC UA."
product: "LumiScan Keryx"
component: "lumiscan-keryx"
version: "1.0.0"
display_version: "1.0.0.7"
latest_version: true
language: "en"
url: "https://docs.hdvisionsystems.com/en/lumiscan-keryx/1.0.0/status-codes.html"
---

# Status Codes and Results – LumiScan Keryx

Two kinds of answers tell a client what happened:

- the **result of a call** - did the write or method call go through? - see [Results of a method call](https://docs.hdvisionsystems.com/en/lumiscan-keryx/1.0.0/status-codes.html#method-results);
- the **status** the app writes into a node - did the operation succeed? - see [Module status: `control/status/code`](https://docs.hdvisionsystems.com/en/lumiscan-keryx/1.0.0/status-codes.html#module-status) and [Execution status of the finders](https://docs.hdvisionsystems.com/en/lumiscan-keryx/1.0.0/status-codes.html#execution-status).

Use the numbers in program logic, never the texts.

## Module status: `control/status/code` {#module-status}

The Cam Driver, AI Object Matching and Calibration report the state of each module on `<module>/control/status/code` (`int32`) and `control/status/text`. The values `0` and above are normal, values below `0` are errors.

| Code | Text | Meaning |
| --- | --- | --- |
| `0` | `ready` | the last function succeeded; ready for the next |
| `1` | `settingUp` | the module is starting |
| `2` | `running` | a function runs |
| `3` | `waitingForClient` | waiting for the client, usually for `request` to fall |
| `-1` | `undefinedError` | no specific code |
| `-2` | `invalidSetting` | the settings could not be loaded |
| `-3` | `invalidInput` | an input is not valid |
| `-4` | `missingLicense` | the licence is missing |
| `-5` | `restartRequired` | the settings were changed through `system/settings`: restart the app |

App-specific codes, listed in each app’s manual:

| App | Codes |
| --- | --- |
| Cam Driver | `-10000` to `-10012` |
| Calibration | `-10001` (`inputXYSizeNotEqual`) |
| AI Object Matching | `100001` (`ImageQueueEmpty`), `100002` (`StreamActive`) |

## Execution status of the finders {#execution-status}

Template Finder, Object Finder, Area Detector and Text Reader write the outcome of each method to `<method>/output/status-code` (`int16`) and `status-text`. These values are their own, not the module status above:

| Code | Text |
| --- | --- |
| `1` | `ok` |
| `0` | `idle` |
| `-1` | `busy` |
| `-2` | `invalidInput` |
| `-3` | `imageReadFailed` |
| `-4` | `sourceNotFound` |
| `-5` | `cropInvalid` |
| `-6` | `writeFailed` |
| `-7` | `algorithmFailed` |
| `-8` | `publishFailed` |
| `-9` | `moduleNotFound` |
| `-10` | `moduleExists` |
| `-11` | `licenseUnavailable` |

Note that `-5` means `cropInvalid` here, but `restartRequired` in the module status.

## Results of a method call {#method-results}

A write to an `execute` node answers whether the operation could run. The names differ between the Data Layers; the meaning is the same.

| LumiScan Keryx | ctrlX Data Layer | OPC UA Connector | Meaning and what to do |
| --- | --- | --- | --- |
| `Ok` | `DL_OK` | `Good` | It ran. For the Cam Driver, AI Object Matching and Calibration, read `control/status/code` for the outcome |
| `TooManyOperations` | `DL_TOO_MANY_OPERATIONS` | `BadTooManyOperations` | Another operation of the module runs. Retry |
| `InvalidOperationMode` | `DL_INVALID_OPERATION_MODE` | `BadInvalidState` | The function is not ready: its `ready` is `false`, no licence, the camera is not connected, a stream runs. Bring the module into the state first; retrying alone keeps failing |
| `ResourceUnavailable` | `DL_RESOURCE_UNAVAILABLE` | `BadResourceUnavailable` | The app is stopping, a restart is required (status `-5`), or an AI module is in error. Read the status; restart the app when required |
| `Rejected` | `DL_INVALID_VALUE` | `BadRequestNotAllowed` | An input is not valid. Nothing changed. Correct the input |
| `NodeNotFound` | `DL_INVALID_ADDRESS` | `BadNodeIdUnknown` | An image, a source, a module or the node itself was not found. Check the address and its case |
| `CreationFailed` | `DL_CREATION_FAILED` | `BadCommunicationError` or `BadInternalError` | Something could not be written or made: a file, an existing module, an unavailable licence. The log says why |
| `InternalError` | `DL_FAILED` | `BadInternalError` | The operation failed. Read the status or the log |

On the ctrlX Data Layer, data a method attaches to a failed call does not reach the client, so a refused call carries no reason. The apps therefore write the reason to their log and, where they have one, to a status node.
