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-04-03 06:09 AM . Last Modified: 2023-05-02 11:45 PM
Hello,
I created an ODBC query using an ODBC Data Sources on Geo Scada Expert 2021. Afterwards, I was able to generate an ODBC signal and obtain the data over this signal. All these data are retrieved via SQL. But I was able to create this query by using the ID of the signal I used in the query on the View Status screen. So I can add this data manually. But what I want is to use the Relative property to automatically select the Signal ID information in View Status based on the file path where the signal is located. How can I go about this?
I marked the part where the Signal ID is located below. I should not manually enter the value 69250 at this point. This value needs to be automatically added from the file path.
I can see the ID information of the signal from the View Status section as follows.
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-04-03 09:54 AM
What "relative property" are you referring to?
An object ID is just a unique identifier - they are automatically allocated in the order in which the database objects are created.
An SQL query has no concept of being 'relative' to something.
The query appears to be finding the lowest value each day. Have you considered using a Minimum Accumulator to calculate this? See Types of Master Station Accumulator.
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-04-03 10:47 AM
Let me explain the relative issue as follows: I created instances after using templates, and in this way, I had the opportunity to make changes more quickly. And I used the relative property on the animations screen of the templates to make definitions such as naming on these instances. Thus, I was able to make the change in all instances in the relevant template automatically in one go. You can see the example below. Thanks to the Relative option selected in the image, all changes can be made in instances at once.
Similarly, is it possible to automatically assign the ID of the instance by entering the file path on the template in the yellow-marked ID section of the SQL query I shared before? I am also adding what I mentioned about the file path below. Can't I somehow write "Id"= ..Enstr.FE.Signals.SignalName.Id instead of "Id"=69250?
I tried using the method you said, but I couldn't get a positive result. It did not perform the filtering the way I wanted. What I need is not a single minimum value, I need multiple values to be filtered out.
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-04-03 10:55 AM
You're trying to combine two unrelated technologies.
Mimics animations use expressions which can include OPC DA tags for variables, where an OPC tag can be relative to the mimic.
SQL queries are just a fixed piece of text, there are no variables.
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-04-03 11:17 AM
If you are Querying on a mimic with an embedded List you can build your query in the Animations... of the List object. I there you can use a combination of text and relative references. getting the right number of single and double quotes and everything working as a string for the created Query can take a bit to work out.
This thread will give you an idea of the formatting. I think the help for the SQL animation also give some example.
To query this from anywhere else and you will have to query CDBPoint and filter that to get the ID and then use it in the historic Query. I usually need to ask for help on SQL when I get to this point so I can not give an example.
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-04-04 02:37 AM
Here's how to modify the query to find the data by point name:
SELECT TOP( 1000000 )
"RecordId", "RecordTime" AS "~Time", "FormattedValue", "StateDesc", "QualityDesc", "ReasonDesc", "StatusDesc", "SuppressionTypeDesc", CDBHISTORIC."Foreground", CDBHISTORIC."Background", CDBHISTORIC."Blink", "FileOffset" AS "_FileOffset"
FROM
CDBPOINT LEFT JOIN CDBHISTORIC USING ( ID )
WHERE
"FullName" = 'Demo Items.Historic Demo.AI1' AND "~Time" BETWEEN { OPC 'H - 23H' } AND { OPC 'H - 23H+1D' }
ORDER BY
"~Time" DESC, "_FileOffset" DESC
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-04-04 02:42 AM
The ODBC query you created is designed to read in tabular data and insert it into individual analog points. This may not be what you want.
You might use the embedded lists on mimics as suggested by Geoff. They will use the SQL like I added above.
But you can insert the SQL into an animation expression in the embedded SQL list. See the help:
Note that you will need to watch how you animate the group/folder name the point is in to make a relative reference - check the use of single quotes for strings and double-quotes for animation "tags".
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.