Sunteți pe pagina 1din 12

System 800xA Training

Chapter 14 1
Chapter 14 MMS Communication

TABLE OF CONTENTS

Chapter 14 MMS Communication.......................................................................................................................................... 1
14.1 General Information ................................................................................................................................................... 2
14.1.1 Objectives............................................................................................................................................................ 2
14.1.2 Legend................................................................................................................................................................. 2
14.1.3 Reference Documentation .................................................................................................................................... 2
14.2 MMS Communication between Applications .............................................................................................................. 3
14.2.1 General ................................................................................................................................................................ 3
14.2.2 MMS Communication Principle........................................................................................................................... 3
14.2.3 Access Variables.................................................................................................................................................. 4
14.2.4 MMS Variable Naming Rules .............................................................................................................................. 5
14.2.5 Variable Attributes............................................................................................................................................... 5
14.2.6 Reading Data from an Access Variable................................................................................................................. 6
14.2.7 Signal Tracing...................................................................................................................................................... 7
14.2.8 Other Function Blocks in the MMS CommLib...................................................................................................... 9
14.3 Troubleshooting ........................................................................................................................................................10
14.3.1 Introduction ........................................................................................................................................................10
14.3.2 Status Parameter .................................................................................................................................................10
14.3.3 Remote System Information................................................................................................................................12
14.3.4 Hardware LED indicators....................................................................................................................................12

T308-14 MMS Communication - RevC
Chapter 14 2
14.1 General Information
14.1.1 Objectives
On completion of this chapter you will be able to:
Describe the principle of MMS communication
Analyze the signal flow on access variables
Identify the communication status

14.1.2 Legend
> Indicates when you go from one menu to a sub-menu
Italic Indicates object and file names
Indicates dialog box buttons, tabs, menus etc.
Bold Indicates important topics
Indicates start/explanation of student activity


14.1.3 Reference Documentation
3BSE035983 Industrial IT 800xA - Control and I/O
Communication OPC Server for AC800M Configuration
3BSE035980 Industrial IT 800xA - Control and I/O
Basic Control Software Introduction and Configuration
3BSE035982 Industrial IT 800xA - Control and I/O
Communication Protocols and Design
System 800xA Training
Chapter 14 3
14.2 MMS Communication between Applications
14.2.1 General
MMS stands for Manufacturing Message Specification. It is the protocol used to
communicate on the control network between AC 800M applications and also to the
Connectivity Server for the 800xA System.
MMS supports transfer of simple and structured variables, program download and
alarm handling. MMS is also used to define and make data available as access
variables.
Generally the MMS communication between AC 800M controllers should be limited
if possible because it will use the controllers CPU capacity.

14.2.2 MMS Communication Principle
MMS communication handles communication between applications within one
AC 800M controller and between applications allocated to two controllers.
The applications may exist in the same controller:
Controller
Application 1 Application 2


Or in different controllers on the control network:
Controller 1
Application 1
Controller 1
Application 1
Controller 2
Application 2
Controller 2
Application 2


Remember that in Control Builder Professional one application does not necessarily
correspond to one controller. It is possible to execute two applications within the same
controller. Even in this case though, we need to use MMS communication with access
variables if we want exchange data between the two applications.

NOTE! Applications should be designed so that the data passed
between them is minimized. The MMS communication
should be limited and not be used for a lot of data.
For example: dont write an application in one controller and use the I/Os of another
controller for this application.
T308-14 MMS Communication - RevC
Chapter 14 4
14.2.3 Access Variables
For communication between two applications, access variables are defined. An access
variable is a variable that is shared on the network. By sharing a local (or global)
variable as an access variable, it is accessible by any system on the network, as long
as the two systems in question share a common protocol, such as MMS, COMLI etc.
Access variables are defined in the controller hardware part of the Project Explorer.
The variable may be of any type and this means that it might be a simple variable or
else a complex (structured data type).


One or more access variables are defined in a particular controller. Such variables are
mapped into variables existing in the applications running in that controller. This
mapping is done in the Access Variable Editor.
Controller
Application
Variable
Access Variable
Path to Variable
Variable Name
is a string
Path maps a variable
in the application to
the Access Variable
Controller
Application
Variable
Access Variable
Path to Variable
Variable Name
is a string
Path maps a variable
in the application to
the Access Variable


The variable in the application which is mapped can be any variable existing
anywhere in the whole application:
Variable in a program or control module
Variable (global or local) in the application
System 800xA Training
Chapter 14 5
14.2.4 MMS Variable Naming Rules
MMS variables can only be accessed by their name which is a string. The naming
rules are defined in MMS rather than as part of Control Builder, therefore there are
some differences in these rules compared to the standard naming rules for variables in
programs etc.
An MMS access variable name can be up to 32 characters long and contain letters,
digits and the characters dollar ($) and underscore( _ ).
No spaces are permitted in the name of an MMS variable
MMS variable names are case sensitive, i.e. TANK4 is not the same variable as
tank4.
The access variable name cannot begin with a digit or the dollar ($) character.
The access variable may be mapped to any type of simple variable or (more
importantly) to any type of structured variable.
A structured variable can have mixed data type components

14.2.5 Variable Attributes
By default access variables are Read/Write. If you want to make the variable Read
Only then set the attribute in the access variable table to ReadOnly.
If the attribute field is left blank then the variable will be Read and Write.


T308-14 MMS Communication - RevC
Chapter 14 6
14.2.6 Reading Data from an Access Variable
Access variables are declared in the controller that acts as a server. The access variable
is a reference to a variable in an application.
The client application has to be configured with at least one Connect function block
and one Read or Write function block addressing the access variable.

In the above diagram an access variable has been defined and mapped to a variable in
the application called Application1.
Now the objective is to read the values stored in it from Application2. This is done
with function blocks instances placed in a program in Application2.

A minimum of two function blocks are required.
Connect function block
The purpose of this function block is to make the connection to the controller
which holds the access variable (referred to as the Remote System or Partner)
Read function block
The Read function block reads the values of the access variable in the remote
controller and transfers them into a local variable (Control Builder variable) in the
application that is reading (Application2 above)

NOTE! When using Function Designer, the access variables and
the MMS communication are generated automatically!
System 800xA Training
Chapter 14 7
14.2.7 Signal Tracing
The access variable ProductData refers to the variable gMyProduct which is in our
case a global variable.
The data type MMSData should be defined in a project library which is connected to
both applications, so that each application can declare a variable of this type. The
original variable (in Application1) must have the same structure as the final variable
(in Application2) so that the data matches component for component.
The data type is structured to contain any combination of variables of any type. The
choice of structure depends on the data to be made available.
Access Variable


If the values in the components of the variable gMyProduct change, then the values
in the components of the access variable called ProductData will also change.

T308-14 MMS Communication - RevC
Chapter 14 8
The corresponding application program reads the value on a cyclic basis.
Server Address
Variable Name
Variable Data

In online mode, the En_C must be true for communication to be enabled. The value of
the Valid output will be true if communication is working properly.

MMSConnect
The Connection_ID variable is connected between the Connect and the ReadCyc
Function Block. It passes signals which co-ordinate the activity of the two.
The MMSConnect needs to know which controller to connect to. This information is
provided by the parameter Partner, which in this example is connected to the variable
RemoteSystem. The variable is always a string data type, and it has an initial value
equal to the IP address of the controller where the access variable required has been
defined.

MMSReadCyc
The parameter VarName, which in this example is connected to a variable called
RemoteName, is a string data type with an initial value equal to the name of the access
variable defined at the remote controller.
NOTE! MMS variable names are case sensitive
The RemoteData variable is the local variable in this program into which the remote
data will be placed.
MMSReadCyc has expandable parameters, such that the number of input/output
parameters is variable and must be specified. Changing the value within the brackets
means that several Access variables can be read using only one Function Block.

