Skip to content

Commit

Permalink
update: example
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasHeine committed Jul 31, 2024
1 parent 88bfd4a commit 70484d2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion client/subscribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,20 @@ async def main():
nodes=nodes, # a list of nodes i want to subscribe to
attr=ua.AttributeIds.Value, # the attribute i am interested in
queuesize=50, # the queuesize should be bigger then the number of changes within a publishinterval, in this case 50 valuechanges per 1000 ms
monitoring=ua.MonitoringMode.Reporting
monitoring=ua.MonitoringMode.Reporting,
sampling_interval=250 # -1: Inherit from PublishInterval / 0: Eventbased / x: requested samping time (might be revised by the server)
)

# manually setting a filter (default in OPC UA Spec. is StatusValue)
# await subscription._subscribe(
# nodes,
# ua.AttributeIds.Value,
# ua.DataChangeFilter(ua.DataChangeTrigger.StatusValueTimestamp),
# 50,
# ua.MonitoringMode.Reporting,
# 250
# )

await asyncio.sleep(5)
await subscription.unsubscribe(node_handles)

Expand Down

0 comments on commit 70484d2

Please sign in to comment.