From bc6fc810633493740d8828201671aa1bdaf5be47 Mon Sep 17 00:00:00 2001 From: Thomas Juerges <4-jurges@users.noreply.git.astron.nl> Date: Fri, 2 Apr 2021 19:42:28 +0200 Subject: [PATCH] Add conditional use of the OPC_Namespace property --- devices/PCC.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devices/PCC.py b/devices/PCC.py index 59c9dacf3..4a76f5120 100644 --- a/devices/PCC.py +++ b/devices/PCC.py @@ -126,8 +126,11 @@ class PCC(hardware_device): """ user code here. is called when the state is set to INIT """ #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) + namespace = "http://lofar.eu" + if self.OPC_Namespace is not None: + namespace = self.OPC_Namespace + self.OPCua_client = OPCUAConnection("opc.tcp://{}:{}/".format(self.OPC_Server_Name, self.OPC_Server_Port), namespace, self.OPC_Time_Out, self.Standby, self.Fault, self) # map the attributes to the OPC ua comm client for i in self.attr_list(): -- GitLab