# Perspective Property Change Scripts - missedEvents

**URL:** <https://forum.inductiveautomation.com/t/perspective-property-change-scripts-missedevents/62471>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 29, 2022, 3:31pm UTC](https://forum.inductiveautomation.com/t/perspective-property-change-scripts-missedevents/62471 "2022-07-29T15:31:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nikolai\_Wolterstorff](https://avatars.discourse-cdn.com/v4/letter/n/35a633/32.png) [@Nikolai\_Wolterstorff](https://forum.inductiveautomation.com/u/Nikolai_Wolterstorff)\
**Post date:** [July 29, 2022, 3:31pm UTC](https://forum.inductiveautomation.com/t/perspective-property-change-scripts-missedevents/62471/1 "2022-07-29T15:31:46Z")

</div>

Can anybody explain this a little more in depth?

[https://docs.inductiveautomation.com/display/DOC81/Perspective+Property+Change+Scripts](https://docs.inductiveautomation.com/display/DOC81/Perspective+Property+Change+Scripts)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/8/480c741f76f259c0b0ad41d9192ad8b27ec3af4d.png)

From the 8.1.4 release notes:

> **[Ignition Release Notes for Version 8.1.4 | Inductive Automation](https://inductiveautomation.com/downloads/releasenotes/8.1.4)**
>
> Fixes, changes and features in Ignition 8.1.4

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/4/1486a0011a499881aa9319f2abe9e7362edef081.png)

Does it work like how tag event scripts go into a global queue with a limited amount of threads? Is it possible to miss events globally, or is it local to the property?

Thanks

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [July 31, 2022, 4:00pm UTC](https://forum.inductiveautomation.com/t/perspective-property-change-scripts-missedevents/62471/2 "2022-07-31T16:00:40Z")

</div>

The missedEvents are local to the property, because that’s where the thread limitation is. The thread count is sort of the issue, but so is the execution of the change script. If you have a change script that has any sort of sleep, or something like an array where there are potentially hundreds/thousands of items which could all trigger a long-running change script execution, then there is the potential for missed events by the next time the script executes.

Consider the following, and pretend you have a tag which changes every quarter of a second:

```auto
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
    from time import sleep
    sleep(1)
    system.perspective.sendMessage("SomeMessage")

```

Since the sleep immediately makes the script wait, there will be multiple values come through before the next time the thread allows this script to run. Supposing we have a tag which starts at `0` and increments by `1`, then the first time through will have a value of `1` (value _changed_, not original value), and then the next script should pick up a value of `5`. That’s less than ideal without a way to report that there were values in-between as well.

So if you encounter a missedEvent arg which is `True` (or maybe `1` - I can’t remember how it reports), then it means this specific property had other values between the currentValue and the last time the script executed.
