Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
MESand SQL Server Database
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
SQL Server Express
Prerequisite software :• Microsoft .NET Framework 2.0 • SQL Server Setup requires Microsoft Data Access
Components (MDAC) 2.8 SP1 or later. You candownload MDAC 2.8 SP1 from this Microsoft Web site.
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
SQL Server Express
SQL Server 2005 Express Edition – RTMIf you are installing SQL Server 2005 Express Edition, perform the
following steps in order:
• Uninstall .NET Framework 1.2 and later versions from your computer(versions 1.0 and 1.1 do not have to be uninstalled). Then, install .NET Framework 2.0. from .NET Framework 2.0 Download Center.
• Install SQL Server 2005 Express Edition from the SQL Server Express Web site.
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install .NET Framework 2.0• Start dotnetfx.exe
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install .NET Framework 2.0
Accept the licenseagreement
Press „Install“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install .NET Framework 2.0
The installation was successful, press „Finish“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express• Start SQLEXPR32.exe
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express• In case of following message, execute the windows
installer first and then restart the SQL Express installation again
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express• Windows Installer 3.1
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express
Accept the licenseagreement
Press „Next“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express
Press „Installt“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express
Press „Next“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express
Press „Next“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express
Press „Next“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express
Press „Next“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express
Press „Next“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express
Select „Mixed Mode“
The username of thedatabase is „sa“
Enter and confirm a password for user „sa“
Press „Next“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express
Press „Next“ Press „Next“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express
Press „Install“ Press „Next“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Express
Press „Finish“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Management Studio Express
Press „Next“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Management Studio Express
Press „Next“
Accept the licenseagreement
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Management Studio Express
Press „Next“ Press „Next“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Management Studio Express
Press „Next“Press „Install“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Install SQL Server Management Studio Express
Press „Finish“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Start SQL Server Management Studio Express
Double click to start SQL Management
Studio Express
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Start SQL Server Management Studio Express
Press „Connect“
This is the name of thecomputer and the name
of the standard SQL database
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Create a new database
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Create a new database1. Right mouse click on
„Databases“
2. Mouse click on „New Database“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Create a new database1. Enter a name for the
new database
2. Press „OK“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Create a new table
The new database isadded
2. Open the database treeby pressing the „+“ and
then right mouse click on „Tables“ to insert a new
table
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Create a new table
1. Enter the ColumnNames and the Data
Types
2. Press „Save“
3. Enter a name for thenew table and press
„OK“
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Open the table to see the values
1. Right mouse click
2. Click on „Open Table“
3. Refresh of the tableby clicking on „Execute
SQL“ icon
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Settings on server side (1)
1. Select the Administration with ”Start” -> ”Settings” -> ”Administration Tools”
2. Select ”Data Sources (ODBC)”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Settings on server side (2)
1. Select ”System DSN”
2. Select ”ADD”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Settings on server side (3)
1. Enter the name of the Database to be connected
2. Enter a description for the Database
3. Enter the Server Name
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Settings on server side (4)
1. Select ”With SQL...”
2. Enter the Username and the passwword fo the database server
3. Press ”Next”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Settings on server side (5)
1. Change the standard databse to your designed database
3. Press ”Next”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Settings on server side (6)
1. Press ”Finish”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Settings on server side (7)
1. Press ”Check Data Source” 2. If test was successful press ”OK”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
MES Interface Configuration Tool
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (1)
Enter a name for the new project
Then select ”System Settings”, because there isno ”OK” button to confirm!
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (2)
IP Address ”192.168.3.3”is factory setting
of the QJ71MES96 module.
System SettingsSystem Settings
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (3)
CPU on the rack , where the MES module is connected !
Access Target CPU settingsAccess Target CPU settings
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (4)
2.) Enter a namefor the device tag
3.) Enter the sampling method
Device tag settingsDevice tag settings
1.) Double click on ”Device tag settings”opens new item
The ”Component name” can be any namebut for making it easy please enter
the same like you entered already in the ”Column Name” area from your data base .
Enter the ” Component name”, ”PLC device”and ”CPU name” and then press ”ADD”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (5)
Enter alldesired devices.
Device tag settingsDevice tag settings
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (6)
Double click on ”Server Service settings”
opens new item
Server service settings: Add new itemServer service settings: Add new item
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Konfiguration im “MES Interface function configuration tool”(6b)
Used for [Program execution] in [Job settings] .Application server
Used for [Communication action] in [Job settings] .Database server
DescriptionServer
Server service settingsServer service settings
Select the type of the ODBC data source:• Oracle 8i• Oracle 9i• Oracle 10g• SQL Server 2000/2005• MSDE 2000• Access 2000• Access 2003• IndustrialSQL Server
Database type
Enter the name of the ODBC data source.Data source name
DescriptionFunction
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (7)
Server service settingsServer service settingsAny name for Database server
IP Address of Computercontaining the data base
Name of the data base
Port number like entered inDB connection service
setting tool
Type of ODBC data source
select ”Database Server”
Enter Username for Database
Enter and confirm Password for Database
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (8)
Job Settings: Write Data into database (Insert)Job Settings: Write Data into database (Insert)Enter name for the job
Select trigger type, hereonly one trigger every
10 seconds
Press ”Add”, ”Communication action” has to be selected.
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (9b)
Trigger conditionsTrigger conditions
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (9)
Job Settings: Write Data into databaseJob Settings: Write Data into database
The SQL script is created automatically!
The ”Field Name”has to be exactly
the same as in the ”access
data base table”
Name of the Access data base table
The name of the accessdata base is defined in
”Database_Server”
Leave the type as default”Insert”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (10)
Transfer Project to MES Modul: transfer setupTransfer Project to MES Modul: transfer setup
Default User Name:QJ71MES96
Default Password:MITSUBISHI
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (12)
Transfer Project to MES Modul: transferTransfer Project to MES Modul: transfer
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
MS Access: Monitor “InsertData”table data base
Refresh data base table
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Example: SQL command ”Select”Example: SQL command ”Select”
There is a table with some data and with a trigger ”M0=ON” we want to
”Select” the line where ”Number” = 1 and read the data from the other cells of
this line into the PLC!
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Open the ”Device tag settings” and extend the
tag ”Tag_1”
Job Settings: Read Data from database (Select)Job Settings: Read Data from database (Select)
Configuration in “MES Interface function configuration tool” (13)
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (14)
Job Settings: Read Data from database (Select)Job Settings: Read Data from database (Select)
The action of ”ReadFromTable”is executed, when
variable ”StartRead” gets the value ”ON”
Right mouse click on ”Job
settings”
Select ”Value monitoring
startup”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (15)
Job Settings: Read Data from database (Select)Job Settings: Read Data from database (Select)
1. Select ”Add”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (16)
Job Settings: Read Data from database (Communication Action)Job Settings: Read Data from database (Communication Action)
Select/Update condition :Setting in which line of the table
the values to be read can be found
Setting of the data to be readfrom the data base
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (17)
Job Settings: Read Data from database (Access Database)Job Settings: Read Data from database (Access Database)
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (19)
Job Settings: Update Data in databaseJob Settings: Update Data in database
Update Example : the production target of Product 4
has to be changed to a different value (i.e. 2250)
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (20)
Job Settings: Update Data in databaseJob Settings: Update Data in database
Open the ”Device tag settings” and extend the
Component list of ”Tag_1”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (21)
Job Settings: Update Data in databaseJob Settings: Update Data in database
Right mouse click on ”Job
settings”
Select ”Add item” to enter the new job ”UpdateProdTarget”
Select ”Handshake operation”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (22)
Job Settings: Handshake operationJob Settings: Handshake operation1. The job is started by
setting ”StartUpdate” 3. With the falling edge of
”Startupdate””UpdateComplete” is reset automatically
2. When the job is finished the MES
modul sends ”UpdateComplete”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (23)
Job Settings: Update Data in databaseJob Settings: Update Data in database
Press ”Add” to create a new
”Communication action”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (24)
Job Settings: Update Data in databaseJob Settings: Update Data in database
1. Select ”Update”2. Enter the table
name ”UpdateData”
3. Select the row of the table where the field ”Product” contains the same value as the device
”Tag_1.Product”4. Then write the value from ”Tag_1.Prod_Target”
into the field ”Pieces” of the table
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Configuration in “MES Interface function configuration tool” (25)
Job Settings: Update Data in databaseJob Settings: Update Data in database
1. Enter the product name ”Product 4”
2. Enter the new order size ”2250”
3. Set ”M100”
4. When ”M101” gets ON reset ”M100”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
5. MES Interface Configuration:Operation Actions
5. MES Interface Configuration:Operation Actions
– “Operation Action” is used to perform calculations, i.e. to scale values.
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Job Settings: Operation Action
1. Select ”Operation action”and press ”Add”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Job Settings: Operation Action (2)
2. Following operatorscan be selected
1. Variables can be defined, that are not counted as tag
devices
3. In the example ”OneSecondCounter” is
devided by ”10” and written into the variable
”Result”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Job Settings: Operation Action (3)
2. To change the order, select ”Operation” and
press the arrow
3. The order is now changed!
1. Because the calculated value ”Result” should be sent to the
database table, the ”Operation” action must be
befor the ”Insert”
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul
Job Settings: Operation Action (4)
2. The calculated value is displayed!
1. Enter the variable ”Result”into the ”Insert” action
Mitsubishi Electric – MES Modul and SQL Server – Octob er 2008
MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul /// MES Modul