Define content in alarm history report with MpAlarmXHistory

Hello,

we’re using the MpAlarmXCore and MpAlarmXHistory FB’s in our application and with the export command of MpAlarmXHistory we’re exporting the alarm history to csv. Here’s an example of the original history report:

After comma-seperated parsing the report looks like this:

This all works quite well but we would like to change the content of the report as follows:

  • Don’t include certain information into the report (like “Name” or “Instance”)
  • Export entries in descending time order (newest entry on top, oldest at the end of the report. Right now the oldest entry is exported first)
  • Change order of exported information (e.g. 1. time, 2. code, 3. severity, 4. message, 5. additionalInfo, 6. state change)
  • Format exported timestamp to HH:MM:SS (skipping the milliseconds of the time)
  • If possibe: Replace severity value 1 to “alarm” and value 2 to “warning”

So at the end the exported report looks like this:

Is there a way to configure these options (or some of them)? If yes, how?

Thanks and BR
Eugen

1 Like

Hi Eugen,

After having checked the documentation, I would say it is not possible to define the content/columns of the export csv of MpAlarmXHistory component.

MpAlarmXHistory configuration
MpAlarmXHistory

Hi!

Unfortunately MpAlarmX does not directly provide any options to change the export format (as @xabier.zaldua has mentioned). You could however use the “Query” functionality of MpAlarmX to retrieve exactly the data you are interested in (which would allow you to process the data pretty much however you want).

Your query could for example be configured like this:
HistoryQueryConfiguration

With your Type and PV configuration looking like this (you can change sizes based on your needs):
QueryPVType
QueryPV

When you then execute this query you should get information similar to this entered into the PV:
WatchWindowPV

This information you could then process however you need it (e.g. upload to a database, webpage, …, save it to a file, dataobject, …). Please note that the newest alarm is always entered into the lowest index of the array (in other words, newest entry is “on top”; I guess same as you wanted in the CSV file), this order cannot be changed. You can also either make your array big enough to fit all alarms you are interested in or make the array smaller and use the “Next” command of the Query-FB (GUID: 86b51f00-5da3-4124-98bb-3e3c8b5f9c47) to iterate through the complete alarm history.

Of course, you could also implement some sort of post-processing on the system you want to view the CSV file (eg. a PowerShell or Python script), but that relies on all systems having this “post-processing functionality”…

I hope this can help you at least a little bit!

PS: I’m not an expert when it comes to writing files, so I’m really sorry that I cannot provide you any more guidance in this direction… :frowning:

3 Likes

@xabier.zaldua Hm, I’ve already though so since I couldn’t find anything too in the configuration of MpAlarmX and MpAlarmXHistory. Thanks for confirming.

@michael.stockhammer That’s a good workaround idea, we will check this possibility.
Writing a post-script to format the file on my machine would be little work, but this would require to have the script on all service technician machines too. Thank you very much! :slight_smile: