Documente Academic
Documente Profesional
Documente Cultură
Mdf Bible
Mdf MES Development framework
7
Contents
Introduction........................................................................................... 11
Aboutthisbook ..................................................................................... 12
Systemrequirements ............................................................................ 14
Supportforthisbook ............................................................................ 15
Part1 ............................................................................................................. 17
5
ISA95andMESapplication................................................................. 19
5.1
Equipmenthierarchicalmodel ...................................................... 20
5.2
Equipmentmodel .......................................................................... 22
5.3
Materialmodel .............................................................................. 23
5.4
Personnelmodel............................................................................ 24
5.5
Processsegmentmodel ................................................................ 25
5.6
Highlevelmodels .......................................................................... 27
5.7
Productioncapability..................................................................... 29
5.8
Productioncapabilityutilization.................................................... 31
5.9
Productdefinitioninformation ..................................................... 33
5.10
Productionschedule...................................................................... 35
5.11
ProductionPerformance ............................................................... 37
B2MML .................................................................................................. 39
6.1
SegmentRequirement .................................................................. 40
6.2
MaterialDefinition ........................................................................ 42
Mdf:ISA95andVisualStudio.NET....................................................... 43
7.1
MdfComponents........................................................................... 44
7.1.1
TheBusinessEntitiesproject................................................. 44
7.1.2
TheCustomClassGenerator ................................................. 45
Mdfarchitecture ................................................................................... 51
EntityFramework .................................................................................. 53
9.1
LINQtoEntities.............................................................................. 54
9.2
EntityDataModelMapping .......................................................... 54
9.3
ObjectService................................................................................ 54
9.4
EntityClientDataProvider ............................................................ 55
9.5
Somequeryexamples ................................................................... 55
10
WorkflowFoundation......................................................................... 57
10.1
SequentialWorkflow..................................................................... 58
10.2
StateMachineWorkflow............................................................... 59
Part2 ............................................................................................................. 61
11
InstallandconfigureMdf ................................................................... 63
11.1
MdfandMSDTC............................................................................. 63
11.2
Mdfconfiguration.......................................................................... 66
11.3
MdfPortaldatabaseconnection................................................... 66
11.4
Constantsandparameters ............................................................ 67
11.5
Sequences...................................................................................... 68
12
ModelMESapplication ...................................................................... 69
12.1
Mdfmodels ................................................................................... 69
12.1.1
HandlingUnitmodel.............................................................. 69
12.1.2
Ordermodel .......................................................................... 70
12.1.3
ProjectEntitiesmodel ........................................................... 70
12.2
Resourcemodelsdefinition........................................................... 71
12.2.1
Howtoaddanewclass ......................................................... 73
12.2.2
Howtoaddanewclassproperty.......................................... 73
12.2.3
Howtoaddclasspropertiestoaclass ................................. 74
12.3
Howtocreateaninstancesofcustomclass ................................. 76
12.4
ProcessSegmentDefinition .......................................................... 77
13
Customproductionrule ..................................................................... 80
13.1
Definematerialclassesforproducts............................................. 80
13.2
Howtocreateacustomproductionrule ...................................... 81
13.2.1
Howtodefineanaddproductionrulemethod .................... 82
13.2.2
Howtodefineamodifyproductionrulemethod ................. 84
13.2.3
Howtodefineadeleteproductionrulemethod .................. 84
13.3
ProductionRulepresentationlayer .............................................. 84
13.4
Conclusions.................................................................................... 84
14
Customproductionschedule ............................................................. 85
14.1
Howtorealizeanaddnewproductionschedule.......................... 86
14.2
Howtorealizeadeletemethod.................................................... 90
14.3
Howtorealizeamodifymethod................................................... 91
15
Collectproductiondata ...................................................................... 92
15.1
Productionperformance ............................................................... 92
15.2
Productioncapability..................................................................... 93
15.3
Productioncapabilityutilization.................................................... 94
15.4 Howtopopulatetheproductionperformanceandcapability
utilizationmodels ...................................................................................... 96
15.4.1
Startaproductionorder........................................................ 96
15.4.2
Stopaproductionorder ........................................................ 98
15.4.3
Restartaproductionorder.................................................. 100
16.1
16.2
Howtoviewareport................................................................... 108
17.1
10
Appendix...................................................................................................... 113
A. Bibliography......................................................................................... 114
B. Website............................................................................................... 115
11
1 INTRODUCTION
The scope of this book is to introduce the reader to the use of the new
library Mdf. Mdf stands for MES development framework and its purpose is to
aid programmers in MES application to develop their solution easier and
faster in respect of the standard ANSI/ISA 95 and its implementation B2MML.
Mdf library was launched at the beginning of 2007 and completely reworked
by the end of 2008 with LINQ to Entities technology.
The intent of this book is to support the reared, by explanations and code
examples, in developing of MES applicative modules using Mdf library.
12
13
title of Information and Industrial Engineer from the Italian State in 2007.
Since 2006 he attends an Industrial Research Doctorate in Artificial Intelligent
Systems held by DIIGA, Universit Politecnica delle Marche, Ancona (Italy) in
collaboration with Integra Software Srl, Jesi (Italy). Selected for the Siemens
Student Program, he got several industrial collaborations with them. His main
research interests include autonomous robotics, agent based software
systems, fault detection and diagnosis for industrial systems, supervision and
management of manufacture systems, Linux and high availability systems.
He is currently Assistant Researcher at the Technical University of Denmark
(DTU), Kgs. Lyngby (Denmark) to design methods and algorithms for datadriven fault detection and diagnosis as part of his PhD program.
He is collaborating with EmPy studio (Naples, Italy), on the definition of
reliable .NET tools for ISA-95 compliant Manufacturing Execution Systems
development.
Claudio Palomba.
Claudio Palomba was born in Naples, Italy on 5 July 1983. In 2006 he
accomplished the Bachelor of Automation Engineering degree with a
graduation thesis about the use of genetic algorithm for material cutting.
In the same year he started studying for the Master of Automation
Engineering degree, within this framework, he is now involved in the
internship with EmPy studio for writing this book in order to complete the
studies with the degree thesis which this book is related.
14
3 SYSTEM REQUIREMENTS
The system required for using Mdf library are the following:
http://www.microsoft.com/downloads/details.aspx?FamilyId=333325FDAE52-4E35-B531-508D977D32A6&displaylang=en
2
http://www.empystudio.com/Mdf/Downloads.aspx
15
1
2
3
http://www.isa.org/
https://www.wbf.org/catalog/b2mml.php
http://asp.net
16
17
P ART 1
18
19
20
All the models defined in the standard are structured hierarchically. The
modelling procedure consists of two phases: definition of the resource
models than introduction of the relationships between.
The resource models are split in three models:
Equipment model,
Material model,
Personnel model.
5.1
Level 0,1,2
Level 3
Level 4
21
Under the area level there are the lowest level equipment typically
scheduled by the level 4 or level 3 functions, which are splits depend
on manufacturing process type:
o
The following paragraphs will show the various model defined by ISA-95
standard. To increase the readability the properties of the models will not be
discussed. For a detailed review please refer toISA2000.
In the following all the graphs which will be introduced will make use of a
table of colour.
Both resource and high level models may be referenced by other model
tables.
22
5.2
Equipment model
The equipment model contains the information about specific equipment, the
classes of equipment, both of them with their own property (several
equipment property maps to equipment class property), equipment capability
test, and maintenance information associated with equipment. Figure 5-2
illustrate the ISA-95 equipment model.
23
5.3
Material model
The material model defines the actual materials (split in lot and sublot
material), material definitions, and information about classes of material
definitions, which of them with their own property (several material
definitions property maps to material class property and some material lot
property maps to definition material property). Figure 5-3 illustrates the
material model.
24
5.4
Personnel model
The personnel model contains the information about specific personnel, class
of personnel, both of them with their own property (several person property
maps to personnel class property), and qualifications of personnel. Figure 5-4
illustrates the personnel model.
25
training and/or experience for specific operations. A qualification test
specification may test for one or more properties.
5.5
26
27
5.6
The models describe so far are the core of the MES, they define the data
which will be used to define higher level models. It is possible to mark two
model groups, one of these contain all models concerning the capability data
and the other contain all models involved in production.
Production
Capability
What resources
are/will be available
Corresponds
to a
Resource
Capability
Production
Capability
Corresponds
to a
Corresponds
to a
Resource
Segment
Capability
Process
Capability
Process
Segment
Capability
Process
Segment
Resource
Segment
What can be
Specification
generally done
with the resources
Corresponds
to a
Resource
Process
Capability
utilization
What was done
with the resources
Production
Capability
Utilization
What resources
are/were used
Process
Segment
Segment
Capability
Utilization
Corresponds
to a
Resource
Capability
Utilization
Corresponds
to a
Corresponds
to a
What can be
done with the
resources
Process
Segment
Capability
Utilization
Corresponds
to a
Production
Capability
Utilization
28
represents the linker model between the resources model and the high level
ones. It expresses what can be generally done with the resources.
Still referring to the Figure 5-6 the first two models are strongly dependent;
indeed the process capability model is present as a part of the production
capability model. Its the same for the two last models.
29
5.7
Production capability
The production capabilities data are the collection of information about all the
resources available in production at a given time. These information are
obtained by combination of the available, committed, and unattainable
capability. Hence the production capabilities represents the theoretical
maximum capabilities available for use in production.
30
Corresponds to
Process
Segment
Is defined as a collection of
0..n
0..n
0..n
Equipment
Segment
Capability
Material
Segment
Capability
Personnel
Segment
Capability
Corresponds
to element in
1..1
Equipment Model
Corresponds
to element in
1..1
Material Model
Corresponds
to element in
1..1
Personnel Model
31
5.8
0..n
0..n
0..n
Material
Capability
Utilization
Personnel
Capability
Utilization
Process
Segment
Capability
Utilization
Corresponds
to element in
1..1
Equipment Model
Material Model
Corresponds
to element in
1..1
Personnel Model
32
Corresponds to
Process
Segment
Is defined as a collection of
0..n
0..n
0..n
Equipment
Segment
Capability
Utilization
Material
Segment
Capability
Utilization
Personnel
Segment
Capability
Utilization
Corresponds
to element in
1..1
Equipment Model
Corresponds
to element in
1..1
Material Model
Corresponds
to element in
1..1
Personnel Model
33
5.9
The product definition information model collects the information required for
the production of a specific product. This information is shared between
production rules, bill of material and bill of resources. Figure 5-12 illustrates
the ISA-95 product definition information model.
Has a reference to
Bill of Resources
(Externel)
Bill of Materia
(External)
Has a reference to
Has associated
Has associated
0..n
Has associated
Product
Production Rule
0..n
Manufacturing
Bill
1..1
Has associated
May be
made up of
0..n
0..n
1..n
Product
Segment
Corresponds to
Process
Segment
Is defined as a collection of
0..n
Product
Paremeter
0..n
0..n
0..n
Equipment
Segment
Capability
Material
Segment
Capability
Personnel
Segment
Capability
Corresponds
to element in
Equipment Model
1..1
Corresponds
to element in
1..1
1..n
Material Model
Corresponds
to element in
1..1
Personnel Model
34
35
5.10
Production schedule
The production schedule model contains all of the information about the
execution of scheduled production runs. Figure 5-13 illustrates the product
definition information model.
36
37
5.11
Production Performance
The production performances are obtained collecting what was made and
used for production. Figure 5-14 illustrates the production performance
model.
38
Consumable actual include resources that are consumed and that are
not included in a bill of material.
39
6 B2MML
The Business to Manufacturing Markup Language (B2MML) is used courtesy
of the World Batch Forum (WBF) The organization for production
technology 1 . WBF is a non-profit, non commercial end-user oriented
professional organization and it is an association of vendor, consultants, enduser and academics.
B2MML is an XML implementation of the ANSI/ISA 95 family of standards.
B2MML consists of a set of XML schemas written using the Word Wide Web
Consortiums XML Schemas language (XSD) that implement the data models
in the ISA95 standard.
The B2MML standard is widely used for the communication between
Enterprise Resource Planning (ERP) and Manufacturing Execution System
(MES), for example more product of the ICT company SAP allow to easy
import and export data by B2MML protocols.
A MES solution that support B2MML is possible to easy integrate this one to
other ICT modules in order to obtain an high automated enterprise. Moreover
the compatibility with B2MML reduce the implementation time, for example if
an enterprise that produce perfumes have made all production rules in
respect of B2MML standard, the MES solution have only to integrate them
instead of rewrite them all.
In chapter 5 are shown the ISA 95 models without the relatives attributes.
The description of these attributes is the intent of ISA 95 Part 2. A B2MML
schema consist in accurate transposition of the ISA 95 models with all
attributes. In order to increment compatibility and customizability in B2MML
schemas are added some other attribute, like Extended or Any, that allow
the programmer to adapt models to their own needs. Moreover B2MML add
some new models to the ISA 95 standards ones, like Common model that
contain the information that is used in common by B2MML equipment,
material, personnel, maintenance, capabilities, product definition, production
schedule and production performance schemas.
Other information about B2MML is available on the WBF web site at the
B2MML page 2
The following paragraphs show two examples of B2MML schemas and in both
of them the added attributes are highlighted.
1
2
https://www.wbf.org/catalog/
https://www.wbf.org/catalog/b2mml.php
40
The two example are a description of segment requirement in the production
schedule model and a Xml implementation of material definition in the
material model.
6.1
Segment Requirement
The definition that the B2MML standards gives for this table of the production
schedule model is similar to the ISA 95 definition but it is more accurate
where it says that a segment requirement corresponds to either a product
segment or a process segment. B2MML suggest that in order to respect the
spirit of the ISA 95 standard, a segment requirement should corresponds to a
product segment while a product segment should refer to a process segment.
In this way the segment requirement point to the product segment but it can
contain both product or process segment properties, for this reason the
production parameters are partitioned in process parameter and production
parameter.
The only attributes that are already present in ISA 95 standards are: ID,
Production Segment ID, Process Segment ID, Description, Earliest Start
Time, Latest End Time and Duration, and these are show in the following
diagram with orange colour blokes. The other blue blokes are B2MML
introduced attributes.
In particular B2MML introduced the possibility that a Segment Requirement
could refer to another Segment Requirement.
Figure 6-1 illustrates the Segment Requirement XML schema.
41
42
6.2
Material Definition
In this case only Extended and Any are been added to the ISA 95 standard
attributes, besides of course MaterialClassID and MaterialLotID that are
defined implicitly by ISA 95 material model though they are not expressly
indicate as material definition attributes.
43
.NET Framework
SQL Sever
The .NET Framework is a Windows component that provides an objectoriented programming environment. It has two main component: the
Common Language Runtime and the .NET Framework class library. The
runtime is regarded as an agent that manage code at the execution time,
and providing some core services such as memory management, thread
management, and remoting. The class library is a collection of reusable types
that you can use to develop applications or other custom object library.
Microsoft .NET supports multiple languages such as Visual Basic .NET, Visual
C# .NET, Visual J#.NET and many more that follow the Common Language
Infrastructure specification. More information about .NET are available on
Microsoft Developer Network (MSDN) .NET Framework Developer Center 1
web site. For Mdf we opt for Visual C# .NET language.
SQL Server is a database platform that is composed by three main part:
Database Engine, Analysis Services and Reporting Services. The Database
Engine is the core service for storing data and includes some other services
such as creating indexes, views, and stored procedures for viewing,
managing, and securing data. Analysis Services is the core services for
supporting rapid analysis of business data, delivering online analytical
processing (OLPA) and data mining functionality in business intelligence
applications. Reporting Services is a server-based reporting platform that
provides comprehensive data reporting from relational and multidimensional
data sources. More information about SQL Server are available on Microsoft
1
http://msdn.microsoft.com/en-us/netframework/default.aspx
44
Developer Network (MSDN) SQL Server Developer Center 1 web site. For
Mdf we use SQL Server as storage layer of the Mdf architecture that will deal
with in the following chapter. Mdf also use the SQL tool Reporting Services to
create and manage production reporting.
7.1
Mdf Components
7.1.1
The Business Entities has two base functions. It is the interface between
storage layer and the other projects that make up a MES application, such as
a web application for accessing the MES data. This function is obtained by
creating an ADO.NET Entity Data Model, by using the LINQ to Entities
technology (see Chapter 9), for each resource (Equipment, material and
Personnel), Order, and Project Entities models (that are an extension of
ISA95 and B2MML models), and the other ISA95 high level models.
Business Entities is also the MES solution core, because provide all custom
classes with a standard set of business rules (automatically generated by the
CCG) that can be extended by using the partial class technique in order to
include in each class all others methods and business rules required by the
particular MES implementation. The partial class technique make it possible
to split the definition of a class over two or more source files. Each source file
contains a section of the class definition, and all parts are combined when
the application is compiled. In this way its possible to add class methods
without having to edit the file created by the Custom Class Generator.
http://msdn.microsoft.com/en-us/sqlserver/default.aspx
45
7.1.2
On Business Entities works the Custom Class Generator (CCG) that is a Visual
Studio 2008 add-on, installed with Mdf. It works by following a custom class
pattern shown in Figure 7-1.
Packaging Line
Packaging Line 02
Elements:
Elements:
Properties:
Enterprise
Packaging Line
Site
Packaging Line 01
Packaging Line 02
Packaging Line 03
Status: Available
Package Counter: 10
46
element related to a material class but for the sake of simplicity this example
contain only the tables related to Material Definition elements.
Raw Material
Alcohol
Elements:
Properties:
Colouring 51
Alcohol
Essence 192
Gradation: 96%
Material Classes
Elements:
Elements:
Raw Material
Semi Finished
Purity
Gradation
Cream type
Semi Finished
Iri Cream
Elements:
Properties:
Limoncello
Iri Cream
Gradation: 15%
Cream type: with whole milk
47
48
49
The following code is refer to the custom method ResetPackagingCounter:
public partial class PackagingLine
{
public void ResetPackagingCounter()
{
this.PackageCounter = 0;
}
public static void ResetPackagingCounter(string packagingLineID)
{
PackagingLine packageLine = PackagingLine.Load(packagingLineID);
packageLine.ResetPackagingCounter();
packageLine.Save();
}
}
The code above extends the PackagingLine class with a custom method. A
example could be Reset Package Counter, it provide to reset the Package
Counter property and could be invoked for example every hour in order to
count the number of package per hour that this line can actual provide. This
method is written in a custom class file in the Business Entities project that
extend the class with the partial class method.
The CCG makes these changes when it notices that there is a new custom
class, but it dont do nothing when a custom class is deleted from the
database. The CCG use this policy to preserve data that could by inserted in
the custom class table. For example: if you erase an entry from Equipment
Class you are deleting an equipment custom class for which the CCG has
generate a table. This one could contain important data that shouldnt be lost
so the is better not to delete this table.
The Figure 7-8 illustrates the class diagrams for RowMaterial and
SemiFinished classes.
50
51
8 MDF ARCHITECTURE
A MES solution developed with Mdf is based on a client-server architecture.
This allow the application to be scaled while assuring higher levels of
dependability. Maintenance operations are simplified as well, since will be
dealing only with single system part.
Main advantages guaranteed from this architecture type are:
All the client machines will access the server functions through a web
browser like internet Explorer.
52
No limitation on the client number is set. In this way each personal computer
connected to the factory network will be able to access the data shared by
the MES solution.
Microsoft .NET technology is used to guarantee simple and faster
maintenance of the system graphical user interfaces. This solution is scalable
on the need and allows to easy code web application to be used in the
factory Intranet or to be exposed on the factory website to allow the data
access also from outside the factory.
Web solutions carry a number of advantages, like:
Simpler maintenance. The computing part and the logics are running
only on the server. An update on the server will be automatically
reflected on all the clients.
53
9 ENTITY FRAMEWORK
Entity Framework is a component of ADO.NET which is an integral part of the
.Net Framework. ADO.NET is a collection of classes that expose data access
service for .NET Framework programmers. Its purpose is providing access to
XML, relational and application data.
Entity Framework is an Object-Relational Mapping (ORM) oriented towards
business application that are written to be connected to a relational
database. The scope is to aid programmer to easy integrate database with a
object-oriented application.
Without this tool often programmer have to use two or more languages in
their application, an high-level language for the business logic such as Visual
Basic or C# code (as in Mdf case), than an another lower level language
have to be used to manage the database such as Transact-SQL. In this way a
programmer that wants develop a business program must know more than
one language and how to use them together. In many case, in fact, the low
level language should be used by the high-level one, for example: often
query could be written as string in the high level language. This can be cause
of several errors because the high level compiler dont know nothing about
that query and then it is not able to determinate if there is syntax errors or if
it contain wrong tables or attributes.
This and other problems may be avoided by using Entity Framework for
accessing data.
The Entity Framework enables developers to work with data in the form of
domain-specific objects and properties, without having to think about the
underlying database tables and columns where this data is stored.
The Entity Framework architecture is shown in Figure 9-1.
LINQ to Entities
Object Service
Entity Client Data Providre
Entity Data Model
Mapping
Database
54
9.1
LINQ to Entities
9.2
The first layer contain the database description whit all tables, fields,
relations, primary key and all needed to describe the database structure.
The second layer specifies the domain classes structure: fields, data type,
navigation properties, etc.
The third file contain the mapping information between classes schema and
database tables. This layer is probably the most complex especially when
there is no 1:1 mapping between class and table.
Entity Framework also contain a visual designer added to Visual Studio that
take care of all necessity so programmers have only to visually design
classes. It generates all code needed and the mapping file with EDMX
extension.
9.3
Object Service
This component have a lot of duties in fact it is the most used by developer.
Its first task is to provide access to the ObjectQuery<T> class that is the
starting point to execute any query. Once a query is carried out the Object
Service transform data from table form, from the underlying layers, to class.
Another important Object Service function is to trace the object state in order
55
to remember which of them are been modified, inserted or eliminated so it is
possible to save this changes on database only on user request.
9.4
Entity Client Data Provider takes care of directly interaction with database. In
this layer the expression trees obtained by the LINQ to Entities query are
interpreted in order to generate the query directed toward database. It also
manage the connection, command and reader life cycle.
9.5
This chapter will show some query examples in order to clear how Entity
Framework could be used.
The following query extract 20 products order by price.
using (Entities ctx = new Entities()) {
var c = (from cu in ctx.Products
orderby cu.Price
select cu).Take(20); }
The same query in SQL need a join between two tables, in LINQ to Entities
we need only a navigation property.
56
57
10 WORKFLOW FOUNDATION
A workflow is a logical step by step representation of a real process.
It is a very simple method to describe problems, solutions or business rules,
especially for who isnt involved in programming and has only a grossly idea
of the problem. This may be the case of a company that want buy an IT
solution for warehouse management, probably they will describe their
business rules as a workflow.
An example of workflow organization may be an e-commerce site navigation
schema, we may have to follow some step as such: products consulting,
choose, order data inserting, payment and shipping. This steps are simples to
follow by a customer and, also, it is simples to hierarchically programming
them. So Windows Workflow Foundation provide a tool for both developers
and end-users.
A MES solution based on Mdf may use Workflow Foundation (WF) to develop
all business rules that follow a workflow model, and they could be based on
the business rules defined in the Mdf Business Entities project.
WF is been written in .NET language and it is based on an engine able to
manage one or more workflows for long periods. This engine is named
Runtime Engine and manage the workflow life cycle providing several
services that are:
58
WF provide two kind of flow: sequential or state machine.
10.1
Sequential Workflow
59
10.2
60
Figure 10-3 contain the definition of the run event in the Waiting state.
This event receive input from a web service, then it start a code activity
named runOrder with the following code:
public sealed partial class StateMachine : StateMachineWorkflowActivity
{
public StateMachine()
{
InitializeComponent();
}
private void runOrder_ExecuteCode(object sender, EventArgs e)
{
Mdf.BusinessEntities.Order.InboundOrder.Run();
}
}
Each state may be processed several time before the final state of the
workflow is activated.
61
P ART 2
62
63
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
In Windows Start menu chose Programs and then youll find Mdf MES
Development Framework, in this folder there is the Mdf Portal setup file,
execute it. The installer will ask the web location, the default settings are
Site: default Web Site, and Virtual directory: Mdf.Portal.
11.1
64
If not well configured MSDTC may cause some problems, in that case see the
following tips:
First verify the "Distribute Transaction Coordinator" Service is running on
both database server computer and client computers:
1. Go to "Administrative Tools > Services"
2. Turn on the "Distribute Transaction Coordinator" Service if it is not
running
If it is running and client application is not on the same computer as the
database server, on the computer running database server:
1. Go to "Administrative Tools > Component Services"
2. On the left navigation tree, go to "Component Services > Computers
> My Computer" (you may need to double click and wait as some
nodes need time to expand)
3. Right click on "My Computer", select "Properties"
65
6. Make sure you check "Network DTC Access", "Allow Remote Client",
"Allow Inbound/Outbound", "Enable TIP" (Some option may not be
necessary, have a try to get your configuration)
66
On your client computer use the same above procedure to open the "Security
Configuration" setting, make sure you check "Network DTC Access", "Allow
Inbound/Outbound" option, restart service and computer if necessary.
On you SQL server service manager, click "Service" dropdown, select
"Distribute Transaction Coordinator", it should be also running on your server
computer.
11.2
Mdf configuration
Now you can create a Mdf database using the console application. You have
to specify the information shown in Figure 11-2.
11.3
67
you may insert the connection string data, the same that you define creating
an Mdf database.
Once the connection data are written in the fields click on the Set
connection string link, in this way start a connection test to the database
that determinate if there are any mistake. If there are no errors the
connection string is saved.
This connection tool works only if the ASN.NET user or the NETWORK Service
user, depending on your operative system, must be allowed to access to the
Web.config configuration file (you can find it at this path:
C:\Inetpub\wwwroot\Mdf.Portal, if you have chose the default web location).
The Figure 11-3 illustrates the Mdf Portal configuration page, the
configuration link on top right is highlighted with a red circle.
11.4
In the configuration page you may also define some constants and
parameters that could be useful for your MES solution. For both of them you
68
have to chose a constant/parameter name, a description, the data type, the
unit of measure and a value.
11.5
Sequences
Mdf provide you with a very useful tool that manage sequential strings. This
strings may be functional in any case you need to set a primary key for a
table. For example you may develop a MES solution which contain a section
dedicated to raw materials. In this section a user can insert a new raw
material, this means that he need to set a new material ID. The best way to
maintain the data integrity is do not allow the users to chose the ID but set
automatically a new ID on every add operation. In this context a sequential
string generator can be very helpful.
You can set a new sequences in the configuration page at the sequences
section. A Sequence is characterize by a name (that is also the ID of your
sequence), and a description than you have set a minimum value, a
maximum value, a sequence prefix and suffix and a current value. In this
way you may create a sequence that generates a string like that:
RawM.010567.Extra or more complicate because you can use more than one
sequence to construct an ID.
You can also define a sequence directly in your program using few command.
When you need to set an new ID you have only to create a sequence if it
does not already exist and get the next value available in it.
if (!Mdf.Common.Sequence.Exists("SemiFinished"))
{
Mdf.Common.Sequence.Add(
"SemiFinished",
"Semi finished sequence",
20000,
20000,
99999,
"SF.",
"",
DateTime.Now,
"system");
}
string semiFinishedID = Mdf.Common.Sequence.
GetNextValue("SemiFinished");
69
12.1
Mdf models
The ISA 95 resource models are often not enough for describe all business
elements of a real enterprise. For this reason Mdf introduce three more
models: Handling Unit, Order and Project Entities.
70
71
model, the requested tables are added to database and it provide you with a
class file with a batch of general methods. In this way you can make more
order in both database and business entities project.
The Project Entities model is far more easy than the others model in this
book because it is composed only by a Project Entity Class table and its relate
property, as shown in Figure 12-3.
12.2
In this chapter it is shown how to define the resource models by using Mdf
Portal. A right resource models definition is one of the most important step to
develop a MES application using Mdf. Mdf is based on the resource models
from which it constructs the database custom tables and the Business
Entities Visual Studio project using the Custom Class Generator.
To which end you may suppose to develop a MES application to manage a
productive process for flexible packaging composed by several process
segments such as: extrusion, assembly, film printing, coupling, cutting, and
welding processes.
The basic elements needed to describe a productive process are primarily the
equipments which are involved in it, so you have to define firstly the
equipment classes. After you have to define the material used in these
process segment, and then the other resource models: handling unit types,
personnel, order and all project entities that your productive process need.
To do this you have to access to Mdf Portal and enter in the resource section,
than on the tab menu you may chose between all resource model defined in
Mdf. The first is the equipment model. If you select it you may chose to work
with three tables: equipment, equipment class, and equipment class
properties. Selecting the second option you can manage the equipment
classes. This procedure is the same for all resource models.
Generally in this page is listed all defined class (an example is shown in
Figure 12-5). You can manage a class clicking on it, in this way it will be
open a detail page that contain all information about the class with a list of
all properties added to it (see the Figure 12-4).
72
73
location, you have to create a new custom class, for example MySite, in
which you can add your property.
74
field required are: property Id, description, unit of measures, data type, and
the data size in bit (you must set it only if you chose string as data type, else
it is auto fit to standard dimension).
In this example, you may insert: diameter, length, serial number, note, etc.
12.2.2.1
In the order model beside the orders there is the order items (see paragraph
12.1.2) so when you define a property you have to define if it is an order or
an order item property. This decision can be taken setting two check boxes
as shown in Figure 12-8
75
12.2.3.1
How to add class properties to a material
class
The material model is composed by a material class table and three other
tables: material definition, lot, and sublot. In this case, when you add a
property to a material class you must specify which tables inherits this
property. This decision can be taken setting three check boxes at the base of
the pup up panel that came out when you click the Add property hyperlink in
a material class detail page (see the Figure 12-10). The check boxes have to
be set before clicking in the property you want add.
76
12.3
You may use Mdf Portal also to instantiate a custom class. This function may
be useful if you need to populate the database in order to test your MES
application or because you want insert some standard object such as an
enterprise equipment, that in your application probably you define only one
time.
The object that you can insert are equipment, material definition, lot and
sublot, person, order and order item (about the order class see the
paragraph 12.1.2).
To add a new object you must select the model which you are interested,
than in the default page that will be open you must chose one of the links
that we listed in the paragraph above. For example if you chose the
equipment model from the tab menu, in the resource section, you may chose
among three links: equipment, equipment class and equipment class
property. The first link show you a list of all equipment that are already
inserted and with the add-new-equipment link you can access to a detail
page (similar to the detail-class page) in which you can add a new equipment
specifying to which class it belong, beside an ID and a description (and, only
in the equipment case, an equipment parent ID too, to specify an hierarchical
relation between the equipment in according with the hierarchy model). In
this modality you cannot insert the value for each property that you have add
to the class to instantiate, and they are fixed to a null value. To specify
another value you must access to your element in update modality. For this
purpose you must click on a element already inserted then you access to its
detail page in update modality.
In Figure 12-11 you can see the equipment detail page after a modify
operation in which the property fields are been inserted.
77
12.4
After you have defined all resource classes need to describe your production
process, you must define the relation between this resources. This
relationships are represented as process segments.
Whit a process segment you identify all resource involved in a particular part
of the production process (see paragraph 5.5). In the flexible packaging
example we have already say that is possible identify several process
segments such as: Extruding, Assembling, Printing, Coupling, Cutting and
Welding.
The process segment management page can be found in the Combined
resource page clicking on the first tab of the tabs menu.
78
fields it is possible to define the number of years, months, days, hours,
minutes, and seconds of the process use time. The published data is the data
on which the process segment was generate. The parent process segment
allow you to create the process segment in hierarchy way. Extended and Any
are two Xml fields that allow you to insert some other information not
contained among the standard fields but that you retain important, for
example you may insert a Note field.
79
The Printing process segment for example need at least a printer, an ink
roller and a clich as equipments, the raw film and the colours as materials,
and an operator as personnel. You may also suppose to establish that the
cutting process must be executed only after the printing process, in that case
you must define a dependency.
The Figure 12-14 shown the detail page of the printing process segment, in
the selected tab at the bottom of the page you can see that a process
segment dependency is been defined for this process segment.
In each tabs is possible to insert one or more elements. Clicking on the Add
new... link each time an adding page will require to insert the data for the
new element in according with the fields specified in the ISA 95 part 2 and
with the B2MMl standard.
Clicking on an element that is already inserted you will see a detail page in
which you can modify or delete this element or add a property to it related
specifically to this process segment.
80
13.1
If you try to define a new production rule using Mdf Portal in the Production
Process Product section you can notify that the first field required is a
Product ID that you have to chose among the material definition elements.
This happen because a production rule have to describe how a finished or
semi-finished material is made.
In a MES solution the better way is probably impose that when an user want
add a new product (produced in his plant) he has to specify also how this
product is made without a separate page for production rule. In this way the
81
user does not know that there is a dedicated model for the production rules,
he only view a page that require additional information in comparison to a
consumed material such as a raw material.
To make possible this distinction between product and the other materials
you need to create one or more separate material classes for your product,
for example you may define a SemiFinished material class or a FinishGood
material class that will have a different behaviour compare to the other
material classes such as a RawMaterial class.
In the following we will develop a SemiFinished material class as example to
explain the production rule model.
13.2
Now that you have create a SemiFinished class, when you start the CCG you
obtain a SemiFinished table and a class with some methods that allow you to
access to the data on this table. For example you can use the add, modify,
delete and get methods. This ones are not enough for define a production
rule associated to this product, as already seen you have to manage several
tables and not just the SemiFinished one. So you have only one part of the
structure that you need to create to manage the product definition.
The other part is however provide from the Mdf library. It is the
ProductDefinitionInformation class library that provide you with all standard
method to manage the product definition model whose tables are already
been created when you have defined a new Mdf database.
Now you have all tables, classes, and methods needed to manage separately
the product definition information model and your semifinished custom class.
The next step is the creation of an unique class that have to manage the two
models together.
In our example we define the SemiFinishedProductioRule class.
82
In order to better understand how this class manage the two others we may
take a look at the at its definition. This section is composed of two steps,
firstly you have to declare two private variables as SemiFinished class and
ProductProductionRule class, then you initialize them with data loads from
the two classes where the ID are specify as parameters of the new class.
public partial class SemiFinishedProductionRule
{
protected SemiFinished SemiFinished = null;
protected Mdf.ProductDefinitionInformation.ProductProductionRule
ProductProductionRule = null;
public SemiFinishedProductionRule(string semiFinishedID,
string version)
{
SemiFinished = SemiFinished.Load(semiFinishedID);
ProductProductionRule = ProductDefinitionInformation.
ProductProductionRule.Load(semiFinishedID, version);
}
}
83
are interested. For the first model we dont create explicitly the context
because it is automatically create from the add semifinished method. At the
second model, instead we need to access with more than one method, then
it is better create the context only one time and pass it to each of them.
In the transaction scope section you can now invoke all needed add methods
in particular, for this example, an add semi-finished for the custom material
model and for the product definition information model an add production
rule and an add product segment.
The product segment that you have now created have to correspond to a
process segment so if you set as product segment the printing process
segment you have to maps all resource segment specification tables and
parameters of this process segment in the new product segment
specifications tables. For this purpose Mdf provide you with specific product
segment methods named CopyFrom... that allow you to copy only a
particular table from the process segment, such as the equipment segment
specification table, or all tables of the process segment selected.
We chose to write this add as function that return a SemiFinished object.
public static SemiFinished Add(string semiFinishedID,
string description, string version)
{
SemiFinished semiFinished = null;
ProductDefinitionInformationEntities
productDefinitionInformationEntities =
ProductDefinitionInformationEntities.
CreateProductDefinitionInformationEntities();
using (TransactionScope transactionScope = new TransactionScope())
{
semiFinished = SemiFinished.Add(semiFinishedID, description);
ProductProductionRule.Add(productDefinitionInformationEntities,
semiFinishedID, version, description, null, DateTime.Now,
"<Extended />", "<Any />");
ProductSegment productSegment = ProductSegment.Add(
productDefinitionInformationEntities,
"Printing", semiFinishedID, version, description, null,
"Printing", null, null, null, null, null);
// productSegment.CopyFromEquipmentSegmentSpecification();
// productSegment.CopyFromMaterialSegmentSpecification();
// productSegment.CopyFromPersonnelSegmentSpecification();
// productSegment.CopyFromProcessSegmentParameter();
productSegment.CopyFromProcessSegment();
transactionScope.Complete();
}
return semiFinished;
}
84
13.3
The presentation layer for a production rule may be made, for example, as a
web application. Anyway the user should consider the products as materials.
So he should found, among the other material classes, a page that list all
product of a same class, such as semi-finished. By clicking on one of them he
should be found a detail page composed by an header part which contain all
generic information and a second part that contain all information about
product segment, resource specifications, and parameters.
13.4
Conclusions
Create a custom class that manage the new custom material and the
product production rule models
Create all methods in order to manage the data in the two models
85
86
production schedule contain only one production request. For example each
production schedule is related to a product that may be independent from
the others or not, so you could have stand-alone product segment or
dependent on each other.
The following paragraphs illustrate an example of a beverage production
process in which we want produce 1000 bottles of 0.75 litres each of a liquor
produced in the same plant. We suppose that we have a production rule
available for the 0.75 l bottle that, among the others material consumed
requirement, contains a semi-finished material (which represent the liquor to
bottle in) with quantity 0.75 litres. In this case, to complete the bottle
production, we need before to complete another production schedule of 750
litres of the liquor required.
As we have often clarify, there are several way to manage this production
schedule, we chose to assign to each process segment only one production
request. The methods to develop are construct in respect of this chose.
14.1
The first part takes care of the adding of the tables related to the
production schedule model concerning your product. In our example
these tables are related to the production scheduling of 1000 bottles
of 0.75 litres each
The second part deal with all other production schedule needed to
complete the first production order. In our example we have to
produce 750 litres of a particular liquor that will fill the bottles (semifinished product).
To solve these problems it possible to use two (or more if necessary) classes.
One of them contain methods that manage the adding of the finished
product and all semi-finished products needed (in our example
FinishedProductioSchedule). The second class contain all methods needed to
manage the production schedule of a semi-finished product (that is not
require by a finished product) and have to contain also some methods that
can be used from the first class (in our example we call it
SemiFinishedProductioSchedule). Others classes may defined in order to
contain some others methods needed to solve the problem.
87
Then the solution is to realize a class to manage the finished product and if
necessary takes care to call methods of an another class.
Since this method have to update the storage layer we use a transaction
scope to be sure that the modifies are all correct and only in this case they
are commit all together.
If you see the code written below, in the first part you will find that we have
used the B2MML class. We do that because we need to define a location
object that is an XML element and have to be construct in respect of the
B2MML standard. This means than in an appropriate XML structure we have
to insert the equipment that we use as location and the equipment element
level.
Now we have all needed data to add a new production schedule for a
finished product. Mdf provide us with two add methods, one of these is for
the production schedule table in with we have to insert this information:
Production schedule ID
Description
Location as XML
Schedule state that can assume the value: running, waiting, closed
and aborted.
The second method realize the production request add. The parameters
require are:
Production request ID
Description
Location as XML
88
Firstly the procedure have to know how many products are produced
using a particular production rule as production request. In our
example we specify the production rule to produce 10 bottles, 5 for
each segment.
89
Our example continue supposing that now we have to create another number
of production schedules to produce a semi-finished product.
With some simple code lines its possible to get the semi-finished ID, the
quantity to produce, and the production rule version to use. Than we
suppose that the equipment used for this process segment have a maximum
value over which another production schedule have to be defined. So in a
loop we determine the quantity of product to produce and invoke the two
add methods described above.
Some of the command used in the example below are define on other class
but is not useful to show their definition.
private static void add(string productionScheduleID, string finishedID,
string productVersion, decimal finishedQuantity,
DateTime scheduledDate, string priorityID)
{
using (TransactionScope transactionScope = new TransactionScope())
{
// Load finished production rule
FinishedProductionRule finishedProductionRule =
new FinishedProductionRule(finishedID, productVersion);
// Set locations
B2MML.Common.Location productionLocation = new Mdf.B2MML.
Common.Location(
"MyEnterprice.MyProductionSite.MyProductionArea","Area");
B2MML.Common.Location preparationLocation = new Mdf.B2MML.
Common.Location(
"MyEnterprice.MyProductionSite.MyPreparationArea","Area");
// Add production schedule and production request
Mdf.ProductionSchedule.ProductionSchedule.Add(
productionScheduleID, finishedProductionRule.Description,
productionLocation.ToString(), DateTime.Now,scheduledDate,
null, "Area", "Waiting", null, null);
Mdf.ProductionSchedule.ProductionRequest.Add(
productionScheduleID,productionScheduleID, finishedID,
productVersion, finishedProductionRule.Description,
productionLocation.ToString(), scheduledDate, null,
priorityID, "Waiting", null, null, finishedQuantity);
// Get semi finished ID
string semiFinishedID = finishedProductionRule.SemiFinishedID;
// Get semi finished quantity
decimal semiFinishedQuantity = finishedQuantity *
finishedProductionRule.SemiFinishedQuantity;
// Define and set local variables
string semiFinishedVersion = SemiFinishedProductionRule.
GetActiveVersion(semiFinishedID);
SemiFinishedProductionRule semiFinishedProductionRule =
new SemiFinishedProductionRule(semiFinishedID,
semiFinishedVersion);
// Loop on semiFinishedQuantity
90
while (semiFinishedQuantity > 0)
{
// Get production schedule ID
string semiFinishedProductionScheduleID = Mdf.Common.
Sequence.GetNextValue("ProductionSchedule");
// Set semi finished production request quantity
decimal quantity = 0;
if (semiFinishedQuantity < PcmsMixerTank.MixerSize)
{
quantity = semiFinishedQuantity;
}
else
{
quantity = PcmsMixerTank.MixerSize;
}
// Add production schedule and request
Mdf.ProductionSchedule.ProductionSchedule.Add(
semiFinishedProductionScheduleID,
semiFinishedProductionRule.Description,
preparationLocation.ToString(), DateTime.Now,
scheduledDate, null, "Area", "Waiting", null, null);
Mdf.ProductionSchedule.ProductionRequest.Add(
semiFinishedProductionScheduleID,
semiFinishedProductionScheduleID, semiFinishedID,
semiFinishedVersion, semiFinishedProductionRule.
Description, preparationLocation.ToString(),
scheduledDate, null, priorityID, "Waiting", null, null,
quantity);
// Update semi finished quantity
semiFinishedQuantity -= quantity;
}
transactionScope.Complete();
}
}
14.2
In our particular case the delete method have to consider that when you
erase a production schedule you have also delete the other production
schedule that is referred to it.
In our example we have created a list which contain all production requests
linked to the parent production schedule that we want to cancel. With a loop
on this list we delete all its elements. Then we can delete also the parent
production schedule.
The delete methods that we have used are provide by the Mdf library for the
production schedule class that maps the production schedule model.
All this methods that change the storage layer are invoked in a transaction
scope that make sure that all database updates have a successful conclusion,
if this is not happened al database modifies are roll back.
91
public static void Delete(string productionScheduleID)
{
using (TransactionScope transactionScope = new TransactionScope())
{
// Get all preparation production request that
// are invelved in current production request
List<ProductionRequest> productionRequests =
SemiFinishedProductionSchedule.
GetLinkedPreparationRequests(productionScheduleID);
foreach (ProductionRequest productionRequest
in productionRequests)
{
Mdf.ProductionSchedule.ProductionSchedule.
Delete(productionRequest.ProductionScheduleID);
}
Mdf.ProductionSchedule.ProductionSchedule.
Delete(productionScheduleID);
transactionScope.Complete();
}
}
14.3
There are several way to develop this method, for example you can realize it
similar to the add method. For the sake of simplicity we have construct it
assembling a delete and an add methods.
This is a very simple method, firstly is call a delete method with the
production schedule ID to modify, then an add method is invoked with the
same ID that we have deleted and the new parameters that we want to
modify.
public static void Modify(string productionScheduleID,
string finishedID, string version, decimal quantity,
DateTime scheduledDate, string priorityID)
{
using (TransactionScope transactionScope = new TransactionScope())
{
Delete(productionScheduleID);
add(productionScheduleID, finishedID, version, quantity,
scheduledDate, priorityID);
transactionScope.Complete();
}
}
92
15.1
Production performance
The production performance model with the production schedule model form
the production information. Using the production scheduling model its
possible to organize the production orders that may be interpreted as
requests for production. The production performance model allow to respond
to this requests.
When a production order has been scheduled all resources required are been
specified, but at that moment it is not required to specify which particular
material lot or equipment have to be used in production. For example, if you
want produce bottles of liquor you have to specify in your production
schedule, among the others material consumed requirement, a particular
bottle type but you not specify which lot of bottle you have to use. This in
fact is one of the information that are specify in the production performance
model.
For this reason at one production schedule corresponds one production
performance as well as to each production request correspond a production
response and to each segment requirement corresponds a segment
response.
A production schedule, and so also the production performance, may be
detailed for a particular time slice or for a particular production campaign, or
for others logical groupings. For the sake of simplicity in our example we
have linked one production schedule with only one production request, so the
same is being done for the production performance.
93
A production performance may collect data with several logical organizations
in dependency of your business rules. For example it possible to decide that
a production response have to be created when a production order, that is
scheduled by a particular production request, start. At the same moment a
business rule may require to specify which particular equipments (for
example a mixer) have to be used for this product production.
A code example of a method that implement this case is shown below in the
paragraph 15.4.
If you compare the production schedule model with the production
performance model you can calculate the order execution efficiency for
example comparing the end time scheduled with the effective end time, or if
the product quantity scheduled is more or less than the actual quantity
produced.
15.2
Production capability
94
Figure 15-1 illustrates a capability calendar that contain all scheduled event
that can modify the production capability.
15.3
95
used such as for lack of production orders (some resource that were
available may rest unused), or an equipment was not available due to
unplanned maintenance (cleaning) or machinery break down. You may also
decide to not more use a resource due to not reduce the product produced
quality, for example an equipment may require a pause to chill in order to
restore the nominal conditions.
This model provide another important information: the maximum available
production capability, it is the capability that was available for use in
production. It may be calculated from the best capacity utilization achieved
over some recent period of time.
The production capability utilization model may be update both at real time
during production (by using a automatic control system) or in a second time
as revision or at occurring of particular events in according to a business rule.
Current Capacity
Utilization
Capability
Utilization
Unused:
Planned maintenance
New
resource available
and not used
Equipment
efficiency
degradation
Unacceptable quality.
Clean maintenance
required
Mintenance
terminated
Unused Capacity
Unused:
Equipment Down
Unused: Cleaning
Equipment became
unused because failure
Utilized Capacity
Time
96
The Figure 15-2 illustrates an example of capability utilization that collect
various historical information about the use of resources. Following the arrow
of time the events show in this figure are:
A new resource became available. In this case the maximum
available production capability utilization is increased.
15.4
In the previous paragraphs you have seen which are the model that take
care of collecting the production data. Now is show some code examples to
explore case where the production performance and the production capability
utilization models have to be populated.
97
98
99
100
materialLot.Save();
//Close equipment capability utilization;
var query =
from EquipmentCapabilityUtilization
equipmentCapabilityUtilization in
EquipmentCapabilityUtilization.
GetEquipmentCapabilityUtilizations()
where equipmentCapabilityUtilization.
ProductionCapabilityUtilization.
ProductionCapabilityUtilizationID == productionScheduleID
&& equipmentCapabilityUtilization.EndTime == null
select equipmentCapabilityUtilization;
MachineryDowntimeCausal machineryDowntimeCausal =
MachineryDowntimeCausal.Load(causalID);
foreach (EquipmentCapabilityUtilization raw in query)
{
raw.EndTime = DateTime.Now;
raw.Save();
string equipmentCapabilityUtilizationID =Sequence.GetNextValue(
"EquipmentCapabilityUtilization");
EquipmentCapabilityUtilization.Add(
equipmentCapabilityUtilizationID, productionScheduleID,
raw.EquipmentClassID, raw.EquipmentID, "Down",
machineryDowntimeCausal.Description, raw.Location,
DateTime.Now, null, raw.Quantity, "<Extended><CausalID>" +
machineryDowntimeCausal.CausalID +"</CausalID></Extended>",
null);
}
transactionScope.Complete();
}
}
101
102
103
P ART 3
104
16 REPORTING
This chapter explain how to create reports for production that are the one of
the end purpose of every MES solution.
With a report your MES solution may provide several king of data from the
more easy materials orders or customers master data to more complex
reports such as for product traceability or OEE.
There are several instruments that deal with reports. The tool that we will
use to explain how to create and manage reports are Microsoft SQL
Reporting Services and the Visual Studio Report Viewer tool to integrate
reports in a web application.
When you install SQL Server you may chose to install also the Reporting
Services tool that provide your machine with a report server a some Visual
Studio tool that allow you to create and manage report as a Visual Studio
project. More information about Reporting Services may be find at the
Microsoft Msdn SQL Server Reporting Services 1 web page.
A report is based on a select command on your database that may by filtered
by defining some parameters. For example you may list all material in a
warehouse and let users able to filter it by warehouse location or by a
particular material property.
16.1
To construct a report project in Visual Studio you may use the report server
project provided by SQL Reporting Services. The environment that this tool
provides allow user to easy create both logic and graphic part that compose
a report.
The logic part is composed by the query that extracts the data from
database and the parameters required to implement filters.
The graphic part concerning the organization of data views and all
component that a report document have to contain.
http://msdn.microsoft.com/en-us/library/ms159106.aspx
105
0..n
Segment Requirement
0..n
0..n
0..n
Production Parameter
Corresponds to element in
Equipment Requirement
1..1
Equipment Model
Corresponds to element in
Material Model
Corresponds to element in
0..n
0..n
Consumable Expected
Corresponds to element in
Personnel Requirement
1..1
Personnel Model
Left click on the reports table and then click on the Add New Report
link. Then a wizard form is shown that help you with the creation
procedure.
Firstly you have to set a data source that contain the data to expose.
So you have to indicate the database name, its type, and the
106
connection string. You may also chose to make this as a shared data
source, in this way you may use the same data source for various
reports.
Then you have to indicate the query or stored procedure you have to
use. It is possible to use a query builder to project them.
Go with next, you may chose if display the data as matrix or tabular.
And then how to group the data in the table/matrix. In our example
(Figure 16-3) we have inserted the SegmentRequirementID as page
field in order to obtain one page for each segment requirement, then
the fields related to the consumed material are inserted as detail
fields.
Next step complete the wizard allow you to chose if view a preview
of your report or not.
You may now complete your report adding all fields that you have
not chose in the wizard procedure, and defining parameters that
allow you to create filters. To create a new parameter you have to
access to the dataset property, then in the parameter section you
can add your parameter. Now, you may modify your query to be
filtered by this parameters. When you execute your report all
parameters defined will be required in a proper parameter section.
The figure below illustrates a simple report example. In the header part
there is an area in which you may insert the product ID to search. Below this
area there are the commands to change page and print the report.
Product Produced ID
PCMS
SR.0000063 White Sambuca
Material Produced
SF.020104
Quantity
1229,00 l
01.00
Requirement ID
Material description
Quantity
MSS.0100188
Sugar
245,80 kg
PreparationAlcohol
Alcohol
382,87 l
PreparationWater
Water
932,16 l
16/10/2009
Page 1 of 4
107
In this page there is another report example for the segment response
model. The Figure 16-4 illustrates the entity-relation model, the Figure 16-5
show the related ISA - 95 model and the Figure 16-6 is the report.
Production Line
PCMS
SR.0000110 White Sambuca 0,75l
Material Produced
FM.030105
Lot ID
L92932
01.00
Quantity
1000 BT
Equipment Used ID
Description
Status
Running
Preparation.Tank2
Tank 2
Start time
20/10/2009 14.44.40
Production.Line1
Automatic Line
Material Consumed ID
Quantity
BT SAM 075
L3324
Sambuca Bottle 75 cl
1000 BT
SF.020104
S92932
White Sambuca
16/10/2009
750 l
Page 1 of 4
108
16.2
Once your reports is created you may use it in several way. The first step is
to distribute your reports that is upload the .rdl report file on your report
server.
This operation can be done in two way: you can distribute your report using
the distribution command, you can find it in the context menu of the report
project in the solution explorer window. As an alternative you may load the
report file directly by the reporting servers web service using the upload
file link.
Another important options to set are the access credential, you may specify
them using the Windows identity impersonate method and set the user name
and password of the report server execution account.
http://msdn.microsoft.com/en-us/library/ms251671.aspx
109
P ART 4
110
111
The ability to trace (identify and measure) all the stages that lead to
a particular point in a process that consist of a chain of interrelate
events. (Wiktionary 1 . 26/10/2009)
The product traceability is one of the most important information that an
industry have to provide according to the law. Several country fix some rules
due to make the production process traceable. This is particularly true for
food and beverage processing.
The traceability information may be related to:
Forward traceability. It is the collection of all finished or semifinished product lots in which a particular resource has been used.
In both cases a traceability report may also include the specification of the
inbound orders related to the resource(s) and/or the outbound order related
to the product(s) to trace.
The following chapters show two traceability reports respectively for forward
and backward traceability of a beverage product.
17.1
Forward traceability
http://en.wiktionary.org/wiki/traceability
112
PCMS
Forward Traceability
Material ID
Sugar
Description
Sugar sacks
Lot
L27403
Lot status
Available
Quantity
800 KG
Receipt
23/10/2009
Valid till
01/11/2011
Inbound Order
Order ID
Supplier ID
Corporate name
Bill
Schedule
Receipt
IO.100020
451.11
Sugar SRL
B83452
23/10/2009
23/10/2009
Description
Lot
SF.020104
White Sambuca
S92945
Quantity
1.000 LT
Description
Lot
FM.030105
L92962
26/10/2009
Quantity
1 LT
Page 1 of 32
113
A PPENDIX
114
A. BIBLIOGRAPHY
ISA - The Instrumentation, Systems, and Automation Society
115
B. WEB SITE
EMPYSTUDIOHTTP://WWW.EMPYSTUDIO.COM/MDF/DOWNLOADS.ASPX .......................... 7
MICROSOFTDEVELOPERNETWORK(MSDN).NETFRAMEWORKDEVELOPERCENTER
HTTP://MSDN.MICROSOFT.COM/ENUS/NETFRAMEWORK/DEFAULT.ASPX ........................ 30
MICROSOFTDEVELOPERNETWORK(MSDN)SQLSERVERDEVELOPERCENTER
HTTP://MSDN.MICROSOFT.COM/ENUS/SQLSERVER/DEFAULT.ASPX ................................ 31
MICROSOFTDOWNLOADCENTER
HTTP://WWW.MICROSOFT.COM/DOWNLOADS/DETAILS.ASPX?FAMILYID=333325FDAE52
4E35B531508D977D32A6&DISPLAYLANG=EN ...................................................... 7
WBFB2MMLHTTPS://WWW.WBF.ORG/CATALOG/B2MML.PHP ................................ 26
WORLDBATCHFORUM(WBF)HTTPS://WWW.WBF.ORG/CATALOG/............................... 26