From 5e4254ae773eb580f9001859b36561f6ddda44c9 Mon Sep 17 00:00:00 2001 From: Thomas Juerges <4-jurges@users.noreply.git.astron.nl> Date: Fri, 2 Apr 2021 19:41:58 +0200 Subject: [PATCH] Add function mapping --- devices/PCC.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/devices/PCC.py b/devices/PCC.py index 4dba0e7e8..59c9dacf3 100644 --- a/devices/PCC.py +++ b/devices/PCC.py @@ -125,16 +125,6 @@ class PCC(hardware_device): def initialise(self): """ user code here. is called when the state is set to INIT """ - # Init the dict that contains function to OPC-UA function mappings. - self.function_mapping = {} - self.function_mapping["RCU_on"] = {} - self.function_mapping["RCU_off"] = {} - self.function_mapping["ADC_on"] = {} - self.function_mapping["RCU_update"] = {} - self.function_mapping["CLK_on"] = {} - self.function_mapping["CLK_off"] = {} - self.function_mapping["CLK_PLL_setup"] = {} - #set up the OPC ua client self.OPCua_client = OPCUAConnection("opc.tcp://{}:{}/".format(self.OPC_Server_Name, self.OPC_Server_Port), "http://lofar.eu", self.OPC_Time_Out, self.Standby, self.Fault, self) @@ -146,6 +136,16 @@ class PCC(hardware_device): except: pass + # Init the dict that contains function to OPC-UA function mappings. + self.function_mapping = {} + self.function_mapping["RCU_off"] = self.OPCua_client._setup_annotation(["2:PCC", "2:RCU_off"]) + self.function_mapping["RCU_on"] = self.OPCua_client._setup_annotation(["2:PCC", "2:RCU_on"]) + self.function_mapping["ADC_on"] = self.OPCua_client._setup_annotation(["2:PCC", "2:ADC_on"]) + self.function_mapping["RCU_update"] = self.OPCua_client._setup_annotation(["2:PCC", "2:RCU_update"]) + self.function_mapping["CLK_off"] = self.OPCua_client._setup_annotation(["2:PCC", "2:CLK_off"]) + self.function_mapping["CLK_on"] = self.OPCua_client._setup_annotation(["2:PCC", "2:CLK_on"]) + self.function_mapping["CLK_PLL_setup"] = self.OPCua_client._setup_annotation(["2:PCC", "2:CLK_PLL_setup"]) + self.OPCua_client.start() # -------- -- GitLab