Tag point monitoring

As shown in the figure, we have monitored the trigger points of multiple tags, and now we have encountered a problem. The trigger of the point has been monitored, but it has not been included in the processing method. What may be the cause of this problem. Each script runs for about 4-5 seconds.


I have no idea what you're asking.
What's the problem here ?

Tag change event scripts in gateway scope use one thread per defined event. If many of the subscribed tags change in a short period of time, they will be executed in order. Are you sure an event was missed?

Yes, our script is like:

def xxx():
   tagpath = "result"
   try:
        # do something
        system.tag.writeBlocking(tagpath, 1)
   except:
        system.tag.writeBlocking(tagpath, 2)

We can see that the points configured in the gateway events have changed in designer, but the result point has not changed at all. At the same time, there are no error or warning in gateway logs, and the CPU and memory status of the server are also normal.
Most of the time, the script can be executed normally, but occasionally there are missed events.Could it be related to the long running time of the script?

Yes. You should check the running event scripts in the gateway web interface. Also, consider logging the tag currently being acted upon when you start and end a particular event. And look for any possibly related errors in the gateway logs.

How many threads can the Ignition Gateway's tagchange handle, because some scripts take too long and we need more threads to handle different situations

Ignition does not impose a limit on the number of threads that can be created by Gateway tag change scripts. So this is ultimately dependent on the hardware (virtual or otherwise).

At some point the number of concurrent threads that can be running will be exhausted (note this is inclusive of all processes running on the hardware not just Ignition) when that happens the threads will be cached until available memory is exhausted. This is hard to estimate when you know the hardware specs, without knowing them it's impossible.

So best guess is "several".

What is "too long".

We modify the tag change in the gateway and save it, but the tag signal is triggered at the same time when saving it. Will this affect the reception of the tag signal point?

That is, the logic of executing the script takes about 4-5 seconds, and I do not know whether the trigger signal is not received because of the longer time

That is normal, and there is a flag given to the event that marks it as an "initial change", so you can handle it differently if necessary.

Each tag change event defined in a project gets one thread of its own, shared among all of the tags in its subscription list.

Add logging to start and end of every event, indicating which tag is being processed. Then you will know.

1 Like