New in the Community? Get started here

Schneider Electric Exchange Community

Discuss and solve problems in energy management and automation. Join conversations and share insights on products and solutions. Co-innovate and collaborate with a global network of peers.

Register Now
Geo SCADA Expert Forum
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Lt. Commander

[import] sql animation code not calling correctly.

>>Message imported from previous forum - Category:Scripts and Tips<<
User: ROVSCADAENGINEER, originally posted: 2019-03-06 22:28:40 Id:378
For some reason when I copy the following code into the animation section the SQL on the actual Query is writing different values. When I copy the following code into the animation section on the sql animation of the list:

'SELECT RECORDTIME, SEVERITY, SOURCE, MESSAGE, USER, CATEGORY, FOREGROUND, SEQNO, COMMENTNO, ID FROM CDBEVENTJOURNAL WHERE SOURCE LIKE ''%Fault Status'' AND ( RECORDTIME BETWEEN { OPC ''H-14D'' } AND { OPC ''H'' } ) AND SEVERITY = ''High'' AND MESSAGE LIKE ''%Alarm raised'' '

the below code is generated in the SQL section on the list:

SELECT
RECORDTIME, SEVERITY, SOURCE, MESSAGE, USER, CATEGORY, FOREGROUND, SEQNO, COMMENTNO, ID
FROM
CDBEVENTJOURNAL
WHERE
SOURCE LIKE '%Overflow Float' AND ( RECORDTIME BETWEEN { OPC 'H-7D' } AND { OPC 'H' } ) AND SEVERITY = 'Critical' AND MESSAGE NOT LIKE '%Alarm cleared'

I think that it is jumping to another stored registry instead that is stored on the server and am not sure how to get around this.

Any thoughts or suggestions? there are other pages on the server using similar registry codes, but I am confused as to why it is altering and adding a completely different code from another page on the SQL section of the list.

 

 

Reply User: ROVSCADAENGINEER, posted: 2019-03-07 03:26:48
The Code is actually working fine what I did not realise was happening is that the name of the registry key being used for the database search is the same for each server. Hence when one button with a different configuration is clicked on one page the same Query was applied to the other lists. As they are both referring to the same register.

On that is it possible in clear SCADA to make new individual registers for each page and what is the effect this would have on the size and readability of the database. Say for instance I wanted to have two completely unrelated pages with registry click buttons that both queried the CDBEVENTJOURNAL.


Reply User: adamwoodland, posted: 2019-03-13 01:36:14
You can include the mimic's fullname as the Registry key, or the mimics id if you want something shorter. That gives you a unique key per mimic per workstation.


Reply User: ROVSCADAENGINEER, posted: 2019-03-15 00:43:37
thanks Adam! greatly appreciated!