How I/O attributes are handled by an app engine regarding writing/reading to/from it?

Hi,

Back in the days there were power points describing how this works but I don't have access to these anymore.

My basic scenario:

1) App Engine 500ms
2) One integer attribute (e.g. MyInt) and one I/O integer attribute (e.g. MyIOInt) which is pointing to MyInt
3) Then I do have a script which switches the value of MyIOInt between 5 and 10 over and over again.
4) Two data change scripts for the MyInt and MyIOInt which just give me the value in the logger.

When executing the script I would expect the following:
Because it's an IO attribute the change of value happens not instantly and I would have expected to have the correct value in the next scan cycle but according to my tests the value switches every second.

It seems the write value of the I/O attribute is the same in the first two script executions and on the third it changes for the next two script executions.

Is there anyone who has experience with that and can give me a hint where to look at? I've tested in 2020 R2 SP1 and 2023 R2 and the behavior is identical, so I doubt this is an issue.

Thanks
Peter

Some screenshots

MyIOInt which points to MyInt

MyInt

Switch script, triggers while true

DataChangeIO Script

Result in logger to see the timing:

  • Ok, I have to find some time to test this too

    Also we have the new docs that contains some insights in the mechanism.

    https://docs.aveva.com/bundle/system-platform-deployment-guide/page/661724.html

  • Hi Peter,
    and  

    I also did some testing related to your setup.
    The important thing here is when a Write action happens for IO and when a Read action happens in IO.

    In my test I've set the Engine scan to 5000 ms to clearly see what happens after each scan.
    I've created an object with two attributes. (booleans)
    One boolean has an I/O reference to the other:

    I have 1 script that set's the IO attribute back to False:

    I visualize this in the object viewer. Here a video. (I hope it works)

    - I change the MyIOAttribute to True in the objectviewer.  (during scan 1)
    - MyIOAttribute,Writevalue and MyAttribute is set to True in the next scan. (scan 2)
    - MyIOAttribute stays false until scan 3.
    - The script is triggered in scan 3 because MyIOAttribute is True (scan 3)
    - This will run MyIOAttribute = false (scan 3)
    - In Scan 4, the MyIOAttribute is still True and MyAttribute and MyIOAttribute is set to false (scan 4)
    - Because MyIOAttribute is still True, the script is triggered again (scan 4)
    - In the last scan, MyIOAttribute is set to False (scan 5)

    Here a visual representation:

    My conclusion in this is that a change of an attribute with IO is held in the .Writevalue field and written to the IO.
    But the attribute itself is not changed, because it still reads the old value of the IO.

    I don't see any difference in changing the script execution order.

    What I've been told, this is how it works for a long time already. (at least 2014 till now 2023 R2)

  • Hi Everyone! Thanks for all the interest in this - all the discussions here were instrumental in leading to an updated document describing Engine execution.  The doucment can be found here: https://softwaresupportsp.aveva.com/#/knowledgebase/details/000032914?lang=en_us. 

    But the headline is probably this diagram: