0% found this document useful (0 votes)
189 views20 pages

Connecting To The MC From Profibus Via Abc-Pdp

Uploaded by

Bob Yahya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
189 views20 pages

Connecting To The MC From Profibus Via Abc-Pdp

Uploaded by

Bob Yahya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Connecting to the MC³ from ProfiBus via ABC-PDP

Copyright © 2004 Merrick Industries, Inc. All rights reserved

Connecting to the MC³ from ProfiBus via ABC-PDP


Using ProfiBus as a transport between MC³ controllers and PLC’s offers cost savings, improved
diagnostic capabilities, better accuracy and tighter control. A single ProfiBus network replaces
numerous analog and digital I/O modules, eliminates analog signal calibration and ensures data
integrity. Once the network is in place, adding I/O points and variable for monitoring is a matter of
configuration rather than pulling cables and buying new I/O modules.
The configuration described in this document is widely in use, and fully supported by Merrick
Industries. There is equipment on hand here to test user specific configurations and to deliver
pre-configured and tested solutions.

INTRODUCTION
It is possible to exchange status and variables between MC³ controllers and ProfiBus masters,
using an ABC-PDP protocol converter from HMS Industrial Networks AB (PDP). Communications
replaces both analog and digital I/O. Full Floating Point accuracy is maintained for variables. Up
to 10 variables and 80 I/O points can be configured per MC³ controller.
Newer versions of Merrick’s MC³ controller support ModBus RTU serial communications and
exposes a standardized Common Interface Table (CIT). ModBus functions 3 (Read Holding
Registers), 16 (Preset Multiple Regs) and 8, sub function 0 (Return Query Data) are supported.
The PDP has a ProfiBus Slave interface one side and a Modbus Master interface on the other.
Many MC³ controllers can be connected to the ABC-PDP using the existing 4-wire RS-422
interface on the PDP and the existing 4-wire RS-485 interface on the MC³ controller.
The information in this document applies to the following MC³ firmware versions:
Firmware Used for Released Comm Ver
20.10.EX.F Belt Feeder 03/28/02 1
20.20.EX (All) Belt feeder 04/17/03 2
24.10.EX.H and later Pressurized Coal Feeder 08/02/02 1
30.00.EX.C and later Loss-In-Weight 04/25/02 1
30.10.EX.E and later Enhanced Loss-In- 06/06/04 2
Weight
35.00.EX.B and later Weigh-Out Batcher 2
40.10.EX.A and later Impact Flow Meter 04/14/03 2
90.10.EX.Y and later MasterSet 01/02/03 2
Other Merrick firmware releases may also support ModBus RTU communications.
The ABC-PDP maintains a conversation with many MC³ controllers, using Modbus RTU, and
then exposes an aggregated read and one aggregated write table to the PLC. For real time
control purposes, a maximum of 4 MC³s per PDP can be used. For monitoring only, up to 16
MC³’s can be connected.
Data tables are transferred between the MC³s and the ProfiBus host PLC. The positioning and
content of the data elements in the tables must be tracked all the way from the internal MC³
register database to the data structures in the PLC. This is done in several steps:
• Between the MC³ register database and the MC³ CIT. Some of this mapping is fixed, and
some is configurable. You set this up in the MC³, in the Comm 1 Numeric screen.
• Between the MC³ CIT and the Read and Write Tables in the PDP. This is entirely configured
in the PDP, using the free ABC Configuration Utility from HMS Network.
• Between the PDP tables exposed to ProfiBus and the I/O table in the PLC. This is done in the
PLC hardware configuration.

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 1 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

• Between the I/O table in the PLC and the final data structures in the PLC. This is done with
PLC programming methods.
For performance reasons, all network transfers encompass entire tables. For this reason, all
elements in a table transfer must be of the same data type. Modbus RTU transfers handles 16 bit
INT’s, by design. ProfiBus normally handles 8 bit bytes.
In the CIT, and eventually in the PLC, different data types are used for control/status bits, integer
numbers and floating-point numbers. Control/Status bits and integer numbers are organized in
INTs (16 bit words). Parameters are organized as REALs (IEEE 32 bit floating point numbers),
located in two consecutive 16 bit words. In order to have usable data in the PLC, a user defined
data structure is used, which closely resembles the MC³ CIT table.
S7
MC³ Adapter Buffer S7 DB2
MC³ CIT Bytes
Registers INTs
PIW 56..57 +0.0
1 0
PIW 58 Reals In

+40.0
15
16 PDP Internal Words In
Memory Buffer
Bytes +48.0
PIW 113 Words Out
0x00 PIW 114
43 0x03 +52.0
Real Out
44 0x04

67 0x3B PIW 169


680
0x3C

S7 DB3

1 0 0x200 PQW 56..57 +0.0


0x203 PQW 58 Reals In
0x204
+40.0
15
16 Words In
0x213 PQW 65
0x214 PQW 66 +48.0
Words Out
0x223 +52.0
43 PQW 73 Real Out
44

680 67

COM1 Modbus RTU Logic


S7 Hardware
Numeric EIP Cont. SFC20
Configuration
Screen Utility Instructions

Table transfer between MC³ and the PLC DB2 and DB3 data structures. This block diagram
shows a two MC³ set-up

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 2 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

CONFIGURATION EXAMPLE

We used one Siemens S7 PLC, one PDP and two


MC³ controllers. A “Read All, Write some”
approach was taken, meaning that as much
information as possible was to be transferred from
the MC³ to the PLC, and just enough was going the
other way.
The PLC was configured to accept the PDP
interface on the ProfiBus Network. Some logic was
added to monitor the PDP status, to safeguard
communications integrity and to extract and insert
the MC³ data out of and in to useful data
structures.
The PDP interface was configured to maintain a
dialogue with two MC³ controllers, aggregate the
data and expose a Read and Write area to
ProfiBus.
The MC³ controllers were configured to accept
control data and expose data for monitoring using
Modbus RTU.
In the end, the MC³ controllers become an integral
part of the PLC I/O, with an easy to use
programming interface, in the form two data
structures.

Equipment used:
• Laptop PC, DELL Inspiron 7000. .
MS Windows 2000 Professional, SP2.
Siemens Simatic Manager Step 7 S7/M7/C7 V5.1 SP2 Rev level K5.1.2.0.
HMS Networks ABC Configurator version 2.00 rev 4.
• Siemens S7-315-2DP PLC including Power Supply and Simulator I/O module.
• Siemens MPI/DP PC Adapter V5.1, including cables.
• Home-made ProfiBus cable with terminators.
• ABC-PDP ProfiBus Interface.

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 3 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

• Home made serial interface cable ABC-PDP <-> MC³ controllers.

Configuring the PDP


PDP configuring is described in the AnyBus Communicator User Manual (ABCUM). The ABC
Configurator and ABCUM can be downloaded from the HMS web site, http://www.anybus.com.
We are trying to keep specific links updated on the Merrick connectivity web site http://merrick-
inc.com/mct. You can also download the actual ABC configuration file we used from that site.
The EIP requires 24 V DC. Connect according to ABCUM, appendix C. A serial interface cable
must be purchased or manufactured. Details can be found in ABCUM, appendix C, “PC
Connector”. Connect 24V and the PC Connector cable, and start the configurator. Configuration
is described in ABCUM, starting with chapter 4. You can skip Generic Data Mode (chapter 5).
You will be using Master Mode, described in chapter 6.
Fieldbus

There are no configuration


options for the Fieldbus
device. See ABCUM page 3-
4.

ABC
Control/Status byte should be
set to “Enable but no startup
lock”. This enables you to
check the RTU communi-
cation (with the MC³’s)
without having ProfiBus
connected.
The "Module Reset" should
be set to "Disabled". The
function of this setting is
obscure.
The Protocol setting must be
“Master Mode”, meaning
Modbus RTU master.
Statistics were turned off in
this example, but can be
useful for troubleshooting.

Sub-Network
The "Sub-Network" is in reality the multi-drop Modbus RTU network used to connect the MC³
controllers to the ABC-PDP. This is where almost all configuration takes place. There are settings

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 4 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

