Sign In Help
Schneider Electric
HelpSign In
Schneider Electric Exchange
  • Home
  • Collaborate
  • Develop
  • Shop
Home Collaborate Develop Shop Log in or Register Help

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.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel

Invitation Sent

Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
  • Home
  • Collaborate
  • Exchange Community
  • :
  • SCADA & Telemetry Solutions
  • :
  • Geo SCADA Expert Forum
  • :
  • [Imported] SQL Join CGroup and CADVOUSTATION
Community Menu
  • Forums
    • By Topic
        • EcoStruxure IT
          • EcoStruxure IT forum
        • Industrial Automation
          • Industry Automation and Control Forum
          • Alliance System Integrators Forum
          • Machine Solutions in the Digital Transformation
          • EcoStruxure Automation Expert / IEC 61499 Forum
          • Industrial Edge Computing Forum
          • Level and Pressure Instrumentation Forum
          • Modicon User Group
          • PLC Club Indonesia
          • SEE Automation Club Forum
          • Fabrika ve Makina Otomasyonu Çözümleri
          • Форум по промышленной автоматизации СНГ
        • SCADA & Telemetry Solutions
          • Geo SCADA Expert Forum
          • SCADA and Telemetry Devices Forum
        • Power Distribution IEC
          • Power Distribution and Digital
          • Power Standards & Regulations
          • Paneelbouw & Energie Distributie
          • Eldistribution & Fastighetsautomation
        • Power Distribution Softwares
          • EcoStruxure Power Design Forum
          • SEE Electrical Building+ Forum
          • LayoutFAST User Group Forum
        • Wireless Information Network Solutions
          • Instrument Area Network
          • Remote Monitoring
          • Tank Level Monitoring
          • Remote Data Collection
        • Solutions for your Business
          • Solutions for Food & Beverage Forum
          • Solutions for Healthcare Forum
    • By Segment
        • Food & Beverage
          • Solutions for Food & Beverage Forum
        • Healthcare
          • Solutions for Healthcare Forum
      • EcoStruxure IT
        • EcoStruxure IT forum
      • Industrial Automation
        • Industry Automation and Control Forum
        • Alliance System Integrators Forum
        • Machine Solutions in the Digital Transformation
        • EcoStruxure Automation Expert / IEC 61499 Forum
        • Industrial Edge Computing Forum
        • Level and Pressure Instrumentation Forum
        • Modicon User Group
        • PLC Club Indonesia
        • SEE Automation Club Forum
        • Fabrika ve Makina Otomasyonu Çözümleri
        • Форум по промышленной автоматизации СНГ
      • SCADA & Telemetry Solutions
        • Geo SCADA Expert Forum
        • SCADA and Telemetry Devices Forum
      • Power Distribution IEC
        • Power Distribution and Digital
        • Power Standards & Regulations
        • Paneelbouw & Energie Distributie
        • Eldistribution & Fastighetsautomation
      • Power Distribution Softwares
        • EcoStruxure Power Design Forum
        • SEE Electrical Building+ Forum
        • LayoutFAST User Group Forum
      • Wireless Information Network Solutions
        • Instrument Area Network
        • Remote Monitoring
        • Tank Level Monitoring
        • Remote Data Collection
      • Solutions for your Business
        • Solutions for Food & Beverage Forum
        • Solutions for Healthcare Forum
      • Food & Beverage
        • Solutions for Food & Beverage Forum
      • Healthcare
        • Solutions for Healthcare Forum
  • Blogs
    • By Topic
        • Industrial Automation
          • Industrial Edge Computing Blog
          • Industry 4.0 Blog
          • Industrie du Futur France
        • SCADA & Telemetry Solutions
          • SCADA and Telemetry Blog
        • Power Distribution IEC
          • Power Events & Webinars
          • Power Foundations Blog
        • Power Distribution NEMA
          • NEMA Power Foundations Blog
        • Power Distribution Softwares
          • EcoStruxure Power Design Blog
          • SEE Electrical Building+ Blog
        • Solutions for your Business
          • Solutions for Food & Beverage Blog
          • Solutions for Healthcare Blog
          • Solutions for Retail Blog
        • Community experts & publishers
          • Publishers Community
    • By Segment
        • Food & Beverage
          • Solutions for Food & Beverage Blog
        • Healthcare
          • Solutions for Healthcare Blog
        • Retail
          • Solutions for Retail Blog
      • Industrial Automation
        • Industrial Edge Computing Blog
        • Industry 4.0 Blog
        • Industrie du Futur France
      • SCADA & Telemetry Solutions
        • SCADA and Telemetry Blog
      • Power Distribution IEC
        • Power Events & Webinars
        • Power Foundations Blog
      • Power Distribution NEMA
        • NEMA Power Foundations Blog
      • Power Distribution Softwares
        • EcoStruxure Power Design Blog
        • SEE Electrical Building+ Blog
      • Solutions for your Business
        • Solutions for Food & Beverage Blog
        • Solutions for Healthcare Blog
        • Solutions for Retail Blog
      • Community experts & publishers
        • Publishers Community
      • Food & Beverage
        • Solutions for Food & Beverage Blog
      • Healthcare
        • Solutions for Healthcare Blog
      • Retail
        • Solutions for Retail Blog
  • Ideas
        • Industrial Automation
          • Modicon Ideas & new features
        • SCADA & Telemetry Solutions
          • Geo SCADA Expert Ideas
          • SCADA and Telemetry Devices Ideas
  • Knowledge Center
    • Building Automation Knowledge Base
    • Industrial Automation Knowledge Base
    • Industrial Automation How-to videos
    • SCADA & Telemetry Solutions Knowledge Base
    • Digital E-books
    • Success Stories Corner
    • Power Talks
  • Events & Webinars
    • Innovation Talks
    • Innovation Summit
    • Let's Exchange Series
    • Technology Partners
  • Support
    • Ask Exchange
    • Leaderboard
    • Our Community Guidelines
    • Community User Guide
    • How-To & Best Practices
    • More
