General Concept of Handshake
The communication process in the LumiScan CamDriver application is based on the general concept of handshake. The naming convention for handshake parameters usually consists of the functionality and the names -ready or -request.
The handshake works for every operation except trigger. Most operations can also be started with a single
write to their execute node — see
Execute a Method for a comparison of the two
ways.
Each operation has a <parent address>/<functionality name>/ready node (read-only, set by the
application: true when the functionality may be started) and a
<parent address>/<functionality name>/request node (writable, set by you to start it). The general
handshake - its addresses, sequence and rules - is described in
Handshake. This page describes how the Cam Driver follows it.
Functionality Execution
|
To avoid repeating the entire address, in this section the invariant part containing the parent address and the variable functionality name (capture, connect-camera, disconnect-camera) have been replaced by XXX. Thus, the address: hdvisionsystems/lumiscan-cam-driver/<camera name>/control/connect-camera/ready will be written as XXX/ready.
|
Accordingly, the address: hdvisionsystems/lumiscan-cam-driver/<camera name>/control/connect-camera/request will be written as XXX/request.
|
Make sure there is only one process is accessing XXX/request at a time. The result of execution is undefined when: |
-
ProcessA set XXX/request to True.
-
ProcessB set XXX/request to False without considering ProcessA.
-
Our application might therefore miss XXX/request from ProcessA.
In order to execute a functionality, you need to run the following steps (see also Functionality Execution Steps):
-
Wait until XXX/ready is set to True.
-
Set XXX/request to True.
-
Wait until XXX/ready changes to False: the application has seen the request.
-
Set XXX/request to False.
-
Wait for the functionality to finish, and read its outcome: see the table below.
%% The ready/request handshake. Rendered by Mermaid in the browser; edit and preview at https://mermaid.live sequenceDiagram autonumber participant C as Client (PLC or program) participant M as Module M-->>C: ready = true: the function can be started C->>M: request = true M-->>C: ready = false: the request was seen C->>M: request = false Note over M: runs the function M-->>C: ready = true: the function has finished C->>M: read control/status/code and output/
When a Functionality Runs
Only one request is served at a time, in this order: reset, connect-camera,
disconnect-camera, save, capture, load, list-images, remove.
| Functionality | Runs | At the end |
|---|---|---|
|
At once, as soon as the application sees the request: it does not wait for XXX/request to fall.
|
Success: |
|
After XXX/request has fallen. |
|
A failed capture, reset, save or load is latched: its status stays until a reset
succeeds. (A save before anything was captured, -10005, is not latched.) Any other error stays
on status/code for about 100 ms only, then 0 replaces it. So check whether the camera is
connected with hdvisionsystems/lumiscan-cam-driver/<camera name>/device-info/is-connected, not
with the status.
To read the outcome of a capture directly, use control/capture/execute instead. The status then
keeps the capture’s own code. See Execute a Method.