diff --git a/devices/clients/opcua_client.py b/devices/clients/opcua_client.py index d5e96d5d97b8beffc148790c5d507fa7f56d2039..ea91becc408aef56fb83eb1b110f5a1c15ae4872 100644 --- a/devices/clients/opcua_client.py +++ b/devices/clients/opcua_client.py @@ -166,6 +166,8 @@ class OPCUAConnection(AsyncCommClient): def call_method(self, method_path, *args): + method_path = self.get_node_path(method_path) + raise NotImplementedError diff --git a/devices/devices/apsct.py b/devices/devices/apsct.py index 6b65c1a66f006c8ccc6f1c36b384b898b1acb91f..debc132d4abff1f1c66a0a276104c679b463831b 100644 --- a/devices/devices/apsct.py +++ b/devices/devices/apsct.py @@ -71,11 +71,61 @@ class APSCT(opcua_device): # overloaded functions # -------- + def _initialise_hardware(self): + """ Initialise the APSCT hardware. """ + + # method calls don't work yet, so don't use them to allow the boot + # device to initialise us without errors + logger.error("OPC-UA methods not supported yet, not initialising APSCT hardware!") + return + + # Cycle clock + self.CLK_off() + self.wait_attribute("APSCTTR_translator_busy_R", False, 10) + self.CLK_on() + self.wait_attribute("APSCTTR_translator_busy_R", False, 10) + + if not self.APSCT_PLL_200MHz_locked_R: + if self.APSCT_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?") + # -------- # Commands # -------- + @command() + @DebugIt() + @only_when_on() + def CLK_off(self): + """ + + :return:None + """ + self.opcua_connection.call_method(["CLK_off"]) + + @command() + @DebugIt() + @only_when_on() + def CLK_on(self): + """ + + :return:None + """ + self.opcua_connection.call_method(["CLK_on"]) + + @command() + @DebugIt() + @only_when_on() + def CLK_PLL_setup(self): + """ + + :return:None + """ + self.opcua_connection.call_method(["CLK_PLL_setup"]) + # ---------- # Run server # ---------- diff --git a/devices/devices/recv.py b/devices/devices/recv.py index 4d86bda4bbd75ec89a775fd6e3f9820795017a9b..f2f15255c98a537e53a6732ee30730e26db67d12 100644 --- a/devices/devices/recv.py +++ b/devices/devices/recv.py @@ -117,7 +117,7 @@ class RECV(opcua_device): :return:None """ - self.opcua_connection.call_method(["2:PCC","2:RCU_off"]) + self.opcua_connection.call_method(["RCU_off"]) @command() @DebugIt() @@ -127,7 +127,7 @@ class RECV(opcua_device): :return:None """ - self.opcua_connection.call_method(["2:PCC","2:RCU_on"]) + self.opcua_connection.call_method(["RCU_on"]) @command() @DebugIt() @@ -137,7 +137,7 @@ class RECV(opcua_device): :return:None """ - self.opcua_connection.call_method(["2:PCC","2:ADC_on"]) + self.opcua_connection.call_method(["ADC_on"]) @command() @DebugIt() @@ -147,37 +147,7 @@ class RECV(opcua_device): :return:None """ - self.opcua_connection.call_method(["2:PCC","2:RCU_update"]) - - @command() - @DebugIt() - @only_when_on() - def CLK_off(self): - """ - - :return:None - """ - self.opcua_connection.call_method(["2:PCC","2:CLK_off"]) - - @command() - @DebugIt() - @only_when_on() - def CLK_on(self): - """ - - :return:None - """ - self.opcua_connection.call_method(["2:PCC","2:CLK_on"]) - - @command() - @DebugIt() - @only_when_on() - def CLK_PLL_setup(self): - """ - - :return:None - """ - self.opcua_connection.call_method(["2:PCC","2:CLK_PLL_setup"]) + self.opcua_connection.call_method(["RCU_update"]) def _initialise_hardware(self): """ Initialise the RCU hardware. """ @@ -187,18 +157,6 @@ class RECV(opcua_device): logger.error("OPC-UA methods not supported yet, not initialising RCU hardware!") return - # Cycle clock - self.CLK_off() - self.wait_attribute("CLK_translator_busy_R", False, 10) - self.CLK_on() - self.wait_attribute("CLK_translator_busy_R", False, 10) - - if not self.CLK_PLL_locked_R: - if self.CLK_I2C_STATUS_R > 0: - raise Exception("CLK I2C is not working. Maybe power cycle subrack to restart CLK board and translator?") - else: - raise Exception("CLK signal is not locked. The subrack probably do not receive clock input or the CLK PCB is broken?") - # Cycle RCUs self.RCU_off() self.wait_attribute("RECVTR_translator_busy_R", False, 5)