Join Now
How can we help?
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
51317members
Join Now
245520posts
Join Now

[Imported] SQL Join CGroup and CADVOUSTATION

Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Solved Go to Solution
Back to Geo SCADA Expert Forum
Solved
sbeadle
Sisko sbeadle Sisko
Sisko
‎2019-11-07 03:40 AM
0 Likes
1
411
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
‎2019-11-07 03:40 AM

[Imported] SQL Join CGroup and CADVOUSTATION

>>Message imported from previous forum - Category:ClearSCADA Software<<
User: hardin4019, originally posted: 2019-07-02 13:13:43 Id:463
Having some more fun with SQL queries.

I have a list that gives me several columns of meter data from the Group Points of from a template for said meter data that use OPC points, and a few modbus values from a valve associated with the meter location that are also mapped out in the Group Points. Inside the meter template is an instance of a valve Group template. The Valve Group contains its own comms folder and Advanced Modbus Outstation.

The modbus values from the valve can be assigned to the meter template/instance Group points without an issue, but I would like to assign the Modbus Outstation to the Group points or another metadata field and was failing to find a way to do that, so I resulted to SQL joining. Now I have a partially working list that shows the Modbus RTU Status, but I have lost the ability to click on points and see the object menu and cannot click on the RTU State and get any of the RTU object menu to appear. For clarification, the CGROUP.gChild01 contains the path of the MeterNumber.MOV.COMMS folder. Since it is nested inside of the meter folder 2 layers deeper, this is the only thing I could think of to match the Outstation to the grand parent group.

Sample of the Query:

Select
CGROUP.ID,
CGROUP.FullName AS "_FullName",
CGroup.objProperty02 AS "~Producer",
GPoint01-CurrentValueFormatted AS "Discharge Pressure", GPoint01 AS "_ID01,
CADVOUTSTATION.ID AS "_OSID",
CADVOUTSTATION.StateDesc
FROM
CGROUP Join CADVOUTSTATION ON CGROUP.gChild01 = CADVOUTSTATION.ParentGroupID


The script that appears to be checking the column # and Row # returns the correct column +1 and row +1 (assuming it is counting the header and an ID column not shown), but the script looks to be creating an additional query and has a resulting rs.rowcount = 0 where the script then ends. Not sure why after adding the SQL Join and new columns that this rs.rowcount suddenly stops working unless I somehow nerfed the query with the "From CGROUP Join CADVOUTSTATION On CGROUP.gChild01 = CADVOUTSTATION.ParentGroupID".

Solved! Go to Solution.

Labels
  • SCADA
Share
Reply

