Comments (8)
Update:
I found the problem.
def _parse_value(self, el, obj):
for val in el:
ntag = self._retag.match(val.tag).groups()[1]
obj.valuetype = ntag
if ntag in ("Int32", "UInt32"):
obj.value = int(val.text)
elif ntag in ('ByteString', 'String'):
mytext = val.text.replace('\n', '').replace('\r', '')
# obj.value.append('b"{}"'.format(mytext))
obj.value = mytext
elif ntag == "ListOfExtensionObject":
self.logger.info("Value type not implemented: %s", ntag)
elif ntag == "ListOfLocalizedText":
self.logger.info("Value type not implemented: %s", ntag)
else:
self.logger.info("Value type not implemented: %s", ntag)
Should probably throw a TODO in that code since the XML importer doesn't even support the OPC UA base variants.
For now I added this code:
elif ntag in ("Float"):
obj.value = float(val.text)
If I get time I will fork and implement all the base types.
from python-opcua.
So, another part of this issue with the importer.
The code that checks for a value won't write a "0.0" to the variable node.
def add_variable(self, obj):
...
if obj.value:
attrs.Value = ua.Variant(obj.value, getattr(ua.VariantType, obj.valuetype))
This if statement should probably check for null's instead (is not None), but I don't know if this would cause problem with other value data.
from python-opcua.
Yes parsing of values is half implemented. There is a bug for it. Would be
nice if you could fix it.
On Thu, Oct 29, 2015, 17:57 zerox1212 [email protected] wrote:
So, another part of this issue with the importer.
The code that checks for a value won't write a "0.0" to the variable node.
def add_variable(self, obj): ... if obj.value: attrs.Value = ua.Variant(obj.value, getattr(ua.VariantType, obj.valuetype))
This if statement should probably check for null's instead.
—
Reply to this email directly or view it on GitHub
#53 (comment)
.
from python-opcua.
After using the XML to import nodes, how can I access the nodes created by the server? For example if I want to subscribe to one.
server.get_node returns a node object even if the node doesn't exist.
Is there a way to get all the nodes that exist on the server?
from python-opcua.
get_node just constucts an Node object. If you want if the node is valid call a method from it.
it looks like you create a node which is child of node i=30001. so get that node and call get_children og get_child
s there a way to get all the nodes that exist on the server?
A server has so many nodes, you do not want to do that....
from python-opcua.
I got some time to add a few fixes to the xml importer. I submitted a pull request. I hope I did it correct, it's my first pull request ever.
from python-opcua.
Quick question:
How can I import the NodeID as String instead of Numeric? NodeID 30,000 isn't very nice.
from python-opcua.
from python-opcua.
Related Issues (20)
- Getting "BadSecurityChecksFailed" every few minutes for constant read requests HOT 2
- Problem with set value in OPC UA S7-1200 HOT 7
- Unable to subscribe to datachange when using Datavalue
- UA-Client reconciliate subscription not working HOT 4
- Duplicate endpoint when restarting server
- Cannot get value from alias HOT 14
- python OPCUA package installation failed in Linux ARM32V7 HOT 4
- Continues connection to opc ua - kepserver, and flask rest api HOT 1
- Callback function or event to intercept a write request on server
- How to use method call in client with complex arguments HOT 14
- Transfer Subscription Request
- SourceTime Stamp Issue HOT 1
- My simple python server error
- Unable to change variable value to True HOT 12
- Writing variables to ABB IRC5 controller using set_value() function HOT 4
- AttributeError: 'bytearray' object has no attribute 'public_key' HOT 7
- Disconnection of server session after 1 minute-TimeoutError
- Timeout error
- How to get node value HOT 4
- Triggering DataChangeEvent Only When Variant Value Changes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-opcua.