From 04f3bb55221b43483b89c90da102ab4e15ac8b96 Mon Sep 17 00:00:00 2001 From: Manuele Conti Date: Wed, 8 Apr 2026 09:26:16 +0200 Subject: [PATCH] fix: preserve forced mapped digital outputs --- resources/sources/Baremetal/Baremetal.ino | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/resources/sources/Baremetal/Baremetal.ino b/resources/sources/Baremetal/Baremetal.ino index a55b64469..737018449 100644 --- a/resources/sources/Baremetal/Baremetal.ino +++ b/resources/sources/Baremetal/Baremetal.ino @@ -248,14 +248,9 @@ void modbusTask() //Read changes from clients mbtask(); - //Write changes back to OpenPLC Buffers - for (int i = 0; i < MAX_DIGITAL_OUTPUT; i++) - { - if (bool_output[i/8][i%8] != NULL) - { - *bool_output[i/8][i%8] = get_discrete(i, COILS); - } - } + // Do not mirror coil values back into mapped digital outputs. + // For located outputs (e.g. %QX0.0), debugger forcing updates the PLC variable + // directly. Copying COILS back here overwrites that value on every cycle. for (int i = 0; i < MAX_ANALOG_OUTPUT; i++) { if (int_output[i] != NULL)