v1.0 HF4
This commit is contained in:
parent
283879ae10
commit
88eb33fde4
@ -20,7 +20,7 @@ class opcua_connector:
|
||||
self.varlist_dict = self.read_varlist(config['data']["cfg_varlist"])
|
||||
self.opcuaclient.session_timeout = 60000
|
||||
|
||||
make_cert()
|
||||
#make_cert()
|
||||
|
||||
|
||||
def connect(self):
|
||||
@ -28,7 +28,7 @@ class opcua_connector:
|
||||
connect to the robot
|
||||
'''
|
||||
try:
|
||||
self.opcuaclient.set_security_string("Basic256Sha256,SignAndEncrypt,.cert/cert.der,.cert/key.pem")
|
||||
#self.opcuaclient.set_security_string("Basic256Sha256,SignAndEncrypt,.cert/cert.der,.cert/key.pem")
|
||||
self.opcuaclient.connect()
|
||||
except Exception as e:
|
||||
raise e
|
||||
@ -77,15 +77,15 @@ class opcua_connector:
|
||||
object_node = self.opcuaclient.get_node("ns=2;s=/Methods")
|
||||
object_node.call_method(method_node, self.config['cred']["robot"]["username"], access_rights)
|
||||
|
||||
def _get_opcua_data(self, var_list):
|
||||
""" Retrieve OPC UA node values based on the list of variable nodes. """
|
||||
return [self.opcuaclient.get_node(var).get_value() for var in var_list]
|
||||
def _get_opcua_data(self, var_list):
|
||||
""" Retrieve OPC UA node values based on the list of variable nodes. """
|
||||
return [self.opcuaclient.get_node(var).get_value() for var in var_list]
|
||||
|
||||
|
||||
def _sent_opcua_data_impuls(self, var):
|
||||
node = self.opcuaclient.get_node(var)
|
||||
node.set_value(1) # Set node to 1
|
||||
# time.sleep(1) # Wait for 1 second
|
||||
# node.set_value(0) # Set node back to 0
|
||||
def _sent_opcua_data_impuls(self, var):
|
||||
node = self.opcuaclient.get_node(var)
|
||||
node.set_value(1) # Set node to 1
|
||||
# time.sleep(1) # Wait for 1 second
|
||||
# node.set_value(0) # Set node back to 0
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user