diff --git a/devices/PCC.py b/devices/PCC.py index 4dba0e7e8079f3afff69b76bf2e4b6491c7fab74..59c9dacf3de148c0fb66e06d4ee058be885b7e2d 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() # --------