System 800xA Training
Chapter 14 9
14.2.8 Other Function Blocks in the MMS CommLib
MMSRead
This module performs an event driven read of an access variable from the remote
system. This allows a programmer to trigger a read operation from code. It is
connected in a similar way to the MMSReadCyc.

MMSWrite
This module writes values into an access variable at a remote system. It is event driven
on the rising edge of the Req parameter.
Note that if the Access variable at the remote system has been given the attribute
ReadOnly, this module will fail!

MMSWriteDT
This module writes a Date and Time an AccessVariable in the remote system. The
Access variable should be linked to a single Date_And_Time type variable. Note that
this block does not write to the actual system time in the remote system. If you wish to
do that, then additional code is required at the destination system.

MMSDefAccVar
This module allows the definition of an access variable from application code. In
many circumstances you wish to create access variables in a controller at run time.


SIL2 certified Function Blocks
For SIL2 certification, greater reliability is required, none of the above function block
types are suitable for SIL2 applications.
A range of SIL2 function block types are defined in the MMSCommLib which are
suitable. These are:



T308-14 MMS Communication - RevC
Chapter 14 10
14.3 Troubleshooting
14.3.1 Introduction
The most common reasons for communication to fail on an access variable exchanged
between two controllers are either network communication is bad, or the variables are
configured wrong.
For network problems, tools such as the Ping utility are used for confirming that the
two controllers can reach each other.
For configuration problems, review the material presented earlier in this lesson. One
problem that can occur is that someone can configure another access variable with a
duplicate name. This is one reason to ask whether the communication worked
previously and whether any configuration work may have been done recently.
The principle for trouble shooting MMS communication problems is first to use the
following tools to diagnose what the problems are, then to check all the MMS
communication related configurations (both hardware & software) to fix them.

14.3.2 Status Parameter
The Status parameter from both MMSConnect and MMSRead (or any other MMS-
block) can be used to get a status indication from the communication between the
controllers.
Use the on-line editor to read the status-code and then look up the meaning of this
code in the on-line help (Index > Status codes).
Communication codes starts at -400
CommunicationLib codes starts at -5300

If the Status output of MMSConnect produces a negative value, the connection
between the two controllers is not working properly. Note that the partner address
cannot be changed online.

Status code Explanation
0 (pending) Remote system can not be found
1 Connection OK
-412 Connection aborted, probably because the remote address was not
responding. Check the address.
-5326 Partner address was changed online. Go offline to change the address.
Make a new download.

System 800xA Training
Chapter 14 11
If the Status output of MMSRead/MMSWrite gives a negative value, while the
connection is OK, there is an error in the configuration of the access variable. The
table shows some common values for the Status parameter.

Status code Explanation
0 Operation is pending
1 Last operation was successful
-432, -461 Access variable cannot be found in the remote controller. Check the
spelling etc.
-5324 No connection, i.e. the Valid parameter of MMSConnect is False. Check
the Status of the MMSConnect.

The online help gives you more information about status codes. Below you will see
some more status codes from the MMS Function Blocks.



T308-14 MMS Communication - RevC
Chapter 14 12
14.3.3 Remote System Information
A connected remote control system can be inspected and maintained from Control
Builder. Access the remote system by making a right click on the controller and then
selecting Remote System in the context menu.


A new window appears where you can diagnose the communication.


Show MMS Connections: Shows a list of all systems that have active MMS sessions.
The list includes control systems and PCs running Control Builder, OPC server or Soft
Controller, connected to the same network as the requesting system. If a system does
not show up here, the MMS process is interrupted. For a control system the reason
could be a loss of hardware or an invalid IP address. Proceed by sending a PING
message to the controller to check the IP protocol.


14.3.4 Hardware LED indicators
All hardware units used for communication have LEDs that display the traffic on the
corresponding communication channel. Use them to get information if traffic is active
or not present.

S-ar putea să vă placă și