Accepted Solutions
sbeadle
Sisko sbeadle Sisko
Sisko
‎2019-11-07 03:41 AM
0 Likes
0
410
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
‎2019-11-07 03:41 AM

Re: [Imported] SQL Join CGroup and CADVOUSTATION

>>Responses imported from previous forum


Reply From User: hardin4019, posted: 2019-07-02 16:33:17
After further troubleshooting, there is a WHERE statement that is being used to limit the meter list to a certain types and regions. If it is present, then I don't get a rs.rowcount. Otherwise it works.

WHERE
CGroup.GrType IN ( 'Meter' ) and CGroup.ObjType IN ( 'Inlet' , 'Check' ) and "_FullName" Like 'Region 1.%'


Reply From User: BevanWeiss, posted: 2019-07-10 23:55:17
You haven't show what gChild01 would be... is it an ID which would match the CAdvOutstation ParentGroup's ID?

Or did you mean to use CAdvOutstatation.ParentGroupName instead?


Reply From User: hardin4019, posted: 2019-07-11 02:03:27
gChild01 in the meter group properties points to the comms folder and automatically populates since all of the groups are part of a template. The comms folder contains the RTU and would match the CAdvOutstation.ParentGroupName.

IE. MeterName.Valve.Comms.RTU where the MeterName group holds all of the OPC points, the Valve group holds all of the Modbus valve points, and in the comms folder is the RTU and channels for the valve points.

Since the valve comms folder is nested in the 3rd group, I couldn't find a way to join the two tables without giving some reference in the meter group that would bridge 2 groups deeper.


Reply From User: BevanWeiss, posted: 2019-07-11 05:38:43
[at]hardin4019 said:
gChild01 in the meter group properties points to the comms folder and automatically populates since all of the groups are part of a template. The comms folder contains the RTU and would match the CAdvOutstation.ParentGroupName.

IE. MeterName.Valve.Comms.RTU where the MeterName group holds all of the OPC points, the Valve group holds all of the Modbus valve points, and in the comms folder is the RTU and channels for the valve points.

Since the valve comms folder is nested in the 3rd group, I couldn't find a way to join the two tables without giving some reference in the meter group that would bridge 2 groups deeper.

You wrote this:
CGROUP.gChild01 = CADVOUTSTATION.ParentGroupID

If as you say gChild01 is "FullName".. this will not = 1897034 (i.e. the Parent Group ID).. since a number never 'equals' a string.

Provide your whole query, and an example of the data for every field referenced in the query.


Reply From User: hardin4019, posted: 2019-07-11 16:00:08
gChild01 only contains the parent group of the outstation. When I add CGroup.gChild01 to the query, the ID number and not the string name is what comes back as the result, and I can add the CAdvOustatation.ParentGroupID to the query, I can see that both ID's match. Doing the join and getting what I want displayed isn't the issue.

Are you saying that gChild01 returns a string (containing the ID number) instead of just an ID? I would have suspected that if that were the case, then the join would have never worked.

Full Query:

