# Subscribing to OPC UA Events

**URL:** https://discourse.nodered.org/t/subscribing-to-opc-ua-events/73903
**Category:** General
**Tags:** opcua
**Created:** [19 January 2023 09:38 UTC](https://discourse.nodered.org/t/subscribing-to-opc-ua-events/73903 "2023-01-19T09:38:17Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![haph-vi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haph-vi/32/49126_2.png) [@haph-vi](https://discourse.nodered.org/u/haph-vi)
#### Post date: [19 January 2023 09:38 UTC](https://discourse.nodered.org/t/subscribing-to-opc-ua-events/73903/1 "2023-01-19T09:38:17Z")

</div>

Hello,

I am using Node-RED 3.0.2 with node-red-contrib-opcua 0.2.292.  
I want to subscribe to events but I get no data and also no error.  
Subscribing/reading normal nodes (ExtensionObjects) works fine.  
If I subscribe to Events with uaExpert, I get the desired data:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/0/50fc7ceeb1c404ad3a73a66c817bf33447e9593f.png)

This is my flow:

```auto
    {
        "id": "ad464b54af5eb688",
        "type": "OpcUa-Event",
        "z": "3f73c5999eb84da2",
        "root": "i=2253",
        "activatecustomevent": false,
        "eventtype": "i=2041",
        "customeventtype": "ns=17;i=88",
        "name": "",
        "x": 380,
        "y": 2400,
        "wires": [
            [
                "f6954615cac75d82"
            ]
        ]
    },
    {
        "id": "cfe183dcfdf23d4d",
        "type": "inject",
        "z": "3f73c5999eb84da2",
        "name": "",
        "props": [],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "x": 190,
        "y": 2400,
        "wires": [
            [
                "ad464b54af5eb688"
            ]
        ]
    },
    {
        "id": "f6954615cac75d82",
        "type": "OpcUa-Client",
        "z": "3f73c5999eb84da2",
        "endpoint": "074b43a250e83847",
        "action": "events",
        "deadbandtype": "a",
        "deadbandvalue": 1,
        "time": "100",
        "timeUnit": "ms",
        "certificate": "n",
        "localfile": "",
        "localkeyfile": "",
        "securitymode": "None",
        "securitypolicy": "None",
        "folderName4PKI": "",
        "name": "OPC UA Client machine 11 S4 Events",
        "x": 630,
        "y": 2400,
        "wires": [
            [
                "f0a7bdfcba5aa42d"
            ]
        ]
    },
    {
        "id": "074b43a250e83847",
        "type": "OpcUa-Endpoint",
        "endpoint": "opc.tcp://10.10.151.71:62590",
        "secpol": "None",
        "secmode": "None",
        "none": false,
        "login": true,
        "usercert": false,
        "usercertificate": "",
        "userprivatekey": ""
    }
]

```

In both I used the Server Node and with the BaseEvent I should get all Events, like I get with uaExpert and checking all Types, right?

Did I make a mistake or is something missing?

Thanks!

---

<div class="post-metadata">

### Author: ![mikakaraila](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikakaraila/32/37496_2.png) [@mikakaraila](https://discourse.nodered.org/u/mikakaraila)
#### Post date: [2 February 2023 09:00 UTC](https://discourse.nodered.org/t/subscribing-to-opc-ua-events/73903/2 "2023-02-02T09:00:33Z")

</div>

Have you checked custom event type name space index? It seems to be quite big 17.  
Is your server loading so many nodesets or creates new name spaces...???

"activatecustomevent": false, **THIS SHOULD BE true!!**  
"eventtype": "i=2041",  
"customeventtype": "ns=17;i=88",

---

<div class="post-metadata">

### Author: ![haph-vi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haph-vi/32/49126_2.png) [@haph-vi](https://discourse.nodered.org/u/haph-vi)
#### Post date: [2 February 2023 09:17 UTC](https://discourse.nodered.org/t/subscribing-to-opc-ua-events/73903/3 "2023-02-02T09:17:04Z")

</div>

Yes this is correct, it is copied from uaExpert. I don't know why it is this big. The OPC UA Server is provided by the manufacturer and I don't have any insights.

activatecustomevent was false because used the baseEventType at the time, maybe the customeventtype was still in there from previous setting.

I wanted to answer here that it works now but I couldn't this week.  
So after using the correct customeventtype and a restart from the server everything works now. Even the eventdata is fetched correctly.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [16 February 2023 09:17 UTC](https://discourse.nodered.org/t/subscribing-to-opc-ua-events/73903/4 "2023-02-16T09:17:34Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
