43429members
217967posts

[Imported] Button that exports alarms list and events list to CSV file

Highlighted
Sisko

[Imported] Button that exports alarms list and events list to CSV file

>>Message imported from previous forum - Category:Scripts and Tips<<
User: mchartrand, originally posted: 2018-10-23 17:04:05 Id:173
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.

_________________

**_jiramancio:
Good day!
I'm new to ClearSCADA and I'm wondering if anyone knows a scripting code for a button that exports alarms list and events list to a CSV file or EXCEL file. It can be a separate button, one for alarms and one for events. I really need your help so I appreciate anyone who could help me.
Thank you and have a nice day!_**

________________

sbeadle:

Hi. You could use a SQL Export object (find in the Create New ... Other ... menu).

Get the event query by showing/filtering the list and picking 'Edit Query'.

Alarm queries will require you to use the calarm table linked to calarmobject.

e.g.

SELECT A.SEVERITYDESC, CONDNAME, SUBCONDITIONACTIVETIME AS "Alarm Active Time",O."FullName",MESSAGE FROM CALARMOBJECT AS O JOIN CALARM AS A USING ( ID ) WHERE STATE 1 and ("FullName" like 'mygroup.%' ) ORDER BY "FullName" ASC

_________________

**_jiramancio:
Hi, thanks for replying! I tried to use it but I don't know how to put it as a button? If it would be okay, could you give me a step by step instruction on how to?
I appreciate it. Thanks._**

_____________________________

**_jiramancio:
Update: I've already made it work after 2 rigorous days of studying vbscript and creating a file out of sample codes I've seen on the internet. Thanks for replying [at]sbeadle!!_**