From b8a7b4b25def9cfffb43f49af6bbee601ce4850f Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Thu, 4 Nov 2021 10:35:53 +0000
Subject: [PATCH] L2SS-470: Fix interface of APSCT

---
 .../tangostationcontrol/devices/apsct.py       | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/tangostationcontrol/tangostationcontrol/devices/apsct.py b/tangostationcontrol/tangostationcontrol/devices/apsct.py
index 5d2ddf5b0..476c8306e 100644
--- a/tangostationcontrol/tangostationcontrol/devices/apsct.py
+++ b/tangostationcontrol/tangostationcontrol/devices/apsct.py
@@ -76,11 +76,11 @@ class APSCT(opcua_device):
         # Cycle clock
         self.APSCT_off()
         self.wait_attribute("APSCTTR_translator_busy_R", False, 10)
-        self.APSCT_on()
+        self.APSCT_200MHz_on()
         self.wait_attribute("APSCTTR_translator_busy_R", False, 10)
 
         if not self.proxy.APSCT_PLL_200MHz_locked_R:
-            if self.proxy.APSCT_I2C_error_R:
+            if self.proxy.APSCTTR_I2C_error_R:
                 raise Exception("I2C is not working. Maybe power cycle subrack to restart CLK board and translator?")
             else:
                 raise Exception("200MHz signal is not locked. The subrack probably do not receive clock input or the CLK PCB is broken?")
@@ -102,12 +102,22 @@ class APSCT(opcua_device):
     @command()
     @DebugIt()
     @only_in_states([DevState.STANDBY, DevState.ON])
-    def APSCT_on(self):
+    def APSCT_200MHz_on(self):
         """
 
         :return:None
         """
-        self.opcua_connection.call_method(["APSCT_on"])
+        self.opcua_connection.call_method(["APSCT_200MHz_on"])
+
+    @command()
+    @DebugIt()
+    @only_in_states([DevState.STANDBY, DevState.ON])
+    def APSCT_160MHz_on(self):
+        """
+
+        :return:None
+        """
+        self.opcua_connection.call_method(["APSCT_160MHz_on"])
 
 
 # ----------
-- 
GitLab