Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
64cd8399
Commit
64cd8399
authored
Jun 18, 2015
by
ORD
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8 from iirob/master
Extended Node.set_value() to receive ua.DataValue objects directly.
parents
5c10a9c2
3f93df0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
.gitignore
.gitignore
+2
-0
opcua/node.py
opcua/node.py
+7
-5
No files found.
.gitignore
View file @
64cd8399
...
...
@@ -4,3 +4,5 @@ MANIFEST
htmlcov*
_*
docs/_*
*.pyc
opcua/node.py
View file @
64cd8399
...
...
@@ -172,12 +172,14 @@ class Node(object):
Set value of a node. Only variables(properties) have values.
An exception will be generated for other node types.
"""
variant
=
None
if
isinstance
(
value
,
ua
.
Variant
):
variant
=
value
datavalue
=
None
if
isinstance
(
value
,
ua
.
DataValue
):
datavalue
=
value
elif
isinstance
(
value
,
ua
.
Variant
):
datavalue
=
ua
.
DataValue
(
value
)
else
:
variant
=
ua
.
Variant
(
value
,
varianttype
)
self
.
set_attribute
(
ua
.
AttributeIds
.
Value
,
ua
.
DataValue
(
variant
)
)
datavalue
=
ua
.
DataValue
(
ua
.
Variant
(
value
,
varianttype
)
)
self
.
set_attribute
(
ua
.
AttributeIds
.
Value
,
datavalue
)
def
set_attribute
(
self
,
attributeid
,
datavalue
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment