Skip to main content
InSource Solutions

TN MES103 Querying the MES Production Line Hierarchy

insource logo large.jpg

 

Description

In MES 2014 users can now use the Wonderware MES web portal to configure production lines.  This article will show you how to query the entities that make up a production line. This query could be utilized when developing and MES application. 

 

  • Author: Michael Walker
  • Published: 05/14/2015
  • Applies to: Wonderware MES 2014

 

 

Details

The below picture represents a production line that has been defined within the MES web portal. It specifies a processing entity, then several parallel wrapping entities, then a packaging entity.

MESProdLine.PNG

 

When this line is built the MES Database is being updated to contain the corresponding line information.  Essentially tables that link the Line with the specified entities that comprise the line. Below is an example query to extract the line Hierarchy. 

 

select l.Line_Name,  e.Ent_Name from dbo.line l inner join
dbo.line_ent_link lel on l.line_id = lel.line_id inner join
dbo.ent e on e.ent_id = lel.ent_id
order by lel.child_order asc

 

Below is a picture of the query and the result set. 

 

MESProdLineSQLQuery.PNG

 

As mentioned above, this could be useful when developing an MES application. Understanding what entities are upstream and downstream from a specific entity, obtaining relative referencing information for entities that comprise the production line are just a few of the examples this query could be used for.