Connecting To The MC From Profibus Via Abc-Pdp
Connecting To The MC From Profibus Via Abc-Pdp
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.
• 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
S7 DB3
680 67
Table transfer between MC³ and the PLC DB2 and DB3 data structures. This block diagram
shows a two MC³ set-up
CONFIGURATION EXAMPLE
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.
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
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:
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.
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
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.
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.
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.
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
`
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.
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
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.
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
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.