freeopcua icon indicating copy to clipboard operation
freeopcua copied to clipboard

Add AlarmCondition fields to CustomEvent

Open awcullen opened this issue 6 years ago • 3 comments

What would it take to add the AlarmCondition fields to the Event type (or Custom EventType).

Could I add the properties to this call: #Not working alarmType = server.create_custom_event_type(idx, 'MyFirstAlarm', ua.ObjectIds.AlarmConditionType, [('0:ConditionId', ua.VariantType.NodeId), ('0:BranchId', ua.VariantType.NodeId), ('0:Retain', ua.VariantType.Boolean)])

I'm looking to have a server trigger alarm conditions that will show in UaExpert.

awcullen avatar Nov 08 '17 20:11 awcullen

Found workaround solution at https://github.com/FreeOpcUa/python-opcua/issues/278

awcullen avatar Nov 09 '17 02:11 awcullen

Is it possible to implement client receiving alarms using python opcua?

ayonaphilipose avatar Apr 30 '19 11:04 ayonaphilipose

First create a notification handler class:

class Handler(object):

    def datachange_notification(self, node, val, data):
        print("Data change: ", node, val)
    
    def event_notification(self, event):
        print("Event: ", event)

In your main:

        # Create subscription to server Events.
        sub = client.create_subscription(250, Handler())
       # Subscribe to receive BaseEventType from Server node.
        handle1 = sub.subscribe_events() 

awcullen avatar Apr 30 '19 12:04 awcullen