General Concept of Handshake

Each function of a module can be started with a handshake on two nodes, ready and request (Table 1). A function can also be started with a single write to its execute method instead, see Execute methods. The handshake of all LumiScan applications is described in Handshake; LumiScan Calibration follows its sequence exactly.

Table 1. Table 1: General Concept of Handshake: Addresses
Address Description

<module address>/control/<function name>/ready

Read-Only. Set by the module: true when the function can be started.

<module address>/control/<function name>/request

Writable. Set by the client to start the function.

<module address> is hdvisionsystems/lumiscan-calibration/<module name>, and the function name is transform or reset. A function’s inputs are under <module address>/input/ and its results under <module address>/output/. For each function’s nodes, see Table 2.

Running a function

  1. Wait until control/<function name>/ready is true.

  2. If the function has inputs, write them, for example input/x-coordinate and input/y-coordinate.

  3. Set control/<function name>/request to true.

  4. Wait until control/<function name>/ready is false: the module has seen the request.

  5. Set control/<function name>/request to false.

  6. The module runs the function.

  7. When the function has finished, control/<function name>/ready is true again.

  8. Read control/status/code, and the results under output/.

Functionality Execution Steps
%% 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/

Good to know:

  • The module waits for request to fall for as long as it takes. It has no timeout, because a request still true after one would be read as a new request.

  • A reset requested while a transform waits for its request to fall takes precedence: the transform is dropped, and the reset runs next.

  • An error status stays on control/status/code until the next request.

Make sure that only one process writes control/<function name>/request: if several processes change it independently, the module may miss a request. See Handshake: Rules.

A program that cannot coordinate with others can use the execute methods instead, which refuse a second call while one runs.