How to add a specific Alarm Expression aspect with scripting to multiple objects via BDM?
I have a good working knowledge of BDM and replication objects via BDM. The issue I am facing is that I need to add a specific ASPECT to mutiple objects. Lets take the following scenario:
I have 2500 Analogue Input Objects that are being recieved via an OPC server. These AIs are represented by individual "Generic OPC Objects" in the Control network. Now to create process alarms I need to add alarm expressions to each of these objects. I know how to operate an alarm expression object, so have done the necessary scripting. How do I replicate this Alarm Expression Aspect with the scripting to all my 2500 AI objects via BDM?
In working on this problem, I was able to replicate the alarm expression aspect to whichever object that I wanted to, BUT the issue was that the replicated aspects did not have the scripting. Auto Instantiate is not an option. Any guidance or step by step guide would be really helpful
Answers
The problem is not new, I have been trying to solve it for years. So much for "step by step guide". Well, at least I can share what works and what doesn't, whether it applies to alarm expressions or any other aspect that does not "play" with the BDM nicely.
There is no doubt that we need to Bulk handle many more aspects than BDM can help you with.
The answer is not necessarily the BDM, despite the word Bulk in the "Bulk Data Manager".
Can someone, please show me how to retrieve the contents of the Operator Note with the BDM?
Don't waste your time, because you can't. And the problem is not in the BDM. Problem is in the Operator Note aspect - it does not expose this value. BDM is generic and it can only handle whatever the designer of a given Aspect chose to support. Whoever designed the Alarm Expression, did not choose to implement the BDM interface.
For years and years, I've been developing my own wrappers to help different project teams handle all sorts of different aspects through Excel in Bulk fashion (NOTE - THIS IS NOT the BDM).
Basically, you connect to the Aspect ASO programmatically and return its data structures as an XML string. Conversely, your wrapper can also receive an XML string and use it to ask the Aspect ASO to update its data structures.
Seen you’re already in Excel, you have the VBA at your fingertips. If you’re lucky, the Aspect System you’re playing with uses methods which are automation compatible. Example – Operator Note or NLS Resource Manager. All you need is VBA.
Your luck runs out when the underlying ASO uses arrays of structures or VBA incompatible types like unsigned integers.
My next port of call there is VB.Net or C#- that’s what you need to develop a wrapper to deal with – for example – Property Translations Extended. Effort / skill required goes up.
Then you come across Alarm Expressions. After lots and lots of effort, you learn that COM marshalling can only get you so far and that you actually cannot interact with this Aspect with C# - you need to develop the C++ wrapper (I’d absolutely love to be corrected on this one). Effort / skill required goes up sharply (no pun intended). BTW, it helps if you have the Platform SDK in your back pocket (which you used to be able to load from the Product DVD, but not any more)…
In your specific case, you could probably simply inherit this aspect, copy it, use some General Properties to help you configure your alarms or whatever. Nevertheless, there is still a definite need to bulk edit alarm expressions, among many other aspects.
I just thought I'd share my own views and experiences on this broader subject :)
Add new comment