The ArchestrA Attribute Wrangler

One frustration that I often have with ArchestrA is wanting to do bulk updates to attributes on one or more objects.  Things such as,

  • Updating a the description on an attribute that has a typo for all objects descending from a template
  • Change all the alarm priorities on objects hosted in a particular area
  • Changing the IO references for all objects using a particular topic name

To use it, first select the objects you want to include in the search.  You can either pick objects out of the derivation tree or search for them using the advanced search function (recommended).  You can search by area, template, and object name.  All object search options are regex pattern matched, so if you want to match a template remember to escape the $ character (i.e. \$).

Once you have found your objects, set the attribute name pattern (also regex aware).  Then select the action you want to perform, the options are:

  • Find:  List the matched attributes in the log.  You can also match values against a regex pattern if you fill out the find value.
  • Find-Replace: Perform a find and replace operation in the value of the attribute.  This can only be performed on attributes of type string and MxReference.
  • Find-Update: For attributes that have a value matching the find-value (exactly), replace the entire value with the replace-value.  Applies to strings, floats, doubles, integers and references.
  • Update: Update the value of all matching attributes with the replace-value.  Applies to the same data types as Find-Update.
  • Set-Lock: Set the lock status for the attribute.
  • Set-Security:  Set the security classification for the attribute.

The find and replace value text fields are not regex aware (except in Find mode), although they do support the token '~%obj', which will be replaced with the object name.

Multiple operations can be done at once to save time on checkout and checkin operations, use the Add/Delete buttons to add or remove extra operations.  The Load/Save buttons can load or save the parameters to a file.  This is useful when reusing complex expressions.

If you only want to preview the operations that would be performed, check the whatif box.  This will log all the operations that would occur if not for the box being checked.  Note that the GRAccess SDK is not fast, so if you are performing operations on many objects, expect it to take some time (checkout time via GRAccess is about as slow as through the IDE).

Additional info:

  • If your galaxy uses OS security, you don't need to fill out the username and password fields when logging in.
  • The tool accesses the galaxy database using integrated security, so ensure that the current user has access to the database.
  • This tool will not stop you from doing stupid things.  I strongly suggest you backup your galaxy before using this tool.  Use the whatif option to test your operations.

Bulk updating IO references via csv file

The Wrangler can bulk  update IO references via csv file.  This is primarily designed to be used in conjunction with the aaIOChecker tool, which can automatically produce these files, but any valid csv file can be used.  The csv file should contain at least the following columns,

  • Address - the new IO reference
  • Attribute - the name of the attribute (not including the object name)
  • Object - the object that the attribute belongs to

The Attribute Wrangler can be downloaded from github.

| February 1st, 2018 | Posted in SCADA, Software |

12 Responses to “The ArchestrA Attribute Wrangler”

  1. ZigoZago Says:

    Hi congratulations for the tools made. Is there a possibility to extract the alarms / area / priorities with this tool? Or do you have any idea how it can be done? There is a view in the galaxy database but without priority. Thanks.

  2. Raggles Says:

    Yes you can get anything that is available in the object viewer, including alarm and area configuration. (open image in new tab to see full size) wrangler

  3. ZigoZago Says:

    Hello Raggles,
    really very kind in answering me so quickly. My question is related to being able to export all the alarms and the priority, without having any idea what they are. Should I add all the instances and then do the search? In the end export the csv file? Thanks so much.Regards.

  4. Raggles Says:

    I get the impression you are looking for the runtime alarms? If so you can't do that with this tool you want to be using the alarm toolkit, there are plenty of code samples around the web that can help you with that.
    If you do want the configured alarms then yes you could add all the object instances and search for "\.Priority$". This tool can't export the log to csv but that functionality would be easy to add yourself.

  5. ZigoZago Says:

    Morning i looking for a toolkit which allows me to export all galaxy alarms with priorities. If you say there are toolkits on the net I will try to search.

  6. ZigoZago Says:

    If you have any suggestions on where to look it would be appreciated.

  7. Raggles Says:

    There used to be plenty of examples online but I can't find them either - I have a c# example at and you can basically translate that into quickscript to use in an object

  8. ZigoZago Says:


  9. Ruben Says:

    One frustration I often have with ArchestrA, is everything about ArchestrA, and it's very soul and essence.....

    That said this looks like a great tool. Any Idea on what would be involved to support the Datatype MXInternationalizedString for Find-Replace operations?

  10. Raggles Says:

    haha I hear you - I don't really use it any more so I get to be frustrated with other software instead...
    And because I don't often work with ArchestrA any more I haven't used this tool in ages and haven't tested on the latest version so mileage may vary. It probably isn't too hard to add support for the MXInternationalizedString type - would have to add a locale filter to the ui and the corresponding logic in GalaxyFunctions.cs but I'm guessing that would only take a couple of hours. I might find some time at the end of this week to set up a test environment for ArchestrA and take a look - but feel free to have a crack at it yourself

  11. Ruben Says:

    Thank you! - I did a quick hack to get it to do what I need, for now....You dont have a tool for petrol-bombing all Schneider/Aveva software do you?

    I copied you MXString functions to be MXInternationalizedString, and then called .PutInternationalizedString(LCID, String).

    My Windows Language (English GB) was different to the Archestra Default Language (English US). I dont know an easy qay to query the ArchestrA default language, so I had coded it.....

  12. Raggles Says:

    I don't have anything to remove all the AVEVA software - usually I just spin up a new VM if I stuff something up (I have a generic windows server image and just clone it). I did try deleting all the relevant files and registry keys once though and that seemed to work ok.

Leave a Reply