MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / create_subscription

Method create_subscription

opcua/server/server.py:388–406  ·  view source on GitHub ↗

Create a subscription. returns a Subscription object which allow to subscribe to events or data on server period is in milliseconds handler is a python object with following methods: def datachange_notification(self, node, val, data):

(self, period, handler)

Source from the content-addressed store, hash-verified

386 return Node(self.iserver.isession, nodeid)
387
388 def create_subscription(self, period, handler):
389 """
390 Create a subscription.
391 returns a Subscription object which allow
392 to subscribe to events or data on server
393 period is in milliseconds
394 handler is a python object with following methods:
395 def datachange_notification(self, node, val, data):
396 def event_notification(self, event):
397 def status_change_notification(self, status):
398 """
399 params = ua.CreateSubscriptionParameters()
400 params.RequestedPublishingInterval = period
401 params.RequestedLifetimeCount = 3000
402 params.RequestedMaxKeepAliveCount = 10000
403 params.MaxNotificationsPerPublish = 0
404 params.PublishingEnabled = True
405 params.Priority = 0
406 return Subscription(self.iserver.isession, params, handler)
407
408 def get_namespace_array(self):
409 """

Callers 1

_process_messageMethod · 0.45

Calls 1

SubscriptionClass · 0.90

Tested by

no test coverage detected