for the overall Sub-network, for the individual slaves (MC³'s in this case), for the actions for each
slave and for telegram parameters for each action.
The Sub-network settings are global and should be set as follows for successful MC3 operation:

Parameter Settings Comment


Bitrate 9600 or 19200 ModBus RTU standard is 9600.
Data Bits 8 Mandatory Modbus RTU setting.
Parity Any 'Even' is Modbus RTU standard.
Physical RS422 This is a four wire RS485 hook up. From the Modbus Master’s
Standard point of view, RS422 is the correct setting.
Start Bits 1 There are actually no options.
Stop Bits 1 or 2 Use 1.
Message 1 (10 ms) Set to at least 1. There is no performance gain in setting this
Delimiter parameter to 0.

All MC³ serial parameter


settings must agree with the
parameters in this table. Newer
MC³ controllers support four
wire RS485 and RS232, without
re-configuration. For older con-
trollers, and if you connect to
more than one controller, you
must use RS422.
Under the Sub-Network level,
insert nodes, one per MC³ you
want to connect. This is a
screen dump of our two node
setup.

There are two parameters associated with each node: Name and Slave Address. You pick the
name. In this example they are "MC3 #1" and "MC3 #2". The slave address has to be different for
each node and must be equal to the 'Controller Number' setting in the corresponding MC³. See
"Configuring the MC³" on page 6.
For each node, you typically insert two transactions, one for reading data from the MC³, and one
for writing data to the MC³. If you only want to monitor data in the MC³, you don't have to insert
any write transaction. The MC³ controllers support two transaction types, "Read Holding
Registers" (Modbus Function 3) and "Preset Multiple Regs" (Modbus Function 16). You use
"Read Holding Registers" to retrieve data from the MC³'s and "Preset Multiple Registers" to write
data to the MC³'s
Each transaction has parameters for a "Query" and a "Response". They all have to be set
correctly. Most parameters can be summarily set according to the table below, but the positioning
of the data in the ProfiBus table is critical and somewhat complex. The configuration used here
contains what you would need to monitor and control the MC³ controllers. Referring to the MC³ -
CIT Format on page 10, you read from words 16 - 42 and write to words 44 - 47. This will allow
you maximum monitoring capabilities, and to set control bits, external inputs and the feedrate
setpoint.

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 5 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

The Sub Network related parameters should be set according to the following table. The settings
are such that there is no performance degradation for four connected controllers, meaning that
the communication turn-around time is in the same order of magnitude as the internal MC³
update time.
Parameter Setting Comment
Offline Freeze, Determines what happens to the write transactions on the Modbus
options for Clear or side if ProfiBus goes down. Stop Scanning makes it impossible to
Fieldbus Stop check communications between MC³ and ABC-PDP without a
Scanning. working ProfiBus connection. Use Freeze.
Offline Clear or Determines what happens to the read transactions on the ProfiBus
options for Freeze side if Modbus communications goes down. Freeze is an attractive
sub-network solution since it does not disrupt data from all controllers if just one
goes offline. There are better means to monitor network integrity.
See "Use the integrity bit." on page 20.
Update Cyclically There is no need to do triggered updates. Performance is good
mode enough with cyclical update.
Minimum 10 Broadcasts are not used. This setting has no meaning.
time
between
Broadcasts
Reconnect 25 Trying to re-connect too often will degrade performance. 250 ms is
time reasonable value
Retries 2 It appears that retries are not done consecutively. The
performance penalty for a retry is minimal.
Timeout 25 The MC³ normally responds within 10 ms, but if a "heavy" screen,
time such as the line graph, is displayed on the controller, the response
time can be as long as 200 ms.
Update time 1 Set to 10 ms to maximize throughput.
Trigger 0x05FF Not used. This is the default.
Address

Use the following tables to set the parameters in all transactions:


Read Holding Registers Query
Parameter MC³ #1 MC³ #2
Slave Address 0x01 0x02
Function 0x03 0x03
Starting Address (Hex Word) 0x0010 0x0010
Number of points (Hex Words) 0x001C 0x001C
Checksum type, Start Byte CRC, 0x0000 CRC, 0x0000
Read Holding Registers Response
Parameter MC³ #1 MC³ #2
Slave Address 0x02 0x03
Function 0x03 0x03
Byte Count (Hex. Always twice the 0x0038 0x0038
Number of points)
Data length 0x0038 0x0038

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 6 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

Parameter MC³ #1 MC³ #2


Data location (position in the 0x0002 0x003A
ProfiBus table, in bytes)
Byte Swap No Swapping No Swapping
Checksum type, Start Byte CRC, 0x0000 CRC, 0x0000
Preset Multiple Registers Query
Parameter MC³ #1 MC³ #2
Slave Address (Hex) 0x01 0x02
Function (Hex) 0x10 0x10
Starting Address (Hex Word) 0x002C 0x002C
Number of Registers (Hex Words) 0x0004 0x0004
Byte Count (Hex. Always twice the 0x08 0x08
Number of points)
Data length 0x0008 0x0008
Data location Position in the 0x0202 0x020A
ProfiBus table, in bytes)
Byte swap No swapping No swapping
Checksum type, Start Byte CRC, 0x0000 CRC, 0x0000
Preset Multiple Registers Response
Parameter MC³ #1 MC³ #2
Slave Address 0x02 0x03
Function 0x10 0x10
Starting Address (Hex Word) 0x002C 0x002C
Number of Registers (Hex Words) 0x0004 0x0004
Checksum type, Start Byte CRC, 0x0000 CRC, 0x0000
Don’t forget to download the configuration to the ABC-PDP and to save the configuration file for
future reference. The ABC-PDP configuration file used here can be downloaded from
http://www.merrick-inc.com/mct/ProfiBus.htm.

CONFIGURING THE MC³


Configuring the MC³ controllers include
• Setting up communications parameters
• Setting up register tags, if you want to monitor special parameters, other than Feedrate, Belt
Load, Belt Speed, Subtotal or Total.
• Configuring Warnings and Faults. This configuration is done regardless if communications is
used or not.
• Mapping external inputs and outputs. Any logical input that you want to control from the PLC
has to be mapped to an external input. Any logical output you want to monitor has to be
mapped to a logical output.
• Setting up the Setpoint Source so that the Setpoint is taken from the PLC.
The following menu references and screen shots were taken using the MC³ 20.20.EX.A Belt
Feeder Controller application.

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 7 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

The “MC³ 20.20.EX Weigh Feeder Controller Operation and Maintenance Manual, Version A”
(O&M) is available at the Merrick Web Site: http://www.merrick-inc.com/mct/, at the bottom of the
page, click on MC³ Firmware Application Overview.

Setting the MC³ communications parameters


To get to the "Communications" screen from the main
screen, touch Action Menu, Settings Menu, enter the
password, Inputs & Outputs and finally Comm
Settings. Modbus RTU runs on COM 1. In this
example, the standard RTU line parameters were
selected, 9600 baud, 8 data bits, 1 stop bit and Even
parity. These parameters must agree with the settings
in the ABC-PDP "Sub-Network" settings on page 4.
Refer to the O&M page 66 for more details.
Touching the Comm 1 Numeric button takes you to the Comm Numeric Params screen. Set the
parameters as follows:

Parameter Value Comment


Controller # 1 This is the Slave Address. They must be different for each controller
2 and correspond to the "Slave Address (hex)" parameters in the query
and response parameter list in the ABC-PDP configuration
Start Char 10 Has no meaning for Modbus RTU
End Char 13 Has no meaning for Modbus RTU
Comm Timeout 5.0 The MC³ times incoming, legal RTU telegrams, and turns on the Ser
Comm Lost logical output if this time expires. You typically let this
output qualify a Warning. Also, this will turn off all External Inputs.
Comm Protocol 2 Enter 2 for Modbus RTU
Write Protect 3071 BFF hex. All registers write protected except Primary Setpoint
Word Order 4095 FFF hex. All registers have reversed word order. This has to be found
by trial and error. The Simatic S7 PLC has the word order for a
floating point value reversed (as compared with a Modicon PLC).
Int/Frac FP 0 Floating Point transfer is supported. Integer/Fraction is not needed.
Tag Reg 1 353 Internal MC³ Register Number for the "Zero Tracking Load" variable.
This will make the value show up in the "Tag 1 R value" position.
Tag Reg 2 0 Use 0 for unused tags
Tag Reg 2 0
Tag Reg 3 0
Tag Reg 4 0
Tag Reg 5 0

Obviously, to be able to tag other internal MC³ registers, you need to have the register
specification for the specific MC³ application you are using. You can find the register
specifications for most MC³ firmware applications at the Merrick Web Site, http://www.merrick-
inc.com/mct/, at the bottom of the page, click on MC³ Firmware Application Overview.
If you extend the size of the write table, you can write to the "Tag Reg x" parameters from the
PLC. This allows for multiplexing of the parameters in the "Tag x R Value" positions.

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 8 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

Configuring warnings and faults


Warnings and Faults are qualifiers to logical inputs and outputs, normally set by the user.
Warnings are considered to require attention. Faults are considered to be fatal for the feeder
operation, and the controller will attempt to stop the feeder. See O&M, page 55. In this example
the warnings and faults are set up according to the following table:
Logical I/O Qualifier Comment
HPAD Overload Fault Invalid Load Cell Signal
HPAD Underload Fault Invalid Load Cell Signal
Blt Drive Fail Fault Signal from the belt motor VFD, connected to an MC³ input.
Hi Setpoint Warning Setpoint above upper limit. To detect floating point transfer
problems.
Hi Belt Load Warning Too much material on the belt
Ser Comm Lost Warning No valid RTU telegram has been received for 5 seconds.
Load Simulator Warning Don't run the feeder for real with the Load Simulator turned
on!
Blt Drive Ovrld Warning Signal from the belt motor drive, connected to an MC³ input.

The qualifiers are set up in the Digital Inputs (O&M Page 55) and
Digital Outputs (O&M Page 59) screens. With the settings above,
the Warnings and Faults screens look like this.
The state of the checkmark is transferred to the Warnings [18] and
Faults [19] word in the CIT. The bit order is the same as the
displayed order of the screen. It is important to note that the bits in
the Warnings and Faults registers reflect the state of the
checkmark, not the dot. In this warning screen, both are on for the
logical input "Load Simulator". Bit 3 of the Warnings register is on.
If the "Load Simulator" input is turned off, then the dot goes away,
but the checkmark stays until the warning is ACK'd, either on this
screen or by the "Clear Warnings Command" bit in the Control [44]
register.
Note that the order of display is not configurable. It is derived from the order of logical outputs
and logical inputs in the Digital Inputs and Digital Outputs screens. If you add or remove a
warning or fault qualifier to a logical input or output, the order may change.

Configuring External Inputs and Outputs


Logical inputs and outputs can be mapped in three ways:
1. To a physical input or output. In this example the logical input 'Belt Drive Overload' is mapped
to Rack 1 Input 3, which, in turn, is connected to the Overload output of the belt motor VFD.
The physical output Rack 1 Output 5 is mapped to the logical output 'Drive Enable'. The
output is then connected to the Start input of the belt motor VFD.
2. To an external input or output. In this example, the 'Run Permission' logical input is mapped
to External Input 1. This allows the PLC to start and stop the feeder through the External
Inputs register, CIT Word 45, bit 0.
3. Unused Logical Inputs are typically connected to the Physical Inputs 'Always On' or 'Always
Off'.
The PLC controls inputs to the MC³ as bits in the 'External Inputs' register, CIT Word 45. They
are then mapped to Logical Inputs in the MC³. Note that the External Inputs are numbered 1 - 16.
Bits in the 'External Inputs' word are numbered 0 - 15 in the PLC.

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 9 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

In this example, we use 5 inputs. Two are physical connections from the VFD to the MC³, one is a
physical connection to the emergency stop circuit (Feeder Block), and two are inputs controlled
from the PLC (Run Permission, Load Simulator).
This is how the inputs have to be mapped in the MC³, where n is 1 or 2 for MC #1 and #2:
Logical Physical W/F Bits in the PLC
Run Permission External Input 1 DBn.DBW 50 bit 0
Load Simulator External Input 2 W DBn.DBW 50 bit 1
Feeder Block Rack 1 Input 1
Belt Drive Ovrld Rack 1 Input 2 W
Belt Drive Fail Rack 1 Input 3 F

Digital output mapping:


Physical Logical W/F Bits in the PLC
Rack 1 Output 4 Fdr Drv Enable
External Output 1 Fault DBn.DBW 42 bit 0
External Output 2 Warning DBn.DBW 42 bit 1
External Output 3 Ready DBn.DBW 42 bit 2
External Output 4 Good Feedrate DBn.DBW 42 bit 3
External Output 5 Hi Belt Load W DBn.DBW 42 bit 4
External Output 6 Hi Setpt W DBn.DBW 42 bit 5
External Output 7 HPAD Overload F DBn.DBW 42 bit 6
External Output 8 HPAD Underload F DBn.DBW 42 bit 7

Setting up the setpoint source


The MC³ Setpoint Method should be set to Serial. See O&M, Page
27. The setpoint is taken from the PLC’s DBn.DBD 52 in this
example. See Configuring the Siemens S7 PLC on page 16.

CONNECT THE ABC-PDP TO THE MC³S AND CHECK COMMUNICATIONS


If the distance between the EIP and the MC³ controllers is more then a few feet, use a cable
designed for RS-422. There should be two pairs, individually shielded. Belden 9368 or equivalent
is a good alternative. Connect the shields only at the ABC-PDP, to pin 5 of the DB9-P. At the
MC³s, connect the incoming and outgoing shields together only. Add pull-up and pull down
resistors at the EIP, 221 Ω, between pins 6 and 1 (Rx+ and +5V) and pins 7 and 5 (Rx- and
GND). Add terminating resistors at the last MC³, 221 Ω. Connect one between terminals 1 and 2
and one between terminals 3 and 4. The pin numbering on the MC³ is left to right.
There are two revisions of the MC³ controller, “old” and “new” Refer the MC³ hardware manual. It
is available at the Merrick Web Site, http://www.merrick-inc.com/mct/, at the bottom of the page,
click on MC³ Hardware Reference Manual. The different layouts are described in “MC³
Connections”.

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 10 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

MC³ #1 MC³ #2 MC³ #3 MC³ #4

`
RS-485 `
RS-485 `
RS-485 `
RS-485
Tx+ Tx- Rx+ Rx- Tx+ Tx- Rx+ Rx- Tx+ Tx- Rx+ Rx- Tx+ Tx- Rx+Rx-
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
DB9P
Interface
End
221
221 221
+5v
RX +-
5 4 3 2 1
9 8 7 6

GND TX +-
BELDEN
Connect Connect 9368
221 Shields to ALL Shield
terminal 5 together

A “New” CPU board, Rev 11 or later, have two RS-485 ports built in. You connect to the right port
on the bottom board. The DB9-P (Pins) connector to the right is the RS232 port for Comm 1. The
two connectors on the left are for Comm 2.
An “Old” CPU board did not have an RS-485 port, so the port on the top board was used. For a
card stack with a “New” CPU board, this port is not connected and does not work.
When you have connected and powered up the MC³s and ABC-PDP, communication should start
even without any EtherNet/IP connection. Check that all looks OK in the ModBus Diagnostic
screen.. See page 18.

Bench-Testing Your System


If you have access to the MC³’s and the EIP, you can bench-test your entire system, by using the
built-in simulators in the MC³. The MC³’s will behave as if a real feeder was connected to them,
although you will have to set up a belt load manually. To put an MC³ 2020 in simulation mode:
1. In Action Menu, Settings Menu, Tacho Settings, push the lower left button until it reads
“Simulator”
2. In Action Menu, Settings Menu, Inputs & Outputs, HPAD settings, push the leftmost button
until it reads “None”
3. Set the Load Simulator bit, DBn.DBW 50.1. You control the belt load by invisible touch pads
on the upper row on the MC³ screen. Increase the load with touch pad 6 (from the left).
Decrease the belt load with touch pad 5.

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 11 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

MC³ - CIT FORMAT


The format of the data structure exposed to communications is the same for Modbus ASCII,
Modbus RTU and DF-1 CIF read and write. The first 16 words are in place for legacy reasons
and should not be used. However, reading and displaying words 8 - 15 can sometimes be useful
for troubleshooting purposes.
Words 16 - 43 are read only and intended for monitoring. For performance reasons, read a
section, starting with word 16, and as far along as you need. The performance penalty for
extending the read area length is small; however, you may find that you run out of space in the
ProfiBus I/O table if you have many MC³’s.
If you need to conserve I/O table space, first determine how many variables you really need.
Typically, for a belt feeder, this would be Feedrate and Subtotal. If this is the case, you can read
from word 16 – 23. You will then have to enter the MC³ register number for Feedrate in Tag 1
RegNo (251 for 20.20.EX.A) and for Subtotal in Tag 2 RegNo (181 for 20.20.EX.A). The Tag X
RegNo values can be set in the MC³ by going to Action Menu, Settings Menu, enter the
password, Inputs & Outputs, Comm Settings, Comm 2 Numeric.
Words 44 - 67 can be written to. Note that the "Tag n W value" (n = 1...5) refers to the same
internal MC³ register as the "Tag n R value". The "Tag n RegNo" is the internal MC³ register
number corresponding to the values red from or written to. This Tagging scheme is in place to
enable you to get to any variable within the MC³. You must have the Register Specification for the
application and version you are working with. You can find the register specifications at the
Merrick Web Site, http://www.merrick-inc.com/mct/, at the bottom of the page, click on MC³
Firmware Application Overview.
There is a risk here. You can easily crash the MC³ if you, for example, write a value of zero to a
variable used in a divide operation. The only remedy in this case is to Ram Reset the MC³. You
will then have to enter all the MC³ parameters again. If you have WinMerik, which can be used to
upload and download MC³ parameters with a PC; it is a good idea to upload before you start
writing to internal MC³ variables.
Words 60 to 67 are also accessible in the MC³ Comm Numeric Params screen. See “Setting the
MC³ communications parameters on page 8. If you write to them from the ABC-PDP, the values
set in that screen will be overwritten. Words 60 to 67 are "sticky" and will survive power cycling.
Word formatting and write protection properties are set in words 60 - 62. It is a good idea to have
all tagged registers write protected (4095, 0xFFF in word 60) until the floating point transfer
method has been checked out. It is possible to transfer an invalid floating point number into a
variable that is used in actual calculations, rendering a MC³ software fatal exception.
The following table lists all transitions from the MC³ CIT table to the data structures in the PLC in
this example. Note that this is example specific.

http://www.merrick-inc.com/mct/Profibus/ProfiBus.pdf Page 12 10/18/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

CIT Ln Contains Data DNI Comment ProfiBus ProfiBus S7 final


Word format Bit table I/O Table word I/O Table word address
(Note 2) Element MC #1 MC #2 (n = 2 or 3)
0 8 Physical I/O Backwards Compatibility
8 8 Logical I/O Backwards Compatibility
16 1 Status R0 See Note 1 below for bit info PIW 4-5 PIW 60-61 DBn.DBW 40
17 1 External Outputs R1 PIW 6-7 PIW 62-63 DBn.DBW 42
18 1 Warnings R2 PIW 8-9 PIW 64-65 DBn.DBW 44
19 1 Faults R3 PIW 10-11 PIW 66-67 DBn.DBW 46
20 2 Tag 1 R Value 0 (0001) R 4,5 PIW 12-15 PIW 68-71 DBn.DBD 0
22 2 Tag 2 R Value 1 (0002) R 6,7 PIW 16-19 PIW 72-75 DBn.DBD 4
24 2 Tag 3 R Value 2 (0004) R 8,9 PIW 20-23 PIW 76-79 DBn.DBD 8
26 2 Tag 4 R Value 3 (0008) R 10,11 PIW 24-27 PIW 80-83 DBn.DBD 12
28 2 Tag 5 R Value 4 (0010) R 12,13 PIW 28-31 PIW 84-87 DBn.DBD 16
30 2 Feedrate 5 (0020) R 14,15 PIW 32-35 PIW 88-91 DBn.DBD 20
32 2 Weight 6 (0040) R 16,17 PIW 36-39 PIW 92-95 DBn.DBD 24
34 2 Speed Info 7 (0080) R 18,19 Speed, if available, or SCR out PIW 40-43 PIW 96-99 DBn.DBD 28
36 2 Subtotal 8 (0100) R 21,22 PIW 44-47 PIW 100-103 DBn.DBD 32
38 2 Total 9 (0200) R 23,24 PIW 48-51 PIW 104-107 DBn.DBD 36
40 1 App/Ver R 24 App # in hi byte, Ver (ASCII) in low PIW 52-53 PIW 108-109
41 2 Phys Inputs R 25 Note 7 PIW 54-55 PIW 110-111
42 1 Phys Outputs R 26,27 Note 8 PIW 56-59 PIW 112-115
44 1 Control W0 See Note 1 below for bit info PQW 4-5 PQW 12-13 DBn.DBW 48
45 1 External Inputs W1 PQW 6-7 PQW 14-15 DBn.DBW 50
46 2 Primary Setpoint 10 (0400) W 2,3 PQW 8-11 PQW 16-19 DBn.DBD 52
48 2 Sec. Setpoint 11 (0800)
50 2 Tag 1 W Value 0 (0001)
52 2 Tag 2 W Value 1 (0002)

http://www.merrick-inc.com/mct/ProfiBus.pdf Page 13 03/12/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

CIT Ln Contains Data DNI Comment ProfiBus ProfiBus S7 final


Word format Bit table I/O Table word I/O Table word address
(Note 2) Element MC #1 MC #2 (n = 2 or 3)
54 2 Tag 3 W Value 2 (0004)
56 2 Tag 4 W Value 3 (0008)
58 2 Tag 5 W Value 4 (0010)
60 1 Write Protect Bits Set for write protection. See note 3
61 1 Word Order Bits Set to reverse. See note 4
62 1 Int/Frac Bits Set for Int/Frac. See note 5
63 1 Tag 1 RegNo MC³ register number
64 1 Tag 2 RegNo
65 1 Tag 3 RegNo
66 1 Tag 4 RegNo
67 1 Tag 5 RegNo

http://www.merrick-inc.com/mct/ProfiBus.pdf Page 14 03/12/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved

Note 1 This is the bit assignment for words 16 and 44, corresponding to the first words read
and written by the ABC-PDP.
Bit Word 16 Function Word 44 Function Comment
0-6 See note 6 Unused Tag error reporting
7 Integrity bit echo Integrity bit The MC³ will echo this bit from word
44 to word 16.
8 Clear Warnings Clear Warnings Demand Used by PLC to clear all warnings. Set
Done the bit in word 44, and wait for the bit
in word 16 to set. Then clear the bit in
word 44.
9 Clear Subtotal Done Clear Subtotal Demand Same scheme as for Clear Warnings
10 Lock Touchpad Lock Touchpad Demand Disables all touch-buttons on the MC³
Done A Ser Comm Lost will re-enable them.
11 Reserved Reserved Planned for Register Download
12 Pacing flag Low Feedrate Deviation. Used for
pacing functions, whereby other
feeders in the system will follow a
“starving” feeder.
13 Not Serial Setpoint MC³ will ignore sent setpoint. Set
when the Setpoint Method is
something else than Serial.
14 MC³ in menu Used for tampering monitoring. This
bit is on whenever the MC³ menu
system is entered.
15 MC³ recalibrated Recalibration ACK In place for historical reasons. Set
when any calibration procedure is
accepted or any parameter is
changed. Reset with a Low-to-high
transition of Recalibration ACK.

Note 2. This column defines the bit weight for the corresponding variable in the format words
60, 61 and 62. Example: Tag 2 Read and Write values both are governed by bit one
(with bit weight 0002 Hex) in the format words 60, 61 and 62. In this way, Write
Protection, Word Order and Integer/Fraction representation is individually settable for
every numerical variable in the data map.
Note 3. The write protection property should be set when an MC³ register is tagged for
monitoring only. When writing to words that are write protected, the corresponding Tag
n W value changes accordingly, but the corresponding MC³ register (Tag n R Value) is
unaffected. This is useful for testing data transfers to the MC³ before they are
implemented, or when you need to change a variable only at certain instances.
Note 4. The Word Order Bit, when set, reverses the order of the two words that contains value
information. To correctly transfer floating-point values to and from PLC’s, these bits
may have to be set.
Note 5. The Integer/Fraction bits are used when the device using the data does not support
floating-point numbers. With the corresponding Word Order bit cleared, the first word
will carry the Integer part, and the second the fractional part, multiplied with 10000. (4
implied decimal places). Note that for a negative value, both the integer and fractional

http://www.merrick-inc.com/mct/ProfiBus.pdf Page 15 03/12/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved
parts are negative. This scheme will not work for values outside the interval
(-32767..32767), since those are the extreme values for an INT.
Note 6. Bits 0 - 3 are used to signal problems with Tag Register Numbers as follows:
Bit 0 Attempt to write to a conditionally write-protected MC³ register while the “Extended
Access” logical input is OFF.
Bit 1 Attempt to write to a write-protected register.
Bit 2 Attempt to write to a non-existing register.
Bit 3 Attempt to read from a non-existing register. Zero returned.
Note 7 Rack 1 input 1 in bit 0, Rack 1 input 2 in bit 1 etc. Rack 2 input 1 in bit 4….
Note 8 Rack 1 output 1 in 42 bit 0… Rack 1 output 8 in 42 bit 7, Rack 2 output 1 42 bit
8…Rack 2 output 2 in 42 bit 15, Rack 3 output 1 in 43 bit 0 etc.

CONFIGURING THE SIEMENS S7 PLC


To verify Simatic Step 7 to MC³ communication integrity, a test set-up was arranged. Some data
blocks were defined, hardware was configured and some logic was created to move the MC³
data between the data blocks and the ProfiBus I/O table.

Data block definitions


Two data blocks were
defined, DB2 for MC#1 and
DB3 for MC #2. Address 0.0
to +36.0 holds floating point
values from the MC³. +40.0
to +46.0 holds bit data from
the MC³. +48.0 to +50.0
holds bit data going to the
MC³ and, finally +52.0 holds
the setpoint, going to the
MC³.

Three variable tables were also


defined, one for the ProfiBus I/O
table and two for the two MC³s.
Here is one of the MC³ variable
tables. This screen shot is from
the actual test. The feeder is
running at 18 lb/min feedrate

http://www.merrick-inc.com/mct/ProfiBus.pdf Page 16 03/12/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved
Simatic Hardware Configuration
To configure Step 7 and the PLC to accept the ABC-PDP, the GSD file can be imported from
http://www.anybus.com/downloads/ConfigFiles/HMS_1803.gsd. There is also a very helpful
application note, “AnyBus-S for ProfiBus and Siemens S7 Application Note”. You can download it
from http://www.hms-networks.com/applications/docs/Siemens Step7 and AnyBus-S.pdf

This is what the configuration screen


looked like after importing the GSD file and
setting up the I and Q addresses. Slot 1 is
the ABC-PDP status, 2 is data from both
MC³'s, 3 is the ABC-PDP control word, and
4 is the data going to the MC3's. The
setting up is well described in the
application note mentioned above.

PLC logic to move the data


SFC 20 instructions were used to copy data
between the I/O table and the MC3 data
structures. Here is a snippet out of the logic in
OB1
The floating point variables are useless when
accessed directly in the ProfiBus I/O table. One
value uses 4 bytes. To get usable values they
have to be copied to the data blocks. SFC20 can
copy data of type “any” to data of type “any”,
without attempting to format or type-convert the
data.
A zipped up Step 7 project folder system is
available for download on
http://www.merrick-inc.com/mct
Our Step7 version was 5.1 Service Pack 2.

http://www.merrick-inc.com/mct/ProfiBus.pdf Page 17 03/12/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved
Troubleshooting
Setting up industrial networks can sometimes be a daunting task. In this example, four mapping
layers are involved, along with two different communication protocols. Fortunately, there are
excellent troubleshooting tools available.
Look at the LED's on the MC³ CPU board.
The LED indicators 3 and 4 on the MC³ CPU
board are connected to the serial Receive
Data and Transmit Data, respectively.
Indicator 3 should blink twice as fast as
indicator 4, since one out of two telegrams
are intended for other controllers in this
example. The rightmost indicator in this
picture is indicator 1.

Check data in the CIT data screen.


The actual values in the CIT exposed to
communications can be inspected in the MC³ by
touching Action Menu, Diag Display, Modbus Diag,
Dat. Note that the values are only updated on valid
Modbus telegrams. If no telegrams have been
received, most values are zero. As you can see, the
layout follows the CIT exactly. All integer value are
presented in hexadecimal format except the Tag
register numbers. The ‘e’ format for the floating points can help troubleshooting FP transfers. You
are reading from all rows to the left, and writing to the first three rows on the right in this example.
If you succeed with the integrity bit, you should see bit 7 in the Sts/DNI and Ctl/DNI toggle.
Check error counters in the Communication Diagnostic screen.
Communications status and statistics can be
inspected in the MC³, by touching Action Menu, Diag
Display, Modbus Diag. The screen looks like this.
In this shot, out of 1206 successful exchanges, there
was none lost to errors. There were 1287 telegrams
addressed to some other RTU device. The last
command received was 16 (Preset Multiple Regs),
starting at word 44, 4 words long.

Label Meaning
rxlen Length, in bytes, of the last incoming RTU telegram
lalen Length, in bytes, of the last outgoing RTU telegram
cCRC CRC16 value calculated out of the incoming telegram. Hex.

http://www.merrick-inc.com/mct/ProfiBus.pdf Page 18 03/12/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved
Label Meaning
tCRC CRC16 value received in the incoming telegram. Hex. Should be the same as cCRC
mxtim Communications timeout in 100 ms ticks – “Comm Timeout” in the Com/Num menu
unita “Slave address” for this controller number. “Controller Number” in Com/Num menu
ints Comm events counter. Counts all incoming and outgoing bytes
rxchs Received bytes counter.
Txchs Transmitted bytes counter
rtgms Received, complete telegrams to this slave counter
ttgms Transmitted telegrams from this slave counter
rENQs Not used for Modbus.
tENQs Not used for Modbus
rNAKs Not used for Modbus
tNAKs Transmitted NAK counter. Telegrams to this node with badly formatted data,
requesting non-existing registers or writing to write-protected registers
rACKs Not used in Modbus
tACKs Not used in Modbus
NotMe Counter for Received telegrams intended for other slaves
rxlna Latest NAK. See note 2.
rxe Received telegrams in error counter
rxuae Received bytes with UART errors counter
rxlua Last encountered UART error. See note 1.
Rxcse Received telegrams with CRC16 error counter
rxfme Received telegrams with format error counter
rxlfm Last format error encountered. See note 2.
Rxcme Non-supported command received counter
timee Comm timeouts counter
addr First register in received command. Should toggle between 16 and 44
size Number of registers in received command. Should toggle between 28 and 4
cmd Modbus command received. Should toggle between 3 and 16
subf Subfunction in diagnostics command. Only 0, (Return Query Data) supported.
retST Exception status of an received command causing a NAK
RX Received telegram. First 19 bytes in HEX format
TX Transmitted telegram from this node. First 19 bytes in hex format.
Gpc0x Internal troubleshooting counters. No useful information.

Note 1 This is the UART status register, bit encoded. Bit 0: Not Used. Bit 1: Overrun error. Bit 2:
Parity error. Bit 3: Framing error. Bit 4: Break detected.
Note 2 Format errors have a decimal numerical value:
1. Unsupported Modbus command
2. Read Holding Register telegram not 6 bytes long
3. Trying to read from non-existing registers
4. Read Diagnostic telegram not 8 byres long

http://www.merrick-inc.com/mct/ProfiBus.pdf Page 19 03/12/04/Lars


Connecting to the MC³ from ProfiBus via ABC-PDP
Copyright © 2004 Merrick Industries, Inc. All rights reserved
5. Unsupported subfunction in Read Diagnostics telegram
6. Trying to write to non-existing registers
7. Byte count field disagrees with length field in Preset Multiple Registers command
8. Telegram length disagrees with length field in Preset Multiple Registers command
9. Trying to write to read-only registers
10. Unknown Modbus command
11. MC³ Reciever buffer overrun - more than 255 bytes in telegram.
12. Linefeed not following Carriage Return in Modbus ASCII telegram
13. Bytes received after complete telegram, before telegram interpretation (too fast).
14. Should never happen… Unknown receiver state.
15. Should never happen… Transmitter buffer overrun.
Increase Message Delimiter to see every telegram.
The telegram exchange rate typically exceeds the display update rate in the MC³ Mobus
Statistics screen. If you want to see each telegram received and transmitted, you can increase
the Message Delimiter time in the Sub Network parameters list the ABC-PDP configurator to 20,
corresponding to 200 ms. This allows you to see all telegrams received and transmitted.
Use the ABC-PDP Node Monitor.

See ABCUM, Chapter 9. In the ABC Configuator, click on a node and then the node monitor
button. You can inspect the data, in hexadecimal format, for the selected node.
Use the integrity bit.
In the PLC, toggle the integrity bits (DBn.DBW 48, bit 7) every 2 seconds. Monitor the integrity
echo bit (DBn.DBW40, bit 7). If the echo bit stops toggling, communications has failed, and
appropriate steps can be taken. The integrity bit can be monitored in the MC³ Data Table screen
and in the ABC-PDP data monitoring screen.

http://www.merrick-inc.com/mct/ProfiBus.pdf Page 20 03/12/04/Lars

You might also like