Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84248members
353348posts

[Imported] How many sites under a communication channel are in comm. failure?

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

Solved
sbeadle
Janeway Janeway
Janeway
0 Likes
1
430

[Imported] How many sites under a communication channel are in comm. failure?

>>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.


Accepted Solutions
sbeadle
Janeway Janeway
Janeway

Re: [Imported] How many sites under a communication channel are in comm. failure?

>>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

See Answer In Context

1 Reply 1
sbeadle
Janeway Janeway
Janeway

Re: [Imported] How many sites under a communication channel are in comm. failure?

>>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