Execution modes
There are 3 modes in which you can execute a command:
- Standard mode: Execute once
- Continuous mode: Execute repeatedly until successful
- Repeat mode: Execute repeatedly, even after success, until aborted by the host
Standard mode
In standard mode, the command is executed once. The process is as follows:
- The host sends a command frame with ExecutionMode = 0.
- The reader executes the command.
-
The reader sends a response frame to the host, no matter if execution was successful or not. The response frame is sent after execution or, at the latest, after a command-specific timeout (see respective page in commands reference ).
Failed execution is indicated by the Failure and StatusCode fields.
Continuous mode
In continuous mode, the command is executed repeatedly until execution was successful. The process is as follows:
Invoke a command
- The host sends a command frame with ExecutionMode = 2.
- The reader executes the command repeatedly until execution is successful. Upon successful execution, the reader sends a response frame with the requested data and Phase = 2 to indicate the end of the command execution loop.
- If execution hasn't been successful within 50 ms after the reader has received the command frame, the reader sends a CmdWork status frame. This is to inform the host that the reader is still trying to execute the command successfully.
- As an option, you can configure the reader to periodically send additional CmdWork status frames until successful command execution. To do so, adjust the configuration value CmdWorkInterval (see Configuration reference > your protocol > Value CmdWorkInterval).
By default, CmdWorkInterval is set to indefinite, so the reader sends no additional CmdWork status frames after the first one.
Abort a command loop before successful execution
- The host sends an arbitrary (e.g. invalid) frame or a single byte.
- The reader ignores the transmitted data.
- After the command-specific timeout (see respective page in commands reference ), the reader aborts the command execution loop.
-
The reader sends a final response frame to the host with Phase = 2 to indicate the end of the execution loop.
The response frame contains a StatusCode for the last execution attempt.
Repeat mode
In repeat mode, the command is executed repeatedly as in continuous mode. However, the loop continues after successful execution and only stops when aborted by the host. The process is as follows:
Invoke a command
- The host sends a command frame with ExecutionMode = 1.
- The reader executes the command repeatedly until the host aborts the execution loop. This means that the host will receive an infinite number of response frames.
- The time gap between 2 response frames is defined by the configuration value RepeatModeMinDelay (see Configuration reference > your protocol > Value RepeatModeMinDelay). By default, it's 100 ms.
- As long as execution hasn't been successful, the reader sends 1 or more status frames. This works in the same way as in continuous mode.
Abort a command
This works exactly as in continuous mode. The reader sends a final response frame with Phase = 1.