OPCUA Connection State

Hi,

Using Ignition 8.03,
Connected with a Siemens S71500 OPCUA Server.

When I download PLC Software into the PLC, the opcua server get rebooted.
Connection and tags take aprox 20 seconds to get available to ignition.

I have timer script running in which I basically do 2 things:
-Read few tags with system.opc.read : operation take something like 3/4 sec
-some code
-Write with system.opc.write operation take something like 5 sec

I have 2 timer script like the above, running every 15 sec, with fixed delay, shared thread,
then a third one just to write a watchdog every 500 ms .

( I know I should open new topic for this, if I put my 2 task on fixed delay, dedicated as suggested by the manual, the status page from the ignition server is not accessible any more, so I guess it is not a good idea, but I would like to understand why )

When I do the opc read, if I get any bad quality on tags, I can abort the script and wait next iteration, not a big deal.
I can not do the same With the Write process. When it is started I can not manage to interrupt it, so I ended up place that part inside a while loop, checking if all tags return a good status, otherwise repeat as it need (by declaring the task as fixed delay it should not be a problem if I get this right)

Is there a way to make this while loop disappear, and manage this situation in a better way then the one I did?

When I lost connection I see lots of error for the watchdog tag, is there a way to check if the opcua server is actually connected before even try to write against it?

Thanks for your time,
I should split my topic I know, but i don’t have time now, hope someone could help me

https://docs.inductiveautomation.com/display/DOC80/system.opc.getServerState

Hi Kevin,
Thanks for the hint, that worked as expected.

Could I ask you what is the best way to handle few scripts, being fired from the gateway by the timer gateway events.

The script when fired, as I sear on top, take about 7/8 seconds to complete, each one performing reading and writing on OPC.read/write.

In the manual is suggested to configure this kind of scripts to live in a separate thread, but If I do that, it seems to slow everything down.

From my understanding, what’s happening is that the task are parallel, but then the write/read on the opc make them to wait for each other to be done before they can run.

I don’t know what is happening, but as soon I put them on a dedicated thread, the ignition status page become not available any more, and the scripts don’t work anymore as I can see no write being perfumed on the PLC.

What I should do in this kind of situations?
Thanks for your time

I’m not sure why putting them on a dedicated thread would have that affect.

This seems like the right thing to do, the only thing I would caution is that you never use fixed rate execution; always use fixed delay.

If this behavior continues even with fixed delay and a dedicated thread you should contact support so they can investigate and replicate if possible.

Yes I had this behavior with fixed delay and dedicated thread.
Ok, I never did, but I will try to contact them.
Thanks