mikakaraila / node-red-contrib-opcua

A Node-RED node to communicate OPC UA. Uses node-opcua library.
Other
216 stars 197 forks source link

Node Red OPC UA Client does not close connection each time I activate the deploy #660

Open OfirLevi888 opened 9 months ago

OfirLevi888 commented 9 months ago

Hello, I'm using Node-Red OPC UA client to connect OPC UA server device. The maximum number of OPC UA connections this device support is 5. It seems like each time I make a change in the flow and deploy again the project, Node-Red OPC UA Client is not closing the connection but opening a new session. This results that after several deployments, I have to reset the OPC UA server device in order to enable again the OPC UA sockets.

  1. Do restart flows, or deploy actions should close the existing OPC UA connection?
  2. Is there a way to initiate OPC UA client close connection manually?

Thanks for your help!!!

mikakaraila commented 9 months ago

Use action disconnect

OfirLevi888 commented 9 months ago

Which block should I use for disconnect?

mikakaraila commented 9 months ago

Function node is enough just look example

On Thu, Feb 8, 2024, 10:01 OfirLevi888 @.***> wrote:

Which block should I use for disconnect?

— Reply to this email directly, view it on GitHub https://github.com/mikakaraila/node-red-contrib-opcua/issues/660#issuecomment-1933541243, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHRYDHMCQQKAYGID4IERZTYSSA7LAVCNFSM6AAAAABC5VQ2A2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZTGU2DCMRUGM . You are receiving this because you commented.Message ID: @.***>

mikakaraila commented 9 months ago

Here example (tested): image

OfirLevi888 commented 9 months ago

Many Thanks MikaKaraila!! I will test it.

OfirLevi888 commented 9 months ago

Hi again,

I'm implementing a method call in OPC UA. Which type of action should I use for this method? Can I use the subscribe or should I use the read? Can you explain the differences?

mikakaraila commented 9 months ago

Simply use method node, there are examples inside OPCUA-TEST-NODES.json

Here: image