Skip to content
Snippets Groups Projects
Commit 03c239ca authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-358: Move clock initialisation to APSCT, updated method stubs.

parent c106a1da
No related branches found
No related tags found
1 merge request!157L2SS-358: Get ready for Darkrai
...@@ -166,6 +166,8 @@ class OPCUAConnection(AsyncCommClient): ...@@ -166,6 +166,8 @@ class OPCUAConnection(AsyncCommClient):
def call_method(self, method_path, *args): def call_method(self, method_path, *args):
method_path = self.get_node_path(method_path)
raise NotImplementedError raise NotImplementedError
......
...@@ -71,11 +71,61 @@ class APSCT(opcua_device): ...@@ -71,11 +71,61 @@ class APSCT(opcua_device):
# overloaded functions # 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 # 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 # Run server
# ---------- # ----------
......
...@@ -117,7 +117,7 @@ class RECV(opcua_device): ...@@ -117,7 +117,7 @@ class RECV(opcua_device):
:return:None :return:None
""" """
self.opcua_connection.call_method(["2:PCC","2:RCU_off"]) self.opcua_connection.call_method(["RCU_off"])
@command() @command()
@DebugIt() @DebugIt()
...@@ -127,7 +127,7 @@ class RECV(opcua_device): ...@@ -127,7 +127,7 @@ class RECV(opcua_device):
:return:None :return:None
""" """
self.opcua_connection.call_method(["2:PCC","2:RCU_on"]) self.opcua_connection.call_method(["RCU_on"])
@command() @command()
@DebugIt() @DebugIt()
...@@ -137,7 +137,7 @@ class RECV(opcua_device): ...@@ -137,7 +137,7 @@ class RECV(opcua_device):
:return:None :return:None
""" """
self.opcua_connection.call_method(["2:PCC","2:ADC_on"]) self.opcua_connection.call_method(["ADC_on"])
@command() @command()
@DebugIt() @DebugIt()
...@@ -147,37 +147,7 @@ class RECV(opcua_device): ...@@ -147,37 +147,7 @@ class RECV(opcua_device):
:return:None :return:None
""" """
self.opcua_connection.call_method(["2:PCC","2:RCU_update"]) self.opcua_connection.call_method(["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"])
def _initialise_hardware(self): def _initialise_hardware(self):
""" Initialise the RCU hardware. """ """ Initialise the RCU hardware. """
...@@ -187,18 +157,6 @@ class RECV(opcua_device): ...@@ -187,18 +157,6 @@ class RECV(opcua_device):
logger.error("OPC-UA methods not supported yet, not initialising RCU hardware!") logger.error("OPC-UA methods not supported yet, not initialising RCU hardware!")
return 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 # Cycle RCUs
self.RCU_off() self.RCU_off()
self.wait_attribute("RECVTR_translator_busy_R", False, 5) self.wait_attribute("RECVTR_translator_busy_R", False, 5)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment