Professional Documents
Culture Documents
15communication RevA
15communication RevA
Chapter 15 Communication
TABLE OF CONTENTS
Chapter 15 - 1
T530-15 Communication - RevG.doc
15.1.1 Objectives
On completion of this chapter you will be able to:
Describe the principle of MMS communication
Create and define access variables
Configure MMS communication between controllers
Tell the available communication protocols and libraries
Explain the principles of serial communication
15.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
Chapter 15 - 2
Compact Control Builder Training
15.2.1 General
MMS stands for Manufacturing Message Specification. It is the protocol used to
communicate on the control network between AC 800M applications.
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 controller’s CPU capacity.
Controller
Application 1 Application 2
Controller 1 Controller 2
Application 1 Application 2
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.
Chapter 15 - 3
T530-15 Communication - RevG.doc
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.
Application
Path to Variable
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
Chapter 15 - 4
Compact Control Builder Training
Chapter 15 - 5
T530-15 Communication - RevG.doc
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.
Chapter 15 - 6
Compact Control Builder Training
Such a structured data type can have many components and may be accessed in one
transaction:
For MMS there is a limit of 1 Kbyte of data per telegram. This means that several
hundred real values may be packed into a structured variable and accessed in one
‘lump’. Variables require different amounts of message space depending on the
variable type.
In the accessing system the data in the structured variable may then be extracted by
code block looking at the components of the variable.
Chapter 15 - 7
T530-15 Communication - RevG.doc
Chapter 15 - 8
Compact Control Builder Training
Chapter 15 - 9
T530-15 Communication - RevG.doc
If the values in the components of the variable App1_Data change, then the values in
the components of the access variable called Controller1_App1_Data will also
change.
Similarly if a remote system writes to the values in Controller1_App1_Data then the
components of App1_Data in the application or program will also change.
Chapter 15 - 10
Compact Control Builder Training
Note that the variables AccessVarName and PartnerAddress have been given
initial values.
Chapter 15 - 11
T530-15 Communication - RevG.doc
MMSConnect
The ConnectID variable is connected between the MMSConnect and the
MMSReadCyc function block. It passes signals which co-ordinate the activity of the
two.
The MMSConnect needs to know which controller to connect to (you need to know
someones mobile number in order to connect to them). This information is given by
the variable PartnerAddress. It 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 AccessVarName variable is a string data type with an initial value equal to the
name of the access variable Controller1_App1_Data defined at the remote controller.
NOTE! MMS variable names are case sensitive!
The App1Data variable is the local variable in this program into which the remote data
will be placed. The components of this variable get written with the data that is in the
components of App1_Data in Application1.
The MMSReadCyc block determined the poll time for the read operation it defaults to
5s but may be changed either during configuration or by the code at run time.
Communication Check
It is a good idea to check first whether the communication is okay. Check the status of
the MMSConnect block and use that as an input for the Enable parameter on the
MMSReadCyc block.
Chapter 15 - 12
Compact Control Builder Training
1. In the “Insert Function/Function Block” dialog set the size to the number you
require. Alternatively, change the number in square brackets in the function block
declaration pane.
This read cyclic block can now read three access variables from the same remote
system in one execution
NOTE! In Function Block Diagram (FBD) and Ladder Diagram
(LD), a maximum of 32 extensible parameters per
function block can be shown.
The MMSReadCyc determines the polling interval. If some variables need to be read
every 5s and a second set every 10s, then a second MMSReadCyc block can be
connected via the ConnectID variable. The first one set at 5s and the second set at 10s.
Chapter 15 - 13
T530-15 Communication - RevG.doc
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 into an access variable 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 addition 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.
Chapter 15 - 14
Compact Control Builder Training
The AC 800M controller has one single RS232 port available on the CPU itself, this is
COM3 and has an RJ45 connection point. If more RS232 ports are needed then the
Communication Interface module CI853 provides two ports per module. Several such
modules could be mounted on the CEX bus of the controller.
For other devices there may be specific Communication Interface modules provided
for installation on the CEX bus.
15.4.1 Overview
The principle of Connect and Read and Write blocks applies broadly to both access
variable and communication to other devices.
A series of communication libraries contain the function block types used to make
connections either to devices connected over a serial link using an RS232 port on the
controller or via a hardware communication interface module.
Hardware Libraries
For most communication it will be necessary to connect the appropriate hardware
libraries both to the project and then to the individual controllers. The ‘software’
library provides the function blocks and/or control modules, the Hardware Library
provides the definition for the Hardware Type of the connection device.
The communication interface CI853 requires the hardware library
CI853SerialComHwLib to be connected to the project and also to the controller
concerned.
Chapter 15 - 15
T530-15 Communication - RevG.doc
15.4.2 COMLICommLib
COMLI is a proprietary Master/Slave protocol implemented from the 1970’s by
SattControl/Alfa Laval Automation. It supports RS232 and RS485 transmission.
This library is used to communicate from AC800M to legacy SattControl systems.
Early SattControl PLCs include SattCon31, SattCon 05, SattCon 15, and SattCon200.
The port will act as a COMLI Master and connected devices will be COMLI Slaves.
Chapter 15 - 16
Compact Control Builder Training
15.4.3 FFH1CommLib
FOUNDATION Fieldbus H1 is used to communicate to FOUNDATION Fieldbus
devices using the H1 protocol.
The Communication Interface module CI852 is mounted on the CEX bus to provide
physical connection to FFH1 devices. The hardware definition for this device is found
in the hardware library CI852FFh1HwLib:
The library has a definition for the CI852 and also for a FF device.
15.4.4 FFHSECommLib
Foundation Fieldbus HSE (High Speed Ethernet) interconnects measurement and
control equipment such as sensors, actuators and controllers. It serves as a Local Area
Network (LAN) for instruments used in process control and has a built-in capability to
distribute the control application across the network.
The Communication Interface module CI860 is mounted on the CEX bus to provide
physical connection to FFHSE devices. The hardware definition for this device is
found in the hardware library CI860FFHSEHwLib:
Chapter 15 - 17
T530-15 Communication - RevG.doc
15.4.5 INSUMCommLib
INSUMCommLib is used to communicate to the ABB INSUM Motor Control Centre.
The Communication Interface module CI857 is mounted on the CEX bus to provide
physical connection to INSUM system. The hardware definition for this device is
found in the hardware library CI857InsumHwLib:
15.4.6 MB300CommLib
MB300CommLib is used to communicate to Advant Master AC400 series controllers.
These have a proprietary bus called Masterbus300.
The communication interface module CI855 is mounted on the CEX bus to provide
physical connection to MB300 Network. The hardware definition for this device is
found in the hardware library CI855MB300HwLib:
Chapter 15 - 18
Compact Control Builder Training
15.4.7 ModbusCommLib
ModbusCommLib provides function block types which use the Modbus protocol.
Modbus is a serial communication protocol and uses a standard RS232 serial port.
15.4.8 ModBusTCPCommLib
The ModBusTCPCommLib contains function blocks types to establish
communication with a system supporting the Modbus TCP protocol via Ethernet.
The communication interface module CI867 is mounted on the CEX bus to provide
physical connection to a Modbus TCP network. The hardware definition for this
device is found in the hardware library CI855MB300HwLib:
Chapter 15 - 19
T530-15 Communication - RevG.doc
15.4.9 ModemCommLib
This library is used to connect to a Modem via a serial port on the controller.
The function blocks may be used to dial up a remote system via a telephone link. Once
a connection has been established function blocks from the other communication
libraries may be used to transmit data over the phone line.
ModemDialUp establishes a connection.
ModemHangUp drops the connected line (hangs up).
ModemConnStat examines the status of the connection – (Connecting, Connected,
Disconnecting, and Disconnected)
15.4.10 S3964CommLib
S3964 is a point-to-point serial protocol used in Siemens control systems and
products. It is applicable when integrating System 800xA with existing Siemens
installations.
Chapter 15 - 20
Compact Control Builder Training
15.4.11 SattBusCommLib
SattBus is a proprietary token passing bus, designed and implemented by
SattControl/Alfa Laval Automation during the early 1990’s.
Most applications which used it are found in the food industry where it was used to
support the control high density valve matrices (SattTop)
SattBus is also used in some SattControl PLC systems as the preferred serial
communications method. Unlike COMLI which is Master/Slave, SattBus gives peer-
to-peer communication with up to 124 nodes on one bus.
The functions blocks here use COMLI over SattBus. This enhances the message types
available and the throughput.
15.4.12 SerialCommLib
SerialCommLib may be used to establish communication over an RS232 serial port.
This library allows the user to write code for any serial protocol and then to
transmit/receive data over the serial port.
Chapter 15 - 21
T530-15 Communication - RevG.doc
Configure the connection using the function blocks or control modules provided by
the protocol library. For most arrangements:
Use a Connect module to make the connection to the appropriate port
Use a Read module to read data from the remote device via the connections
Use a Write module to write data to the remote device via the connection
The addressing rules for each device will differ, so it is necessary to be familiar with
the protocol being used and the method of addressing memory or variables in the
remote device.
Chapter 15 - 22
Compact Control Builder Training
2. Select the correct hardware library and click “Insert” (in this example COMLI)
Chapter 15 - 23
T530-15 Communication - RevG.doc
6. Right click on Com 3 and select “Editor” to configure the port as necessary (e.g.
Baud, Stop Bits, Start Bits etc.)
7. Right click on the protocol (COMLI) and select “Editor” to configure the protocol
as necessary (e.g Master Address etc.)
Chapter 15 - 24
Compact Control Builder Training
2. Connect the library to the application that will contain the function blocks for the
Connect and Read/Write operations.
3. Insert the required function blocks into the program in a similar way to that for
access variable communication.
The Connect function block will require a channel address. This is the position of the
comms channel in the hardware. It is in the form “HardwareUnitNumber.Channel”.
The Modbus channel above is designated ‘0.3’ because it is on hardware unit no 0 and
position 3 (this is labelled COM3 on the physical CPU casing).
Chapter 15 - 25
T530-15 Communication - RevG.doc
Read/Write Blocks
These function blocks will require a remote system address referred to as the partner.
This is usually the numeric Slave address expressed as a string variable (not an
integer).
They will also require addresses for the data in the remote system.
Again these are string type variables, but the format will depend on the memory
organization and acceptable identifiers defined in the remote system.
Chapter 15 - 26
Compact Control Builder Training
Modbus
%IX8#100 Bit input memory localation octal format
%QX8#100 Bit Output memory location octal format
%IX10#64 (input) Bit input memory localation decimal format
%QX10#64 (output) Bit Output memory location decimal format
%IX16#40 (input) Bit Input memory location Hexadecimal format
%QX16#40 (output) Bit Output memory location hexadecimal format
Chapter 15 - 27
T530-15 Communication - RevG.doc
Chapter 15 - 28
Compact Control Builder Training
To establish connection, activate the En_C parameter (setting it to True) and specify
the physical channel with the Channel parameter via a connected string variable
having the Channel address as an initial value.
Use the SerialListen function block for listening, that is receiving a string sent from a
sending device.
EndChar is used to set which character is to define the end of a message. The
setting of EndChar only applies when the MsgLength parameter is set to 0.
The valid range of EndChar is 0 - 255, where 0 = none and 13 = CR (ASCII).
If MsgLength is set to a value greater than 0, the value defines the length of the
message. If MsgLength is set to 0, the message can be of any length. The end
character defined by the EndChar parameter indicates the end of the message.
NoOfTrailChar sets the number of characters after the end character. This
parameter is ignored if Checksum validation is set using the function block
SerialSetup.
Chapter 15 - 29
T530-15 Communication - RevG.doc
Chapter 15 - 30
Compact Control Builder Training
15.1.1 Description
Define access variables in one application and read the data from another application
in a different controller.
Define a structured data type as we did before. This data type will hold all of the
information we wish to pass between applications. We will be passing the values of
Reactor Tank Level and the Reactor Tank Temperature.
15.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
Exercise 15.1 - 1
J410-15 Exercise 15.1 - RevA2draft.doc
Exercise 15.1 - 2
Compact Control Builder Training
Create a new code pane in your Tank program of either ST or FBD and name it
“MMS_Comm”.
1. Navigate to the programs icon on the Sxx_ReactorApp, and double click the Tank
program:
3. Type the name of the codeblock(“MMS_Comm”) and select the FBD language:
Exercise 15.1 - 3
J410-15 Exercise 15.1 - RevA2draft.doc
Assign the reactor temperature and the level into your gSxx_Product variable.
Here is one possible solution using FBD using the “move” function:
1. Instantiate 2 “Move” functions.
2. Connect each input to a local variable which holds the desired data values.
Connect the outputs to the correspondent element of the global variable gSxx_Product.
Create one access variable in your controller called aSxx_Product and set the path to
the gSxx_Product global variable.
1. Access variables are defined in Control Builder M under the “Controllers” object.
Double click the Access Variables Icon to open the editor
Exercise 15.1 - 4
Compact Control Builder Training
3. To set the path click on the “Insert Path From Tree” button.
Create the following local variables in the program to hold the information required
for MMS communications.
Exercise 15.1 - 5
J410-15 Exercise 15.1 - RevA2draft.doc
Exercise 15.1 - 6
Compact Control Builder Training
Download your project to the controllers and take Control Builder M to the on-line
mode. Open the ReadMMS program and check your communications.
1. To check if the communication is ok, look at the Valid, Error and Status pins.
2. If there are any communication errors, check the initial values of the variables
involved on communication.
Exercise 15.1 - 7
J410-15 Exercise 15.1 - RevA2draft.doc
When we added the ML/SL interface we calculated the power. Add this power to the
communication. You have to adapted also the MMSDataType
Exercise 15.1 - 8