Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

ODBC/SQL to get Alarm List (Mimic Alarm Banner)

EcoStruxure Geo SCADA Expert Forum

Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results forΒ 
ShowΒ Β onlyΒ  | Search instead forΒ 
Did you mean:Β 
  • Home
  • Schneider Electric Community
  • Remote Operations
  • EcoStruxure Geo SCADA Expert Forum
  • ODBC/SQL to get Alarm List (Mimic Alarm Banner)
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
sbeadle
Kirk sbeadle Kirk
307
AndrewScott
Admiral AndrewScott
95
BevanWeiss
Spock BevanWeiss
89
AdamWoodlandToo
Lt. Commander AdamWoodlandToo
36
View All
Related Products
product field
Schneider Electric
EcoStruxureβ„’ Geo SCADA Expert

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to EcoStruxure Geo SCADA Expert Forum
Solved
MikeForshock
Lieutenant JG MikeForshock
Lieutenant JG

Posted: β€Ž2020-01-20 11:37 AM . Last Modified: β€Ž2023-05-03 12:18 AM

0 Likes
12
6086
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-01-20 11:37 AM . Last Modified: β€Ž2023-05-03 12:18 AM

ODBC/SQL to get Alarm List (Mimic Alarm Banner)

Checking to see if there is a simpler method than multiple Table joins and subselects to get the list of alarms, similar to the alarm banner.

 

We are attempting to get a snapshot of the current/past alarms, cleared-unacked alarms, etc. from a ODBC/SQL query into our notification system (think Win911).

 

The only solution we seem to be able to come up with is processing each and every point table (Internal Analogs, Digitals; Modbus Analogs, Digitals; DNP3 Analogs, Digitals, etc.). This could become quite problematic as the need for other point types and Drivers may vary and would seem to be a waste of resources for unused tables.

 

Thanks for your help,

Mike

Labels
  • Labels:
  • Drivers
  • Logic
  • SCADA
  • Scripting
  • Telemetry
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
BevanWeiss
Spock BevanWeiss
Spock

Posted: β€Ž2020-01-20 12:57 PM

2 Likes
11
6079
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-01-20 12:57 PM

I would recommend that you turn on Alarm Summary in the Server Configuration.

Then you can query the CAlarmSummary (maybe CDBAlarmSummary... I forget, but 'The Schema' has the answers πŸ˜‰ )

 

That will provide you information on both current and historical alarms, for the duration that you have the Alarm Summary table configured.

 

The CAlarm table can also provide some information on current alarms, however it's not as useful as the Alarm Summary table.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..

See Answer In Context

Reply

Link copied. Please paste this link to share this article on your social media post.

Replies 12
BevanWeiss
Spock BevanWeiss
Spock

Posted: β€Ž2020-01-20 12:57 PM

2 Likes
11
6080
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-01-20 12:57 PM

I would recommend that you turn on Alarm Summary in the Server Configuration.

Then you can query the CAlarmSummary (maybe CDBAlarmSummary... I forget, but 'The Schema' has the answers πŸ˜‰ )

 

That will provide you information on both current and historical alarms, for the duration that you have the Alarm Summary table configured.

 

The CAlarm table can also provide some information on current alarms, however it's not as useful as the Alarm Summary table.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Reply

Link copied. Please paste this link to share this article on your social media post.

AdamWoodland
AdamWoodland Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: β€Ž2020-01-20 01:51 PM . Last Modified: β€Ž2020-01-20 02:05 PM

In response to BevanWeiss
1 Like
3
6075
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-01-20 01:51 PM . Last Modified: β€Ž2020-01-20 02:05 PM

Yup, its CDBAlarmSummary

 

CDBAlarmSummary = Current and history

CAlarm = Current

 

Querying CDBObject and descendants will be inaccurate as objects can have multiple alarm conditions active yet it reports the highest severity one

 

Edit: Fixed CAlarm table name

Reply

Link copied. Please paste this link to share this article on your social media post.

BevanWeiss
Spock BevanWeiss
Spock

Posted: β€Ž2020-01-20 01:59 PM

In response to AdamWoodland
1 Like
2
6073
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-01-20 01:59 PM

It would be super wonderful if the QP could add aliases to all the Cxxxxx tables so that they are also accessible as CDBxxxx

 