SELECT
CGROUP.ID,
CGROUP.FULLNAME AS "_FullName",
CGROUP.OBJPROPERTY02 AS "~Producer",
CGROUP.OBJSHORTDESC AS "~Meter\
Number",
CGROUP.OBJDISPLAYNAME AS "~Station",
CGROUP.OBJPROPERTY07 AS "~Gathering\
System",
CGROUP.OBJPROPERTY08 AS "~Compressor\
Station A",
CGROUP.OBJPROPERTY09 AS "~Compressor\
Station B",
GPOINT01-BACKGROUND AS "{Background01}", GPOINT01-FOREGROUND AS "{Foreground01}", GPOINT01-BLINK AS "{blink01}", GPOINT01-CURRENTVALUEFORMATTED AS "Discharge\
Pressure", GPOINT01 AS "_ID01",
GPOINT03-BACKGROUND AS "{Background03}", GPOINT03-FOREGROUND AS "{Foreground03}", GPOINT03-BLINK AS "{blink03}", GPOINT03-CURRENTVALUEFORMATTED AS "Temp", GPOINT03 AS "_ID03",
GPOINT04-BACKGROUND AS "{Background04}", GPOINT04-FOREGROUND AS "{Foreground04}", GPOINT04-BLINK AS "{blink04}", GPOINT04-CURRENTVALUEFORMATTED AS "Flow\
Rate", GPOINT04 AS "_ID04",
GPOINT05-BACKGROUND AS "{Background05}", GPOINT05-FOREGROUND AS "{Foreground05}", GPOINT05-BLINK AS "{blink05}", GPOINT05-CURRENTVALUEFORMATTED AS "T-day\
Volume", GPOINT05 AS "_ID05",
GPOINT07-BACKGROUND AS "{Background07}", GPOINT07-FOREGROUND AS "{Foreground07}", GPOINT07-BLINK AS "{blink07}", GPOINT07-CURRENTVALUEFORMATTED AS "Y-day's\
Volume", GPOINT07 AS "_ID07",
GPOINT15-BACKGROUND AS "{Background15}", GPOINT15-FOREGROUND AS "{Foreground15}", GPOINT15-BLINK AS "{blink15}", GPOINT15-CURRENTVALUEFORMATTED AS "MTR\
DCV", GPOINT15 AS "_ID15",
GPOINT16-BACKGROUND AS "{Background16}", GPOINT16-FOREGROUND AS "{Foreground16}", GPOINT16-BLINK AS "{blink16}", GPOINT16-CURRENTSTATEDESC AS "MTR\
Comms", GPOINT16 AS "_ID16",
GPOINT13-BACKGROUND AS "{Background13}", GPOINT13-FOREGROUND AS "{Foreground13}", GPOINT13-BLINK AS "{blink13}", GPOINT13-CURRENTSTATEDESC AS "Valve\
Status", GPOINT13 AS "_ID13",
GPOINT14-BACKGROUND AS "{Background14}", GPOINT14-FOREGROUND AS "{Foreground14}", GPOINT14-BLINK AS "{blink14}", GPOINT14-CURRENTSTATEDESC AS "Cmd\
Status", GPOINT14 AS "_ValveStatus",
GPOINT10-BACKGROUND AS "{Background10}", GPOINT10-FOREGROUND AS "{Foreground10}", GPOINT10-BLINK AS "{blink10}", GPOINT10-CURRENTVALUEFORMATTED AS "Upstream\
Pressure", GPOINT10 AS "_ID10",
GPOINT11-BACKGROUND AS "{Background11}", GPOINT11-FOREGROUND AS "{Foreground11}", GPOINT11-BLINK AS "{blink11}", GPOINT11-CURRENTVALUEFORMATTED AS "Downstream\
Pressure", GPOINT11 AS "_ID11",
GPOINT02-BACKGROUND AS "{Background02}", GPOINT02-FOREGROUND AS "{Foreground02}", GPOINT02-BLINK AS "{blink02}", GPOINT02-CURRENTVALUEFORMATTED AS "Differential\
Pressure", GPOINT02 AS "_ID02",
GPOINT12-BACKGROUND AS "{Background12}", GPOINT12-FOREGROUND AS "{Foreground12}", GPOINT12-BLINK AS "{blink12}", GPOINT12-CURRENTVALUEFORMATTED AS "MOV\
DCV", GPOINT12 AS "_ID12",
CADVOUTSTATION.STATEDESC,
CADVOUTSTATION.ID AS "_ID"
FROM
CGROUP JOIN CADVOUTSTATION ON CGROUP.GCHILD01 = CADVOUTSTATION.PARENTGROUPID
WHERE
CGROUP.GRPTYPE IN ( 'Meter' ) AND CGROUP.OBJTYPE IN ( 'Inlet', 'Check' ) AND "_FullName" LIKE 'Region1.%'
ORDER BY
"~Meter\
Number" ASC


Reply From User: BevanWeiss, posted: 2019-07-12 00:25:33
gChild01 is a customised Metadata field from YOUR custom configuration.
So you should be the person that knows what the configuration of it is :tongue:

Does the query return results if you remove the JOIN conditions (and fields from return)


Reply From User: hardin4019, posted: 2019-07-12 01:09:48
Yes if I leave off the join it returns results. It also returns results with the join. But with the where and join both present, I'm not getting a row count. That is what has me stumped.


Reply From User: BevanWeiss, posted: 2019-07-15 12:25:34
When you call the following query... how many of these entries have CGROUP.GRPTYPE = 'Meter', AND CGROUP.OBJTYPE = 'Inlet' or 'Check'?

SELECT
CGROUP.ID,
CGROUP.FULLNAME AS "_FullName",
CGROUP.OBJPROPERTY02 AS "~Producer",
CGROUP.OBJSHORTDESC AS "~Meter\
Number",
CGROUP.OBJDISPLAYNAME AS "~Station",
CGROUP.OBJPROPERTY07 AS "~Gathering\
System",
CGROUP.OBJPROPERTY08 AS "~Compressor\
Station A",
CGROUP.OBJPROPERTY09 AS "~Compressor\
Station B",
CGROUP.GRPTYPE,
CGROUP.OBJTYPE,
CGROUP.GCHILD01,
CADVOUTSTATION.PARENTGROUPID
FROM
CGROUP JOIN CADVOUTSTATION ON CGROUP.GCHILD01 = CADVOUTSTATION.PARENTGROUPID
WHERE "_FullName" LIKE 'Region1.%'
ORDER BY
"~Meter\
Number" ASC


I suspect the answer is 0 (zero)... hence why your query including the WHERE clause returns no rows.


Reply From User: hardin4019, posted: 2019-07-15 12:45:22
Approximately 130 rows.


Reply From User: hardin4019, posted: 2019-07-15 16:30:33
Found a working solution.

I was able to go in and add my own Metadata field to the CGroup table that is linked to the Modbus Outstation and add the new column to my query without issue. Pick Actions work and return the correct Pick Action menu for the Outstation.

See Answer In Context

Share
Reply
  • All forum topics
  • Previous Topic
  • Next Topic
1 Reply 1
sbeadle
Sisko sbeadle Sisko
Sisko
‎2019-11-07 03:41 AM
0 Likes
0
411
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content
‎2019-11-07 03:41 AM

Re: [Imported] SQL Join CGroup and CADVOUSTATION

>>Responses imported from previous forum


Reply From User: hardin4019, posted: 2019-07-02 16:33:17
After further troubleshooting, there is a WHERE statement that is being used to limit the meter list to a certain types and regions. If it is present, then I don't get a rs.rowcount. Otherwise it works.

WHERE
CGroup.GrType IN ( 'Meter' ) and CGroup.ObjType IN ( 'Inlet' , 'Check' ) and "_FullName" Like 'Region 1.%'


Reply From User: BevanWeiss, posted: 2019-07-10 23:55:17
You haven't show what gChild01 would be... is it an ID which would match the CAdvOutstation ParentGroup's ID?

Or did you mean to use CAdvOutstatation.ParentGroupName instead?


Reply From User: hardin4019, posted: 2019-07-11 02:03:27
gChild01 in the meter group properties points to the comms folder and automatically populates since all of the groups are part of a template. The comms folder contains the RTU and would match the CAdvOutstation.ParentGroupName.

IE. MeterName.Valve.Comms.RTU where the MeterName group holds all of the OPC points, the Valve group holds all of the Modbus valve points, and in the comms folder is the RTU and channels for the valve points.

Since the valve comms folder is nested in the 3rd group, I couldn't find a way to join the two tables without giving some reference in the meter group that would bridge 2 groups deeper.


Reply From User: BevanWeiss, posted: 2019-07-11 05:38:43
[at]hardin4019 said:
gChild01 in the meter group properties points to the comms folder and automatically populates since all of the groups are part of a template. The comms folder contains the RTU and would match the CAdvOutstation.ParentGroupName.

IE. MeterName.Valve.Comms.RTU where the MeterName group holds all of the OPC points, the Valve group holds all of the Modbus valve points, and in the comms folder is the RTU and channels for the valve points.

Since the valve comms folder is nested in the 3rd group, I couldn't find a way to join the two tables without giving some reference in the meter group that would bridge 2 groups deeper.

You wrote this:
CGROUP.gChild01 = CADVOUTSTATION.ParentGroupID

If as you say gChild01 is "FullName".. this will not = 1897034 (i.e. the Parent Group ID).. since a number never 'equals' a string.

Provide your whole query, and an example of the data for every field referenced in the query.


Reply From User: hardin4019, posted: 2019-07-11 16:00:08
gChild01 only contains the parent group of the outstation. When I add CGroup.gChild01 to the query, the ID number and not the string name is what comes back as the result, and I can add the CAdvOustatation.ParentGroupID to the query, I can see that both ID's match. Doing the join and getting what I want displayed isn't the issue.

Are you saying that gChild01 returns a string (containing the ID number) instead of just an ID? I would have suspected that if that were the case, then the join would have never worked.

Full Query:

SELECT
CGROUP.ID,
CGROUP.FULLNAME AS "_FullName",
CGROUP.OBJPROPERTY02 AS "~Producer",
CGROUP.OBJSHORTDESC AS "~Meter\
Number",
CGROUP.OBJDISPLAYNAME AS "~Station",
CGROUP.OBJPROPERTY07 AS "~Gathering\
System",
CGROUP.OBJPROPERTY08 AS "~Compressor\
Station A",
CGROUP.OBJPROPERTY09 AS "~Compressor\
Station B",
GPOINT01-BACKGROUND AS "{Background01}", GPOINT01-FOREGROUND AS "{Foreground01}", GPOINT01-BLINK AS "{blink01}", GPOINT01-CURRENTVALUEFORMATTED AS "Discharge\
Pressure", GPOINT01 AS "_ID01",
GPOINT03-BACKGROUND AS "{Background03}", GPOINT03-FOREGROUND AS "{Foreground03}", GPOINT03-BLINK AS "{blink03}", GPOINT03-CURRENTVALUEFORMATTED AS "Temp", GPOINT03 AS "_ID03",
GPOINT04-BACKGROUND AS "{Background04}", GPOINT04-FOREGROUND AS "{Foreground04}", GPOINT04-BLINK AS "{blink04}", GPOINT04-CURRENTVALUEFORMATTED AS "Flow\
Rate", GPOINT04 AS "_ID04",
GPOINT05-BACKGROUND AS "{Background05}", GPOINT05-FOREGROUND AS "{Foreground05}", GPOINT05-BLINK AS "{blink05}", GPOINT05-CURRENTVALUEFORMATTED AS "T-day\
Volume", GPOINT05 AS "_ID05",
GPOINT07-BACKGROUND AS "{Background07}", GPOINT07-FOREGROUND AS "{Foreground07}", GPOINT07-BLINK AS "{blink07}", GPOINT07-CURRENTVALUEFORMATTED AS "Y-day's\
Volume", GPOINT07 AS "_ID07",
GPOINT15-BACKGROUND AS "{Background15}", GPOINT15-FOREGROUND AS "{Foreground15}", GPOINT15-BLINK AS "{blink15}", GPOINT15-CURRENTVALUEFORMATTED AS "MTR\
DCV", GPOINT15 AS "_ID15",
GPOINT16-BACKGROUND AS "{Background16}", GPOINT16-FOREGROUND AS "{Foreground16}", GPOINT16-BLINK AS "{blink16}", GPOINT16-CURRENTSTATEDESC AS "MTR\
Comms", GPOINT16 AS "_ID16",
GPOINT13-BACKGROUND AS "{Background13}", GPOINT13-FOREGROUND AS "{Foreground13}", GPOINT13-BLINK AS "{blink13}", GPOINT13-CURRENTSTATEDESC AS "Valve\
Status", GPOINT13 AS "_ID13",
GPOINT14-BACKGROUND AS "{Background14}", GPOINT14-FOREGROUND AS "{Foreground14}", GPOINT14-BLINK AS "{blink14}", GPOINT14-CURRENTSTATEDESC AS "Cmd\
Status", GPOINT14 AS "_ValveStatus",
GPOINT10-BACKGROUND AS "{Background10}", GPOINT10-FOREGROUND AS "{Foreground10}", GPOINT10-BLINK AS "{blink10}", GPOINT10-CURRENTVALUEFORMATTED AS "Upstream\
Pressure", GPOINT10 AS "_ID10",
GPOINT11-BACKGROUND AS "{Background11}", GPOINT11-FOREGROUND AS "{Foreground11}", GPOINT11-BLINK AS "{blink11}", GPOINT11-CURRENTVALUEFORMATTED AS "Downstream\
Pressure", GPOINT11 AS "_ID11",
GPOINT02-BACKGROUND AS "{Background02}", GPOINT02-FOREGROUND AS "{Foreground02}", GPOINT02-BLINK AS "{blink02}", GPOINT02-CURRENTVALUEFORMATTED AS "Differential\
Pressure", GPOINT02 AS "_ID02",
GPOINT12-BACKGROUND AS "{Background12}", GPOINT12-FOREGROUND AS "{Foreground12}", GPOINT12-BLINK AS "{blink12}", GPOINT12-CURRENTVALUEFORMATTED AS "MOV\
DCV", GPOINT12 AS "_ID12",
CADVOUTSTATION.STATEDESC,
CADVOUTSTATION.ID AS "_ID"
FROM
CGROUP JOIN CADVOUTSTATION ON CGROUP.GCHILD01 = CADVOUTSTATION.PARENTGROUPID
WHERE
CGROUP.GRPTYPE IN ( 'Meter' ) AND CGROUP.OBJTYPE IN ( 'Inlet', 'Check' ) AND "_FullName" LIKE 'Region1.%'
ORDER BY
"~Meter\
Number" ASC


Reply From User: BevanWeiss, posted: 2019-07-12 00:25:33
gChild01 is a customised Metadata field from YOUR custom configuration.
So you should be the person that knows what the configuration of it is :tongue:

Does the query return results if you remove the JOIN conditions (and fields from return)


Reply From User: hardin4019, posted: 2019-07-12 01:09:48
Yes if I leave off the join it returns results. It also returns results with the join. But with the where and join both present, I'm not getting a row count. That is what has me stumped.


Reply From User: BevanWeiss, posted: 2019-07-15 12:25:34
When you call the following query... how many of these entries have CGROUP.GRPTYPE = 'Meter', AND CGROUP.OBJTYPE = 'Inlet' or 'Check'?

SELECT
CGROUP.ID,
CGROUP.FULLNAME AS "_FullName",
CGROUP.OBJPROPERTY02 AS "~Producer",
CGROUP.OBJSHORTDESC AS "~Meter\
Number",
CGROUP.OBJDISPLAYNAME AS "~Station",
CGROUP.OBJPROPERTY07 AS "~Gathering\
System",
CGROUP.OBJPROPERTY08 AS "~Compressor\
Station A",
CGROUP.OBJPROPERTY09 AS "~Compressor\
Station B",
CGROUP.GRPTYPE,
CGROUP.OBJTYPE,
CGROUP.GCHILD01,
CADVOUTSTATION.PARENTGROUPID
FROM
CGROUP JOIN CADVOUTSTATION ON CGROUP.GCHILD01 = CADVOUTSTATION.PARENTGROUPID
WHERE "_FullName" LIKE 'Region1.%'
ORDER BY
"~Meter\
Number" ASC


I suspect the answer is 0 (zero)... hence why your query including the WHERE clause returns no rows.


Reply From User: hardin4019, posted: 2019-07-15 12:45:22
Approximately 130 rows.


Reply From User: hardin4019, posted: 2019-07-15 16:30:33
Found a working solution.

I was able to go in and add my own Metadata field to the CGroup table that is linked to the Modbus Outstation and add the new column to my query without issue. Pick Actions work and return the correct Pick Action menu for the Outstation.

See Answer In Context

Share
Reply
Related Products
Schneider Electric
EcoStruxure™ Geo SCADA Expert
Top Experts
User Count
sbeadle
Sisko sbeadle Sisko
188
BevanWeiss
Sisko BevanWeiss
53
AdamWoodland
Lt. Commander AdamWoodland Lt. Commander
16
JChamberlain
Lieutenant JChamberlain Lieutenant
16
AndrewScott
Lieutenant AndrewScott
15
See More Top Experts
Find a Service Provider
Find a certified partner to help you address your integration, installation, maintenance and project needs.
View all Providers
Support

Have a question? Please contact us with details, and we will respond.

Contact Us
FAQ

Look through existing questions to find popular answers.

Learn More
About

Want to know more about Exchange and its possibilities?

Learn More

Full access is just steps away!

Join Exchange for FREE and get unlimited access to our global community of experts.

Connect with Peers & Experts

Discuss challenges in energy and automation with 30,000+ experts and peers.

Get Support in Our Knowledge Base

Find answers in 10,000+ support articles to help solve your product and business challenges.

Ask Questions. Give Solutions

Find peer based solutions to your questions. Provide answers for fellow community members!

Register today for FREE

Register Now

Already have an account?Log in

About Us FAQ Terms & Conditions Privacy Notice Change your cookie settings
©2020, Schneider Electric