How to upload changes to objects using scripting from OMI runtime?

Hello All, I am trying to find a way to update my object attribute values such as alarm Hi limit, lo limit, initial values, etc. (integer, float, boolean) from runtime itself. Is there a way for me to make these changes like an upload change function that I can use from buttons to specifically upload selected values to the object? I am having to do this because there can be situations in our project where we won't be able to "Preserver Runtime Changes" when re-deploying engines because of some bugs we are encountering. I am hoping there is way to force update the object when someone updates the alarm limits from runtime for example.

Parents
  • (Edited with some clarifications)

    Hi,

    In InTouch you have the Retentive value configuration witch retains configuration data on a tag between shutdown and start up of the application.

    But with Application there is no such thing and for years there has been different approaches to resolve the issue you are describing.

    The Upload Runtime changes is one, but it will retain ALL settings and you have no control over witch of the settings are saved, performing this in IDE will save alarm settings, comments, data source configuration etc.

    This problem was resolved by introducing the Preserve Runtime changes setting on the deploy prompt, and you can configure an attribute to align to this setting. But as you say it is not always 100% reliable, certain configuration changes on a object will upon deploy disregard of the setting and I would advise to test the function if you come to rely on it for production data.

    AND if you find bugs or issues, report it to AVEVA tech support.

    So back to the Upload Runtime changes, witch is one option.

    There is no native way of triggering this action from OMI but the GRAccess Toolkit allows for programmatically perform Upload Runtime changes.

    In similar scenarios I have created a 'helper object' (using GRAccess in script) that you can trigger to perform this action, and similar from any other instance/object. using this method i have created self configurating applications and applications that can create, modify and deploy objects without the usage of IDE. Big disclaimer here, GRAccess will require a license for connecting to the galaxy as a development session, so make sure that the object is deployed on the node that you are normally use IDE on, or make sure you have enough development licenses available. GRAccess is not a free path to development actions Slight smile

    Another workaround is to store requested limits / configuration in a database, or even in xml files, reading settings upon deploy.

    If you have them in a database it allows for easy bulk modifications and customer documentation.

    The solution of using external storage of important configuration data is commonly used in many systems, and as mentioned, there are several methods in doing so. I would say using a custom database is very common.

    Triggering the read configuration upon deploy. Note, to NOT put the database access in the Onscan or startup script since it can effect your deploy stability, there are some good examples on how to implement scripting that triggers on deploy in the Scripting Guide from Aveva.

    And to support the update of values you store upon the change of data.

    Same thing here, it is not advisable to put the 'save' of data in the Offscan or Shutdown script for the same reasons as Onscan/Shutdown.  

    From GRAccess manual:

    Upload Method
    Uploads AutomationObject configuration changes made at run time.
    Class
    IInstance
    Syntax
    [C#]
    void Upload(
    EAutomaticallyUndocheckout automaticallyUndocheckout,
    ESkipOtherUsersCheckedOutObjects
    skipOtherUsersCheckedOutObjects,
    ESkipObjectsWithPendingUpdates skipObjectsWithPendingUpdates
    );

  • Thanks Richard! this really helps. I was also thinking of the database solution but was curious if there is an upload change command via scripting. 

  • No problem, I'm happy that you found it useful, please note that i made some minor updates in my original post, I don't know if the forum notifies about this.

Reply Children