Commit 0ddb3f2c authored by Helmut Jacob's avatar Helmut Jacob Committed by oroulet

Fix OperationLimits data type to UInt32

According to OPC Unified Architecture, Part 5, 6.3.11
OperationLimitsType all Max* properties shall have datatype
UInt32.

Fix this by explicitly setting the variant type to UInt32
instead of defaulting to Int64.

This fixes connectivity issues with the KepwareServerEx OPC-UA client.

Introduced in 21432df9
parent b3760f54
......@@ -103,7 +103,7 @@ class InternalServer:
attr = ua.WriteValue()
attr.NodeId = ua.NodeId(nodeid)
attr.AttributeId = ua.AttributeIds.Value
attr.Value = ua.DataValue(ua.Variant(10000), ua.StatusCode(ua.StatusCodes.Good))
attr.Value = ua.DataValue(ua.Variant(10000, ua.VariantType.UInt32), ua.StatusCode(ua.StatusCodes.Good))
attr.Value.ServerTimestamp = datetime.utcnow()
params.NodesToWrite.append(attr)
result = await self.isession.write(params)
......@@ -126,7 +126,7 @@ class InternalServer:
# path was supplied, but file doesn't exist - create one for next start up
await self.loop.run_in_executor(None, self.aspace.make_aspace_shelf, shelf_file)
def _address_space_fixes(self) -> Coroutine:
async def _address_space_fixes(self) -> Coroutine:
"""
Looks like the xml definition of address space has some error. This is a good place to fix them
"""
......@@ -136,13 +136,17 @@ class InternalServer:
it.IsForward = False
it.TargetNodeId = ua.NodeId(ua.ObjectIds.ObjectTypesFolder)
it.TargetNodeClass = ua.NodeClass.Object
it2 = ua.AddReferencesItem()
it2.SourceNodeId = ua.NodeId(ua.ObjectIds.BaseDataType)
it2.ReferenceTypeId = ua.NodeId(ua.ObjectIds.Organizes)
it2.IsForward = False
it2.TargetNodeId = ua.NodeId(ua.ObjectIds.DataTypesFolder)
it2.TargetNodeClass = ua.NodeClass.Object
return self.isession.add_references([it, it2])
results = await self.isession.add_references([it, it2])
for res in results:
res.check()
def load_address_space(self, path):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment