# Optimizing Switch Nodes / OPCUA

**URL:** <https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524>\
**Category:** General\
**Created:** [31 May 2021 20:34 UTC](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524 "2021-05-31T20:34:45Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![psalibe](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@psalibe](https://discourse.nodered.org/u/psalibe)\
**Post date:** [18 June 2021 13:36 UTC](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524/21 "2021-06-18T13:36:07Z")

</div>

The inject interval is different for each metric, but they are happening quite a bit for the reads. I am not using registerNode...How does that work?

---

<div class="post-metadata">

**Author:** ![psalibe](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@psalibe](https://discourse.nodered.org/u/psalibe)\
**Post date:** [18 June 2021 19:46 UTC](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524/23 "2021-06-18T19:46:16Z")

</div>

![Screen Shot 2021-06-18 at 3.40.32 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/8/f8661f80c1f2253d81b10abeaeff31d5b08017b0.png)

Any solution to this?

---

<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:** [27 June 2021 13:41 UTC](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524/24 "2021-06-27T13:41:08Z")

</div>

I would put those single reads into one readMultiple

---

<div class="post-metadata">

**Author:** ![psalibe](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@psalibe](https://discourse.nodered.org/u/psalibe)\
**Post date:** [27 June 2021 18:37 UTC](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524/25 "2021-06-27T18:37:54Z")

</div>

I already have them going through one Client Node that reads them all.

---

<div class="post-metadata">

**Author:** ![tree-frog](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tree-frog/32/89303_2.png) [@tree-frog](https://discourse.nodered.org/u/tree-frog)\
**Post date:** [27 June 2021 19:23 UTC](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524/26 "2021-06-27T19:23:06Z")

</div>

Just notes on the topic.

A subscription to the server will only read tags that change state when they change. This is done on the servers time and duty.

A read single or multiple is asynchronous which forces the server to stop the synchronous subscription handling, and go get these (asynchronous) requested tags at command. It will stop cycling the states of the tag subscriptions and go get the states called for, then resume.

Are you wanting the values from a subscription to post when they change or are you stopping the server and forcing it to respond? Doing that also interrupts the server process temporarily and may change the timing on what your getting. It is quite possible to interrupt the server so often that it cannot serve subscriptions in a timely manner.

Then also consider how many other remote systems are connecting to the OPC server that it is busy handling.

---

<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:** [27 June 2021 21:16 UTC](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524/27 "2021-06-27T21:16:44Z")

</div>

Is action READ or READMULTIPLE?

---

<div class="post-metadata">

**Author:** ![psalibe](https://avatars.discourse-cdn.com/v4/letter/p/e9c0ed/32.png) [@psalibe](https://discourse.nodered.org/u/psalibe)\
**Post date:** [28 June 2021 18:21 UTC](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524/28 "2021-06-28T18:21:57Z")

</div>

action is READ and WRITE. When I use READMULTIPLE or WRITEMULTIPLE they dont work.

---

<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:** [28 June 2021 19:37 UTC](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524/29 "2021-06-28T19:37:33Z")

</div>

Can you share just that part of flow? I can update it to use READMULTIPLE / WRITEMULTIPLE, if not then I can make small example flow.  
It should improve performance and no warnings...

---

<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:** [28 June 2021 19:57 UTC](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524/30 "2021-06-28T19:57:39Z")

</div>

I added example here:  
[https://github.com/mikakaraila/node-red-contrib-opcua/issues/319](https://github.com/mikakaraila/node-red-contrib-opcua/issues/319)

---

<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:** [27 August 2021 19:57 UTC](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524/31 "2021-08-27T19:57:50Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/optimizing-switch-nodes-opcua/46524.md?page=1)
