evok icon indicating copy to clipboard operation
evok copied to clipboard

[Bug]: Cannot define DO and RO for more than 16 channels (coil/register overflow issue)

Open kratochvil01 opened this issue 7 months ago • 3 comments

Prerequisites

  • [x] I am running the latest Evok version
  • [x] I have searched other issues

Describe the bug

Currently, EVOK does not support defining Digital Outputs (DO) or Relay Outputs (RO) for more than 16 channels.

The implementation uses coils for writing and registers for reading, but it fails to handle cases where the channel index exceeds 16. In such situations, the logic does not properly manage the overflow into the next register/coil block, making it impossible to work with devices that expose more than 16 outputs.

Evok log

No response

Steps to reproduce

  1. Configure a device with more than 16 DO/RO channels.
  2. Attempt to access channel 17 (or higher).
  3. Observe that the operation fails, as EVOK does not process the overflow into the next register.

Expected behavior

EVOK should handle more than 16 DO/RO channels correctly by managing the overflow into subsequent coil/register addresses.

Actual behavior

Attempts to use channels beyond 16 fail, as EVOK only considers the first register/coil block.

kratochvil01 avatar Sep 10 '25 13:09 kratochvil01

Proposed Solution

It is necessary to add register iteration when creating RO and DO devices.

This iteration must always be performed at the 16th channel. However, the relay name must still correspond to the channel number. This will ensure the functionality of DO and RO with more than 16 channels.

kratochvil01 avatar Sep 10 '25 18:09 kratochvil01

duplicate of #195 ?

cleveHEX avatar Sep 11 '25 07:09 cleveHEX

duplicate of #195 ?

It seems so. The issue you mention describes a specific error on a specific device. Here is a general description of how and when the error occurs.

I suggest set up the issue you mention as the parent of this one.

kratochvil01 avatar Sep 11 '25 11:09 kratochvil01