Triggering script on Value Changed event fail on rapid changes

Hi,

I just wanted to know if there’s a limit to triggering a script on Value Changed event?

I have setup a script on a tag that runs on value changed but it looks like the script doesn’t fire if the transition is fast?

The script I have is minimal:

if not initialChange:
logger = system.util.getLogger(tagPath)
logger.info('triggered')

The tag value goes from high → low → high and the time between high to high is about 180ms. Other tags that has the exact same script seems to be triggering when the time between the high to high is around 1.5 seconds or so. Is there a way to resolve this issue?

Many thanks in advance.

Are you polling the tag fast enough to catch every transition? (Your timing is unusually fast and is probably not being met.) The default poll rate is 1000ms, so you wouldn't see anything faster than that unless you take extra care and have very, very good drivers.

1 Like

Check the device status in the gateway web portal. I don't know what driver you’re using, but Logix will show if there's any overload and the actual poll rate

But, if you must capture every transition without fail, you should be using a buffer in the plc with some handshaking. That goes for slower rates as well

2 Likes

Hey, thank you for your response @pturmel

I’ve tried setting up a tag group with 50ms rate under Common and OPCUA sampling interval to 50ms but it didn’t make much change (I’m not sure if this is the correct way to setup a polling rate on individual tags).

The signal is a sensor looking at actuators with rapid movement and we basically need to make record of every movement on these devices. We’re using Allen Bradly PLC and its driver Ignition provides.

I guess we will have to work something out on the PLC side if Ignition is unable to poll at a rate we need.

hey, @nminchin thank you for your response.

Yes, we are using Allen Bradley PLC and the Logix driver. I don’t think it’s overloading but it looks like I can’t poll the tag at rate that is able to capture the transition in the signal.

I guess we will have to work something out on the PLC side rather than attempting to capture the signal directly from Ignition.

Even if you could poll at 50ms, you still need to do this in the PLC.

Make a ring buffer in your PLC where each element can hold a 64-bit microsecond timestamp, cylinder position information, and control state. Monitor the head index in Ignition and bulk read from the array to store in your database. Ignition would update a tail index so the PLC can stop motion if Ignition falls too far behind.

2 Likes

thank you, @pturmel

Yes, I think this is going to be our next move as both you and @nminchin made the same suggestion. Was hoping for a magic solution on Ignition :rofl: