The run Handshake
Every handshake module has one function, run, under v1/<module>/run/. It is the version 1 handshake of the LumiScan apps: one PLC function block serves every module of the Script Runner and every other app on version 1.
Nodes
| Node | Type | PLC variable | Meaning |
|---|---|---|---|
|
BOOL8 |
|
Written by the client. The run starts on its rising edge. |
|
BOOL8 |
|
|
|
BOOL8 |
|
|
|
BOOL8 |
|
|
|
BOOL8 |
|
|
|
INT32 |
|
The last run’s outcome: |
|
STRING |
The outcome in words. |
|
|
UINT64 |
Grows by one with every successful run. |
|
|
One node or image group per input on a node. |
||
|
One node or image group per output on a node. |
||
|
INT32, STRING |
The module’s state: why |
Sequence
| Step | Client | Module | ready |
running |
done |
has-error |
|---|---|---|---|---|---|---|
1 |
Waits for |
Idle. |
|
|
|
|
2 |
Writes |
Keeps the values. |
|
|
|
|
3 |
Sets |
Acknowledges ( |
|
|
|
|
4 |
Waits for |
On success: writes the outputs, increments |
|
|
|
|
5 |
Reads the outputs, or |
|||||
6 |
Sets |
Clears |
|
|
|
|
Rules
-
The inputs are taken when the run starts. A value written during a run is kept for the next run; it never changes the running one.
-
A failed input check ends the run before the procedure runs: a missing or wrong-kind value, a number outside min and max, an image of the wrong pixel type or size, an invalid handle from the store. Code
-3. -
A failed run writes no output. The output nodes keep the values of the last successful run. Check
done(orpackage-identifier) before you use them. -
Lowering
requestduring a run does not stop it. The run ends, and itsdoneorhas-errorstays until the next acknowledge. -
A request while
readyisfalseis not acknowledged. Readstatus/codeandstatus/textof the module to see why. -
There is no timeout. A procedure runs until it returns; your PLC program times out on its side.
-
One writer per
request. Do not let two clients drive the same module. -
A request in a busy group waits. While another module of the same group runs,
readystaystrue; the request is acknowledged and waits in the group’s queue.
PLC function block
Map one function block instance onto one module’s run folder:
| Function block | Node |
|---|---|
|
|
|
|
|
|
|
|
|
|
Write the module’s inputs before you raise xExecute, and read its outputs when xDone is true. Hold xExecute until you have read xDone or xError.