EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-11-23 05:59 PM
The below SQL query joins tables CENETANALOG and CENETBINARY, and filters per site, in this case MRWTP (%MRWTP%), and also filters alarms that are 'SeverityType' = 2 and the relevant limits and descriptions.
What I want to know is, can I reference a string variable, eg, (%<reference string variable from database>%) which could be changed by inputting into a text box, which changes the string variable, and there by changes the query to that specific site, which updates the list.
SQL Query
( SELECT
CENETANALOG.OBJECTLINK, CENETANALOG.FULLNAME, CENETANALOG.ALARMDISABLED, CENETANALOG.CURRENTVALUEFORMATTED, NULL AS STATE0SEVERITYTYPE, NULL AS STATE0SEVERITY, NULL AS STATE0DESC, NULL AS STATE1SEVERITYTYPE, NULL AS STATE1SEVERITY, NULL AS STATE1DESC, CENETANALOG.HIGH1SEVERITYTYPE, CENETANALOG.HIGH1SEVERITY, CENETANALOG.HIGH1LIMITSTD, CENETANALOG.HIGH1DESC, CENETANALOG.HIGH2SEVERITYTYPE, CENETANALOG.HIGH2SEVERITY, CENETANALOG.HIGH2LIMITSTD, CENETANALOG.HIGH2DESC, CENETANALOG.HIGH3SEVERITYTYPE, CENETANALOG.HIGH3SEVERITY, CENETANALOG.HIGH3LIMITSTD, CENETANALOG.HIGH3DESC, CENETANALOG.HIGH4SEVERITYTYPE, CENETANALOG.HIGH4SEVERITY, CENETANALOG.HIGH4LIMITSTD, CENETANALOG.HIGH4DESC, CENETANALOG.LOW1SEVERITYTYPE, CENETANALOG.LOW1SEVERITY, CENETANALOG.LOW1LIMITSTD, CENETANALOG.LOW1DESC, CENETANALOG.LOW2SEVERITYTYPE, CENETANALOG.LOW2SEVERITY, CENETANALOG.LOW2LIMITSTD, CENETANALOG.LOW2DESC, CENETANALOG.LOW3SEVERITYTYPE, CENETANALOG.LOW3SEVERITY, CENETANALOG.LOW3LIMITSTD, CENETANALOG.LOW3DESC, CENETANALOG.LOW4SEVERITYTYPE, CENETANALOG.LOW4SEVERITY, CENETANALOG.LOW4LIMITSTD, CENETANALOG.LOW4DESC
FROM
CENETANALOG
WHERE
( "FullName" LIKE '%MRWTP%' ) AND ( ( CENETANALOG.HIGH1SEVERITYTYPE = 2 ) OR ( CENETANALOG.HIGH2SEVERITYTYPE = 2 ) OR ( CENETANALOG.HIGH3SEVERITYTYPE = 2 ) OR ( CENETANALOG.HIGH4SEVERITYTYPE = 2 ) OR ( CENETANALOG.LOW1SEVERITYTYPE = 2 ) OR ( CENETANALOG.LOW2SEVERITYTYPE = 2 ) OR ( CENETANALOG.LOW3SEVERITYTYPE = 2 ) OR ( CENETANALOG.LOW4SEVERITYTYPE = 2 ) ) )
UNION
( SELECT
CENETBINARY.OBJECTLINK, CENETBINARY.FULLNAME, CENETBINARY.ALARMDISABLED, CENETBINARY.CURRENTVALUEFORMATTED, CENETBINARY.STATE0SEVERITYTYPE, CENETBINARY.STATE0SEVERITY, CENETBINARY.STATE0DESC, CENETBINARY.STATE1SEVERITYTYPE, CENETBINARY.STATE1SEVERITY, CENETBINARY.STATE1DESC, NULL AS EMPTY3, NULL AS EMPTY4, NULL AS EMPTY5, NULL AS EMPTY6, NULL AS EMPTY7, NULL AS EMPTY8, NULL AS EMPTY9, NULL AS EMPTY10, NULL AS EMPTY11, NULL AS EMPTY12, NULL AS EMPTY13, NULL AS EMPTY14, NULL AS EMPTY15, NULL AS EMPTY16, NULL AS EMPTY17, NULL AS EMPTY18, NULL AS EMPTY19, NULL AS EMPTY20, NULL AS EMPTY21, NULL AS EMPTY22, NULL AS EMPTY23, NULL AS EMPTY24, NULL AS EMPTY25, NULL AS EMPTY26, NULL AS EMPTY27, NULL AS EMPTY28, NULL AS EMPTY29, NULL AS EMPTY30, NULL AS EMPTY31, NULL AS EMPTY32, NULL AS EMPTY33, NULL AS EMPTY34
FROM
CENETBINARY
WHERE
( "FullName" LIKE '%MRWTP%' ) AND ( ( "State1SeverityType" = 2 ) OR ( "State0SeverityType" = 2 ) ) )
Thank you !
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2023-12-07 10:28 PM
You can create an embedded list object and then store your SQL query as a string which you can concatenate to your string variable. This will update your embedded list based off the value of your variable.
See here for how to convert your SQL query to a mimic animation expression string.
See here for how to tie your SQL expression string to a database field/object such as a string variable value.
Link copied. Please paste this link to share this article on your social media post.
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.