Skip to content

Commit

Permalink
feat: add new OPC-UA functions
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarcoatl committed Aug 9, 2021
1 parent 7b665a2 commit 6a4ba1b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/system/__init__.py
Expand Up @@ -13,5 +13,5 @@
Scripting section.
"""

__version__ = "8.1.7"
__build__ = "2021060314"
__version__ = "8.1.9"
__build__ = "2021080617"
53 changes: 52 additions & 1 deletion src/system/opcua.py
Expand Up @@ -10,7 +10,42 @@

from __future__ import print_function

__all__ = ["callMethod"]
__all__ = ["addConnection", "callMethod", "removeConnection"]


def addConnection(
name,
description,
discoveryUrl,
endpointUrl,
securityPolicy,
securityMode,
settings,
):
"""Adds a new OPC UA connection.
Args:
name (str): Name to assign to the new connection.
description (str): Description assigned to the new OPC UA
connection.
discoveryUrl (str): Endpoint URL to use for discovery
services.
endpointUrl (str): Endpoint URL to use for session services.
securityPolicy (str): The name of the SecurityPolicy to use.
securityMode (str): The name of the MessageSecurityMode to
use.
settings (dict): A dictionary of additional settings to apply
to the connection.
"""
print(
name,
description,
discoveryUrl,
endpointUrl,
securityPolicy,
securityMode,
settings,
)


def callMethod(connectionName, objectId, methodId, inputs):
Expand All @@ -37,3 +72,19 @@ def callMethod(connectionName, objectId, methodId, inputs):
"""
print(connectionName, objectId, methodId, inputs)
return None, None, None


def removeConnection(name):
"""Removes an OPC UA Connection.
Args:
name (str): The name of the OPC UA connection to remove.
Returns:
bool: A boolean value representing whether the function was
able to remove the connection. Returns True if the
connection was successfully removed. Returns False if the
connection was not removed.
"""
print(name)
return True

0 comments on commit 6a4ba1b

Please sign in to comment.