# OPC UA Multiple Interval settings while using Subscription

**URL:** <https://discourse.nodered.org/t/opc-ua-multiple-interval-settings-while-using-subscription/71739>\
**Category:** Industrial\
**Tags:** opcua\
**Created:** [6 December 2022 01:10 UTC](https://discourse.nodered.org/t/opc-ua-multiple-interval-settings-while-using-subscription/71739 "2022-12-06T01:10:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manikandan](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Manikandan](https://discourse.nodered.org/u/Manikandan)\
**Post date:** [6 December 2022 01:10 UTC](https://discourse.nodered.org/t/opc-ua-multiple-interval-settings-while-using-subscription/71739/1 "2022-12-06T01:10:43Z")

</div>

hi,  
In my project, I was trying to set the OPC UA Subscription with two intervals using specific variable value [true] from the read information received from the opc ua Client.and as soon as the value of variable changes to false need to have a subscription with the longer interval.  
Tried to using msg.payload , no luck yet.

1. Can you please advise me on the nodes i need use to achieve two different intervals to the OPC UA Subscription node ?
2. On my flow, on the subscription method to read, I tired using template and CSV node to configure all the data in one place, but was ended up with an error, I think, Stringarray data type is creating a problem
3. Can you please suggest me in using the right method to use template and csv node for the Subscription method ?
4. Also, while writing, it's creating an error if i use data type as StringArray, can you please suggest me the method i should use with the proper data type [stringarray] ?

[flows (1).json](https://discourse.nodered.org/uploads/short-url/lkLIDg8Zckl4gb7iRDfDliVgsXG.json) (101.2 KB)

You Valuable inputs highly appriciated.

_Best Regards,_  
Mani

---

<div class="post-metadata">

**Author:** ![Manikandan](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Manikandan](https://discourse.nodered.org/u/Manikandan)\
**Post date:** [12 December 2022 10:14 UTC](https://discourse.nodered.org/t/opc-ua-multiple-interval-settings-while-using-subscription/71739/2 "2022-12-12T10:14:20Z")

</div>

@ [Mika Karaila](https://github.com/mikakaraila),

Looking forward to here from you on using multiple time interval settings while using OPC UA Subscription ?

Best Regards,  
Mani

---

<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:** [23 December 2022 06:13 UTC](https://discourse.nodered.org/t/opc-ua-multiple-interval-settings-while-using-subscription/71739/3 "2022-12-23T06:13:31Z")

</div>

SImple solution: you have to use 2 client nodes with different parameters.

---

<div class="post-metadata">

**Author:** ![Manikandan](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Manikandan](https://discourse.nodered.org/u/Manikandan)\
**Post date:** [26 December 2022 09:26 UTC](https://discourse.nodered.org/t/opc-ua-multiple-interval-settings-while-using-subscription/71739/4 "2022-12-26T09:26:45Z")

</div>

Thanks for response @mikakaraila ,

The intension of having multiple subscription to reduce my CPU and RAM usage.  
Having one more client node will increase the RAM ,CPU load and max number of sessions, etc...

It would be nice feature to have a configurable interval based on event, so that my CPU Load and RAM utilization goes high for a shorted period instead of all the time.

Example : I would like to Monitor the Tank Level at a 200ms whenever the motor is ON, so that I can switch off the motor precisely before it overflows. Remaining all the time the subscription rate can be at 2sec.

Or Please do suggest any solution which can't eat-up my CPU Load and RAM

Best Regards,  
Mani

---

<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 December 2022 06:10 UTC](https://discourse.nodered.org/t/opc-ua-multiple-interval-settings-while-using-subscription/71739/5 "2022-12-27T06:10:59Z")

</div>

Look first this figure: [https://www.researchgate.net/figure/OPC-UA-slient-server-subscription-communication-model-based-on-10\_fig1\_329741689](https://www.researchgate.net/figure/OPC-UA-slient-server-subscription-communication-model-based-on-10_fig1_329741689)

Then this one: [High Performance OPC UA Server SDK: OPC UA Subscription Concept](https://documentation.unified-automation.com/uasdkhp/1.4.1/html/_l2_ua_subscription.html)

One subscription can have only one publish interval / other subscription parameters like sampling interval.

If you want to save session you can always build with function node needed subscribe msg that contains needed properties.

---

<div class="post-metadata">

**Author:** ![Manikandan](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Manikandan](https://discourse.nodered.org/u/Manikandan)\
**Post date:** [27 December 2022 09:35 UTC](https://discourse.nodered.org/t/opc-ua-multiple-interval-settings-while-using-subscription/71739/6 "2022-12-27T09:35:47Z")

</div>

@mikakaraila : Thanks for your detailed explanation and I will try these and get back to you if needed.

- 

Mani

---

<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:** [10 January 2023 09:36 UTC](https://discourse.nodered.org/t/opc-ua-multiple-interval-settings-while-using-subscription/71739/7 "2023-01-10T09:36:26Z")

</div>

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