It's difficult to remember what arbitrary prefix each table was given πŸ˜›

 

Is it 'CAlarms' or 'CAlarm'?  I thought they were all singular...


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Reply

Link copied. Please paste this link to share this article on your social media post.

AdamWoodland
AdamWoodland Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: β€Ž2020-01-20 02:05 PM . Last Modified: β€Ž2020-01-20 02:06 PM

In response to BevanWeiss
2 Likes
1
6070
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-01-20 02:05 PM . Last Modified: β€Ž2020-01-20 02:06 PM

Yes, the irony, it is CAlarm.

 

I think one of the problems is the table length is limited (a joy when writing DDKs) hence why some are C... and some are CDB...

Reply

Link copied. Please paste this link to share this article on your social media post.

BevanWeiss
Spock BevanWeiss
Spock

Posted: β€Ž2020-01-26 11:25 PM

In response to AdamWoodland
1 Like
0
6018
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-01-26 11:25 PM

That differs a bit from the previous 'story' I was told, where it was around whether the code-base for the table was from C (C..), or from C++ (CDB...).

Obviously from a user perspective it's a bit arbitrary anyway.

Having aliases without any such C / CDB prefix may be best.

 

After all, if I want to query for all Alarms... I shouldn't need to worry about CDBAlarm or CAlarm.

I should just be able to query for Alarm.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Reply

Link copied. Please paste this link to share this article on your social media post.

MikeForshock
Lieutenant JG MikeForshock
Lieutenant JG

Posted: β€Ž2020-01-30 08:16 AM

In response to BevanWeiss
0 Likes
0
5980
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-01-30 08:16 AM

Thanks for the response, I appreciate it.

Reply

Link copied. Please paste this link to share this article on your social media post.

MikeForshock
Lieutenant JG MikeForshock
Lieutenant JG

Posted: β€Ž2020-02-03 07:23 PM

In response to BevanWeiss
0 Likes
5
5945
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-02-03 07:23 PM

CDBAlarmSummary gets a little closer to the goal, but not quite there. I do appreciate your help.

The descriptions would required a lot of parsing strings to get a specific cause for a shortened message.

Example:

"State changed from Starting to Start Fail, value is 4 (Current data)" on the source  object "Forshock Test.Well Test.Status"

Using the ST Logic program we get:

"Well Test: Start Fail"

 

But this particular object could be a Digital, ModbusDigital, DNP3, etc. So must be further sorted to make sense to the outside software.

 

 

 

Perhaps diagnosing my root issue would be a better solution:

 

We have a simple ST Logic program that updates a few fields on a Linked SQL Table.

The logic works perfectly fine, until the system moves to the standby.

The logic then fails.

 

The Linked table is configured on both machines (Main and Standby).

If the standby is started as the main, the logic works.

If the logic is restarted after the main takeover, the logic works.

 

Only seems to be an issue on the takeover.

 

Is there a way to programmatically restart the logic?

 

Example of the SQL:

SAAUpdate AT %D(UPDATE SCADAspireAlertAlarms SET DescriptionTXT=?, DescriptionINT=?, IsAlarm=?, IsAcked=?, Priority=? WHERE UniqueID=?) WITH_PARAMS saadesc,saadescint,saaisalarm, saaisacked,saapriority,saauniqueid;

 

Variables:

saadesc = Object Name and CurrentStateDesc

saadescint = Object ID, CurrentState and AlarmState

saaisalarm = Boolean (Active Unacked, Active Acked)

saaisacked = Boolean (Acked)

saapriority = Priority

saauniqueid = System name, FullName, Object ID

 

This is likely not ideal as this obviously duplicating the fields and requires ClearSCADA to handle all of the processing.

Each Template Instance runs a similar logic program, so can become quite intensive as systems grow.

Reply

Link copied. Please paste this link to share this article on your social media post.

BevanWeiss
Spock BevanWeiss
Spock

Posted: β€Ž2020-02-03 08:19 PM

In response to MikeForshock
1 Like
4
5942
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-02-03 08:19 PM

Hmm... 

What do you mean by 'when the logic is restarted after the main takeover'?

Do you mean that you go into Server Status, Modules and restart the Logic module?

