From 46d3a362a4899f2fb4f4f0ac4d35a4679719683c Mon Sep 17 00:00:00 2001
From: Arnaud Watlet <arnaud.watlet@umons.ac.be>
Date: Tue, 27 Feb 2024 18:04:05 +0100
Subject: [PATCH] implements test modbus

---
 ohmpi/tests.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ohmpi/tests.py b/ohmpi/tests.py
index 47af6997..92916215 100644
--- a/ohmpi/tests.py
+++ b/ohmpi/tests.py
@@ -455,9 +455,16 @@ def test_mux_connection(hw_nc, test_logger, mux_id=None):
 
 def test_pwr_connection(hw_nc, test_logger):
     tx = hw_nc.tx
+    pwr = hw_nc.pwr
     if tx.pwr.voltage_adjustable:
         try:
-            pass
+            if pwr.specs['interface_name'] == 'modbus':
+                pwr.specs['ctl'].reset_modbus()
+        except:
+            traceback.print_exc()
+            test_logger(colored(
+                f"{module_name}: Connection NOT established with {device} with address {hex(module.specs[f'{device}_address'])}.",
+                "red"))
         except:
             traceback.print_exc()
     else:
-- 
GitLab