runtime/Modbus_config.py
changeset 2665 978cf239c689
parent 2661 9d08e3bba629
child 2666 5f48d5e60a81
--- a/runtime/Modbus_config.py	Sun Jun 07 19:33:32 2020 +0100
+++ b/runtime/Modbus_config.py	Sun Jun 07 22:32:24 2020 +0100
@@ -383,8 +383,6 @@
         if value is not None:
             newConfig[par_name] = value
 
-    _WebNodeList[WebNode_id]["WebviewConfiguration"] = newConfig
-    
     # First check if configuration is OK.
     # Note that this is not currently required, as we use drop down choice menus
     # for baud, parity and sop bits, so the values should always be correct!
@@ -399,6 +397,11 @@
     # Configure PLC with the current Modbus parameters
     _SetPLCConfiguration(WebNode_id, newConfig)
 
+    # Update the viewable configuration
+    # The PLC may have coerced the values on calling _SetPLCConfiguration()
+    # so we do not set it directly to newConfig
+    _WebNodeList[WebNode_id]["WebviewConfiguration"] = _GetPLCConfiguration(WebNode_id)
+
     # File has just been created => Delete button must be shown on web interface!
     _updateWebInterface(WebNode_id)