Or do you just take that particular Logic Routine out of service, and then put it back in service?

Or do you just mean that the next execution of the logic works fine, but the execution during the failover doesn't? (if your logic runs for so long that this is a problem then it likely causes problems of its own.. like heartbeat failures).

 

It seems that perhaps you do indeed want CAlarm, if you only want the current alarms

 

To get 'Well Test: Start Fail', then the following should work

 

Perhaps try

SELECT

  ID->ParentGroupId->Name || ":" || ActiveSubCondition as "saadesc",

  ID || ":" || ActiveSubCondition || ":" StateDesc as "saadescint",

  InactiveTime IS NULL as "saaisalarm",

  Accepted as "saaisacked",

  Severity as "saapriority",

  'SystemName' || ":" || ID->FullName || ":" || ID

FROM CAlarm

 

That should get the values you want.  Although you'd have to handle resetting things if you're staging into a remote table.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Reply

Link copied. Please paste this link to share this article on your social media post.

AdamWoodland
AdamWoodland Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: β€Ž2020-02-04 02:14 PM . Last Modified: β€Ž2023-04-25 10:32 PM

In response to BevanWeiss
0 Likes
3
5922
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-02-04 02:14 PM . Last Modified: β€Ž2023-04-25 10:32 PM

Also be really really careful using linked tables in logic, it is not recommended.

 

See the details on logic execution at https://community.se.com/t5/Geo-SCADA-Knowledge-Base/OPC-Quality-Flags/ba-p/279050, basically reading and writing is done under a database lock and any delays in either actions on the linked table will impact logic execution and ultimately the whole database.

 

I once was using linked tables in logic to read and write to Oracle so there was a single source of truth for the data, and when the Oracle server wasn't accessible there was a "bug" in the Oracle client whereby it returned nothing the the API calls for 10 minutes.

 

During that 10 mins the system was unavailable. And this logic was in a template with multiple instances... basically the system was unusable until the Oracle was back online. No idea if that bug in Oracle was ever fixed, but I learnt and never used linked tables in logic again.

Reply

Link copied. Please paste this link to share this article on your social media post.

BevanWeiss
Spock BevanWeiss
Spock

Posted: β€Ž2020-02-04 04:08 PM

In response to AdamWoodland
0 Likes
2
5919
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-02-04 04:08 PM

To stray a bit from the original topic.  I really don't like that Linked Tables actions are performed under DB Locks, and I can't understand why this might be the case still.

 

@AdamWoodland Is there a good reason for this?

Or is it just because it uses the QP, and the QP isn't particularly well optimised in regards to DB Lock performance?


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Reply

Link copied. Please paste this link to share this article on your social media post.

AdamWoodland
AdamWoodland Schneider Alumni (Retired)
Schneider Alumni (Retired)

Posted: β€Ž2020-02-04 07:34 PM

In response to BevanWeiss
0 Likes
1
5915
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-02-04 07:34 PM

Probably need a IANACSD (ClearSCADA developer) disclaimer here πŸ™‚

 

Database consistency is king, but in my head linked tables may not fit under that strict consistency rule so maybe they could modify the logic engine to be outside of a lock. It probably adds a new dynamic here with asynchronous execution, you need to hold up the logic until query has returned and a database lock is a "simple" method to achieve that.

 

Would they allow other logic to run in the mean time? What happens when a backlog happens? Logic is designed to be quick, efficient and predictable and if they were to implement something like this is can see a knock-on effect that could be quite problematic for both developers and users.

 

18 odd years ago there was a registry setting to control how many threads there were for logic, but that got removed and I can only speculate it was to help with the whole database consistency, although back then testing to see if made a difference was a lot harder.

 

I couldn't see any requests for this in the issue system, so you may want to officially request via support.

Reply

Link copied. Please paste this link to share this article on your social media post.

sbeadle
Kirk sbeadle Kirk
Kirk

Posted: β€Ž2020-02-05 01:16 AM

In response to AdamWoodland
0 Likes
0
5909
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: β€Ž2020-02-05 01:16 AM

Adam's right. Only use linked tables if you can 100% guarantee it will be available all of the time. I'd recommend exporting with the SQL Export driver, or write your own custom DDK driver to do it.

Reply

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

Β 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings Β© 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of