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: 2019-11-26 09:09 AM . Last Modified: 2023-05-03 12:22 AM
>>Message imported from previous forum - Category:ClearSCADA Software<<
User: Tanquen, originally posted: 2019-07-16 20:01:34 Id:472
Is there an existing OPC tag in ClearSCADA that can tell how many sites under a communication channel are in comm. failure.
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: 2019-11-26 09:09 AM
>>Responses imported from previous forum
Reply From User: Tanquen, posted: 2019-07-16 20:04:19
Something like this or is there a better way?
(* Setup the SQL data type for the query *)
TYPE
Point : INT;
END_TYPE
PROGRAM Outstation_Health_Query
(* Internal script tag linked to database OPC tag *)
VAR
Comm_Fail_Count AT %M(.Comm Fail Count) : INT;
END_VAR
(* Query the SQL database for the Full of each outstation *)
VAR
SQL_Query AT %S(SELECT Count(*) FROM CADVOUTSTATION WHERE ( "SourceName" = '~Config.Communication.Garvey Reservoir Radio Outstation Set' ) AND ( "QualityDesc" = 'Comm Failure' )) : RESULTSET OF Point;
END_VAR
(* Move the number of failed outstations returned by the query into the linked OPC tag *)
Comm_Fail_Count := SQL_Query.Value;
END_PROGRAM
Reply From User: BevanWeiss, posted: 2019-07-16 23:48:44
I'd recommend avoiding the use of QualityDesc if you can.
Filtering by a nice comparable 'number' is better than comparing strings.
There will be a Quality associated with that QualityDesc. I'd use that, and then have comments to indicate what the 'magic number' is for.
I'd also use NO CACHE, and configure the Comm_Fail_Count as AT %Q (since you never read the value of it). I'd also remove the TYPE definition. You don't need the TYPE defined, you can use a normal INT datatype in the SQL return definition.
Reply From User: Tanquen, posted: 2019-07-17 00:46:43
I'll give those options a try. Just wanted to make sure there was not some existing built-in tag.
Thanks.
Reply From User: adamwoodland, posted: 2019-07-17 23:08:34
Probably better to use State[Desc] rather than Quality[Desc]. Off the top of my head I think I check State
Reply From User: BevanWeiss, posted: 2019-07-19 09:12:29
[at]adamwoodland said:
Probably better to use State[Desc] rather than Quality[Desc]. Off the top of my head I think I check State
I don't believe there is an OPC tag for this.
But some of the State values
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: 2019-11-26 09:09 AM
>>Responses imported from previous forum
Reply From User: Tanquen, posted: 2019-07-16 20:04:19
Something like this or is there a better way?
(* Setup the SQL data type for the query *)
TYPE
Point : INT;
END_TYPE
PROGRAM Outstation_Health_Query
(* Internal script tag linked to database OPC tag *)
VAR
Comm_Fail_Count AT %M(.Comm Fail Count) : INT;
END_VAR
(* Query the SQL database for the Full of each outstation *)
VAR
SQL_Query AT %S(SELECT Count(*) FROM CADVOUTSTATION WHERE ( "SourceName" = '~Config.Communication.Garvey Reservoir Radio Outstation Set' ) AND ( "QualityDesc" = 'Comm Failure' )) : RESULTSET OF Point;
END_VAR
(* Move the number of failed outstations returned by the query into the linked OPC tag *)
Comm_Fail_Count := SQL_Query.Value;
END_PROGRAM
Reply From User: BevanWeiss, posted: 2019-07-16 23:48:44
I'd recommend avoiding the use of QualityDesc if you can.
Filtering by a nice comparable 'number' is better than comparing strings.
There will be a Quality associated with that QualityDesc. I'd use that, and then have comments to indicate what the 'magic number' is for.
I'd also use NO CACHE, and configure the Comm_Fail_Count as AT %Q (since you never read the value of it). I'd also remove the TYPE definition. You don't need the TYPE defined, you can use a normal INT datatype in the SQL return definition.
Reply From User: Tanquen, posted: 2019-07-17 00:46:43
I'll give those options a try. Just wanted to make sure there was not some existing built-in tag.
Thanks.
Reply From User: adamwoodland, posted: 2019-07-17 23:08:34
Probably better to use State[Desc] rather than Quality[Desc]. Off the top of my head I think I check State
Reply From User: BevanWeiss, posted: 2019-07-19 09:12:29
[at]adamwoodland said:
Probably better to use State[Desc] rather than Quality[Desc]. Off the top of my head I think I check State
I don't believe there is an OPC tag for this.
But some of the State values
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.