ABB NextMove ES/ESB-2, e100, MicroFlex e100, e150, MotiFlex e180 Motion Control Products, CP600, B HMI panels, AC500 PLC Application note
NextMove ES/ESB-2, NextMove e100, MicroFlex e100, MicroFlex e150, MotiFlex e180, CP600, CP600-B, AC500 products are capable of operating as Modbus servers. Products with a serial port support Modbus RTU, products with an Ethernet port support Modbus TCP. These products allow connectivity between a wide range of ABB products including AC500 PLCs and CP600 HMIs as well as third party Modbus client devices.
Advertisement
Advertisement
Motion Control Products
Application note
Integrated Modbus support
AN00198-003
Inclusion of Modbus protocol support as standard makes integration of ABB products with any other
Modbus RTU/TCP device as simple as possible
Introduction
Integrated Modbus support is available on the following active ABB motion control products:
· NextMove ES/ESB-2 (RTU server) – firmware version 5424 onwards
· NextMove e100 (RTU/TCP server) – firmware version 5633 onwards
· MicroFlex e100 (RTU/TCP server) – firmware version 5633 onwards
· MicroFlex e150 (RTU server / TCP server and client) – all versions
· MotiFlex e180 (TCP server and client) – all versions (when fitted with Mint memory option +N8020)
Modbus RTU and TCP are also supported as standard on the CP600 and CP600-B ranges of HMI panels as well as the AC500
PLC range.
MicroFlex e150 and MotiFlex e180 Modbus operation is configured via the ‘Configuration’ screens within Mint Workbench when online to the controller. All other products use Mint keywords to enable and configure Modbus server operation. Download firmware from www.abb.com/motion or contact [email protected] to obtain the relevant Mint System File (.msx) to update a drive
/ motion controller. Note that Modbus support is only offered on Revision B e100 products (e.g. MFE230A003B).
NextMove and MicroFlex e100 Modbus functionality
These products are only capable of operating as Modbus servers. Products with a serial port support Modbus RTU, products with an Ethernet port support Modbus TCP. Support is provided for the following Modbus server functions:
· 03 – Read holding registers
· 04 – Read input registers
· 06 – Preset single register
·
16 – Preset multiple registers
·
23 – Read / write 4x registers
The Mint keyword ModbusParameter allows configuration of:
· Modbus enable/disable
· Register mapping (to comms or netdata locations)
· Byte order
· Word order
· Diagnostics
The inclusion of integrated Modbus protocols on these controllers/drives allows connectivity between a wide range of ABB products including AC500 PLCs and CP600 HMIs as well as third party Modbus client devices.
ABB Motion control products www.abb.com/motion
1
Application note Integrated Modbus support AN00198-003
Configuration
All Modbus parameters are configured via a Mint keyword – ModbusParameter.
Before enabling Modbus operation it is necessary to set the correct byte and word order to suit the connected Modbus client
(master) and to configure how Modbus registers in the received data packets are mapped to internal data areas in the NextMove and e100 controllers.
value = ModbusParameter (bus, index)
ModbusParameter (bus, index) = value
Mint pre-defined constant values for bus are:
_busETHERNET
_busSERIAL1 6 For
Mint pre-defined constant values for index are:
_mpENABLE 0
_mpREGISTER_MAPPING 1
_mpDROPPED_FRAMES 6
_mpDEBUG 7
0 Disabled, Enabled
0 = NetData array (e100 default), 1 = Comms array (ESB-2 default)
0 = Big Endian (default), 1 = Little Endian
0 = Big Endian (default), 1 = Little Endian
Read only counter of number of invalid packets received used display
Mint pre-defined constant values for _mpREGISTER_MAPPING are:
To access netinteger / netfloat data
To access commsinteger / comms data
NextMove ES and ESB-2 are only provided with Comms array data so attempting to configure a Netdata register mapping on this controller will result in a ‘Data Out of Range’ error.
The default byte and word orders are configured to match the requirements for communication with other ABB Motion, PLC and
HMI products. Some third party Modbus products tend to use Little Endian word order so when using a third party client it may be necessary to include…ModbusParameter (bus, _mpWORD_ORDER) = 1…in the Mint Startup block code.
Modbus RTU is a serial based protocol and operation is supported using 8 data bits, 1 stop bit and no parity. The following baud rates are supported on all controllers:
·
19200
·
38400
· 57600
· 115200
Note that, due to timing constraints, 9600 baud is not supported. The baudrate to be used is set using the Mint
SERIALBAUD(_Term1) keyword in the Mint program (or via the Mint Workbench ‘Connectivity’ page). As Modbus RTU packets include a node address it is also important to set the correct value for BUSNODE(_busSERIAL1) in the Mint program (or via the Mint
Workbench ‘Connectivity’ page). Support is included for broadcast write functions (i.e. to Node address 0) so the user should avoid configuring a controller as Node 0 unless they intend to use broadcast functions.
When using Modbus TCP the controllers / drives use the standard Modbus port 502. The IP address used by Modbus TCP is usually set by the rotary address switches on the front of the e100 product; 192.168.100.x (where x is the switch setting), but use of the BUSIPCONFIG keyword in the program will allow an e100 device to assume any IP address (please refer to the Mint Help file for further details).
To enable Modbus server (slave) operation the Mint program should issue….
ModbusParameter (bus, _mpENABLE) = 1 (where bus = _busETHERNET for Modbus TCP or _busSERIAL1 for Modbus RTU).
ABB Motion control products www.abb.com/motion
2
Application note Integrated Modbus support AN00198-003
Enabling Modbus RTU server operation automatically disables both Host Comms Protocol (HCP1/2) and ABB Binary Protocol
(BBP) functionality on the serial port. Enabling Modbus RTU also prevents the controller from directing data from Mint PRINT statements to the serial port to avoid corruption of Modbus data packets.
Register Mappings
All supported Modbus functions target a common data area in the NextMove controller /e100 drive as set by the Mint keyword
ModbusParameter (_mpREGISTER_MAPPING). These data areas have a fixed mapping with respect to the Modbus registers on the server as shown by the table below (equivalent AC500 addresses are also shown for reference):
Server Modbus register
0
1
4
5
2
3
…
198
AC500 address
%MW0.0
%MW0.1
%MW0.2
%MW0.3
%MW0.4
%MW0.5
---
%MW0.198
199
200
201
%MW0.199
%MW0.200
%MW0.201
202
203
%MW0.202
%MW0.203
… ---
1996 %MW0.1996
1997 %MW0.1997
1998 %MW0.1998
1999 %MW0.1999
%MD0.0
%MD0.1
%MD0.2
---
%MD0.99
%MD0.100
%MD0.101
---
%MD0.998
%MD0.999
Mint Comms array
(Comms=Real, Commsinteger = DWord)
Invalid
Invalid
Invalid
Element 1 LSW
Element 1 MSW
Element 2 LSW
Element 2 MSW
---
Element 99 LSW
Element 1
Element 2
---
Element 99
Element 99 MSW
Invalid
Invalid
Invalid
Invalid
Invalid
---
Invalid
Invalid
Invalid
Invalid
Invalid
---
Invalid
Invalid
Mint Netdata array
(Netfloat = Real, Netinteger = DWord)
Element 0 LSW
Element 0 MSW
Element 0
Element 1 LSW
Element 1 MSW
Element 2 LSW
Element 2 MSW
---
Element 99 LSW
Element 1
Element 2
---
Element 99
Element 99 MSW
Element 100 LSW
Element 100 MSW
Element 101 LSW
Element 101 MSW
---
Element 998 LSW
Element 998 MSW
Element 999 LSW
Element 999 MSW
Element 100
Element 101
---
Element 998
Element 999
LSW – Least Significant Word : MSW – Most Significant Word
The Mint Comms array provides 99 elements (1-99). If the client attempts to access Comms element 0 or Comms elements greater than 99 the Mint controller will return the ‘Invalid Data Address’ Modbus exception packet.
The Mint Netdata array (not supported on ES / ESB-2 products) provides 1000 elements (0-999). If the client attempts to access
Netdata elements greater than 999 the Mint controller will return the ‘Invalid Data Address’ Modbus exception packet.
Example Mint Code
The following code snippets show typical Mint code that may be included in a NextMove or ES/ESB-2 controller Startup block:
Example Mint code – Mint Modbus RTU slave (e.g. NextMove ESB-2) connected to AC500 or CP600 using Comms array
BUSNODE(_busSERIAL1) = 2 ‘Mint controller is node 2 on RTU network
SERIALBAUD(_Term1) = 57600 ‘Running at 57.6kbaud
ModbusParameter (_busSERIAL1, _mpBYTE_ORDER) = 0 ‘Use big endian byte order
ModbusParameter (_busSERIAL1, _mpWORD_ORDER) = 0 ‘Use big endian word order
ModbusParameter (_busSERIAL1, _mpREGISTER_MAPPING) = _rmCOMMS_ARRAY
ModbusParameter (_busSERIAL1, _mpENABLE) = 1
Example Mint code – Mint Modbus TCP slave (e.g. MicroFlex e100) connected to AC500 or CP600 using Netdata array
ModbusParameter (_busETHERNET, _mpBYTE_ORDER) = 0 ‘Use big endian byte order
ModbusParameter (_busETHERNET, _mpWORD_ORDER) = 0 ‘Use big endian word order
ModbusParameter (_busETHERNET, _mpREGISTER_MAPPING) = _rmNET_DATA
ModbusParameter (_busETHERNET, _mpENABLE) = 1
ABB Motion control products www.abb.com/motion
3
Application note Integrated Modbus support AN00198-003
Example Mint code – Mint Modbus RTU slave (e.g. NextMove ESB-2) connected to third party Modbus client using little endian word order and Netdata
BUSNODE(_busSERIAL1) = 4 ‘Mint controller is node 4 on RTU network
SERIALBAUD(_Term1) = 38400 ‘Running at 38.4kbaud
ModbusParameter (_busSERIAL1, _mpBYTE_ORDER) = 0 ‘Use big endian byte order
ModbusParameter (_busSERIAL1, _mpWORD_ORDER) = 1 ‘Use little endian word order
ModbusParameter (_busSERIAL1, _mpREGISTER_MAPPING) = _rmNET_DATA
ModbusParameter (_busSERIAL1, _mpENABLE) = 1
For controllers / drives supporting both Ethernet and serial channels (e.g. NextMove e100, MicroFlex e100) it is possible to configure
/ enable Modbus TCP operation on Ethernet and at the same time configure / enable Modbus RTU operation on the serial port.
Mint Events
Mint events operate differently depending on the controller being used:
NextMove ES/ESB-2: Comms events will be raised whenever the Modbus client writes to Comms locations 1 to 5 (i.e. data does not necessarily have to change for an event to be raised).
e100 products: Comms events will be raised whenever the Modbus client writes
modified
data to Comms locations 1 to 10 (i.e.
data must change for an event to be raised). Netdata events operate in the same manner and will only be raised whenever the
Modbus client writes modified data to Netinteger / Netfloat locations 0 to 31.
Physical Connection
The table below shows the physical connection possibilities for NextMove and e100 products supporting integrated Modbus protocols. AC500 and CP600 products are included for reference.
RS232
Type NextMove NextMove MicroFlex
Yes Yes (by variant) No Yes
2 wire RS485
4 wire RS422
Ethernet
No
Yes
Yes
No
Yes (by variant)
No
Yes
No
Yes
Yes
No
Yes
No
Yes
No
CP600
Yes
Yes
Yes
Yes
When using 2-wire RS485 be sure to include 120 ohm terminating resistors between data lines A and B at each end of the network to avoid data corruption.
When using 4-wire RS422 be sure to include 120 ohm terminating resistors between RX+ and RX- at each end of the network to avoid data corruption.
When using Modbus TCP / Ethernet, wire the network in a ‘star’ type configuration using an Ethernet switch between the client and the connected server(s). Straight-through or crossover cables may be used between the e100 device and the switch. If the e100 product is part of an Ethernet Powerlink (EPL) network then it is also necessary to include an EPL Router (Catalog No. OPT-EPLR-
001) between the switch and the e100 device.
Important
: AC500 and CP600 products use a non-standard RS232 pinout so be sure to check the relevant product manual before connecting other serial devices to these products. Failure to observe the correct pinout may result in damage to the connected device.
Diagnostics
The ModbusParameter keyword provides two types of diagnostics.
1. Reading ModbusParameter (bus, _mpDROPPED_FRAMES) will return a counter indicating how many Modbus packets have been rejected (e.g. invalid checksum, incomplete message……in summary, any message for which neither a valid nor exception response has been generated)
2. Writing a terminal channel value to ModbusParameter (bus, _mpDEBUG) will reset diagnostic counters and setup which terminal channel is to be used to display diagnostic information. Reading ModbusParameter (bus, _mpDEBUG) will then return which terminal channel is being used for diagnostics and will display some summary information on the selected terminal channel (e.g. last packet received, last packet transmitted, error counters etc..)
ABB Motion control products www.abb.com/motion
4
Application note Integrated Modbus support AN00198-003
Example:
ModbusParameter (_busETHERNET, _mpDEBUG) = _Term2
? ModbusParameter (_busETHERNET, _mpDEBUG)
If these commands were entered on a NextMove e100 the controller would display diagnostic information about Modbus TCP on the USB terminal (i.e. Workbench terminal window).
Example debug output:
Valid: 2
Dropped: 0. Exception: NO_EXCEPTION
Rx: 8 bytes
Node: 2 Fn code (hex): 03
Data (hex): 00 02 00 01
CRC (hex): f9 25
Tx: 7 bytes
Node: 2 Fn code (hex): 03
Data (hex): 02 00 00
CRC (hex): 44 fc
Note: Due to issues with the UART when using the 2 wire RS485 port on MicroFlex e100, every time the drive responds to a
Modbus frame an additional null character is received internally. This is then interpreted as a dropped frame (invalid length) and the diagnostic information will reflect this. It is therefore recommended to only use the debug parameter for RS232 and Ethernet connections.
MicroFlex e150 and MotiFlex e180 Modbus functionality
These products are capable of operating as Modbus clients and/or servers. MicroFlex e150 supports Modbus RTU (server only) and/or Modbus TCP (client and/or server) operation, MotiFlex e180 does not have a serial port so only supports Modbus TCP (client and/or server).
Support is provided for the following Modbus server functions:
· 03 – Read holding registers
· 04 – Read input registers
· 06 – Preset single register
·
16 – Preset multiple registers
·
23 – Read / write 4x registers
Support is provided for the following Modbus client functions:
·
03 – Read holding registers
· 04 – Read input registers
· 16 – Preset multiple registers
Modbus client operation is configured via the ‘Configuration’ screens within Mint Workbench and supported by the Mint keywords…
·
MODBUSTCP16
·
MODBUSTCP32
The configuration process allows the user to define whether Modbus function code 03 or 04 is used by the client when reading data from another Modbus TCP device. The Modbus TCP client always uses function code 16 to write to Modbus data on a connected server device (even when accessing a single register).
ABB Motion control products www.abb.com/motion
5
Application note Integrated Modbus support AN00198-003
Configuration
All Modbus configuration for the e150 and e180 products is performed via the ‘Configuration’ screens within Mint Workbench (these configuration settings can be saved as part of a controller archive to be transferred to another drive if necessary). Once online to the drive click on the ‘Configuration’ button in the Workbench Toolbox to display this work area. Note that for this screen to operate correctly the e150/e180 must have been ‘Discovered’ via the Mint HTTP server (please refer to the e150 or e180 Installation Manual for further details about the operation of the Mint HTTP server and the use of ‘Discovery’ to automatically scan and detect these devices).
Once the Configuration page has opened click on ‘Serial’ to configure the serial port operation for Modbus RTU server (MicroFlex e150 only)….
Ensure the ‘Protocol’ selection is set to ‘Modbus RTU’ and configure the other serial port settings to suit the connected devices.
Click on the ‘Apply’ button at the bottom of the screen to make these changes.
Click on ‘Network’ to configure the drive’s IP address (Modbus TCP uses the ‘Host port’ connection on the drive which is numbered E1 when using a MicroFlex e150 or E3 when using a MotiFlex e180)…
The Gateway address must be on the same subnet as the drive (e.g. if the drive is 192.168.0.1 then the Gateway must be
192.168.0.x where x is often just set to an unused address).
Click on the ‘Apply’ button at the bottom of the screen to make any changes.
Click on ‘Modbus TCP Server’ to configure server operation…
ABB Motion control products www.abb.com/motion
6
Application note Integrated Modbus support AN00198-003
Check boxes are provided to enable/disable server operation (enabled by default) and to configure the byte and word order of the
Modbus data (set to Big Endian by default for compatibility with other ABB products supporting Modbus TCP operation). The standard Modbus port number is 502, but this can be changed if required to suit third party products using a custom port number.
Click on the ‘Apply’ button at the bottom of the screen to make any changes.
Click on ‘Modbus TCP Client’ to configure a list of connected server devices…
Initially the list of connected devices is empty, so click on the ‘+’ button to add a remote (server) device. The Workbench will automatically add some default values as shown below…
These settings can be edited to suit the configuration of the connected Modbus TCP server devices. It is important to note the
‘Server ID’ associated with the remote device – this is automatically allocated and is one of the parameters used by the
MODBUSTCPxx Mint keywords to read/write data on the server device (so for example, if Server ID 0 relates to 192.168.0.1 as shown above, we would use MODBUSTCP32(0,0) to access Netdata 0 on a MicroFlex e150 or MotiFlex e180 configured with IP address 192.168.0.1 and connected to the client drive). The list below the + and – buttons is ordered in Server ID order (with 0 at the top).
ABB Motion control products www.abb.com/motion
7
Application note
ABB Motion control products www.abb.com/motion
Integrated Modbus support AN00198-003
Note that all devices on the TCP network must have unique IP addresses (so if one of the server devices is 192.168.0.1 this address cannot be used in the ‘Network’ settings for the client drive).
Click on the ‘Apply’ button at the bottom of the screen to make any changes.
Register Mappings
All supported Modbus server functions target the ‘Netdata’ area in the e150/e180 drives. This data area has a fixed mapping with respect to how it appears to a client device as Modbus registers as shown by the table below (equivalent AC500 addresses are also shown for reference):
Server Modbus register
0
1
4
5
2
3
…
198
199
200
201
202
203
AC500 address
%MW0.0
%MW0.1
%MW0.2
%MW0.3
%MW0.4
%MW0.5
---
%MW0.198
%MW0.199
%MW0.200
%MW0.201
%MW0.202
%MW0.203
… ---
1996 %MW0.1996
1997 %MW0.1997
1998 %MW0.1998
1999 %MW0.1999
%MD0.0
%MD0.1
%MD0.2
---
%MD0.99
%MD0.100
%MD0.101
---
%MD0.998
%MD0.999
Mint Netdata array
(Netfloat = Real, Netinteger = DWord)
Element 0 LSW
Element 0 MSW
Element 0
Element 1 LSW
Element 1 MSW
Element 2 LSW
Element 2 MSW
Element 1
Element 2
-----
Element 99 LSW
Element 99 MSW
Element 100 LSW
Element 100 MSW
Element 101 LSW
Element 101 MSW
Element 99
Element 100
Element 101
-----
Element 998 LSW
Element 998 MSW
Element 999 LSW
Element 999 MSW
Element 998
Element 999
LSW – Least Significant Word : MSW – Most Significant Word
The Mint Netdata array provides 1000 elements (0-999). If the client attempts to access Netdata elements greater than 999 the e150/e180 will return the ‘Invalid Data Address’ Modbus exception packet.
Example Mint Code
For operation as a Modbus server (RTU or TCP) no Mint code is required. The client device will access Netdata via the Modbus register mappings detailed in the previous section.
For operation as a Modbus TCP client the Mint keywords MODBUSTCP16 (to access a single 16 bit Modbus register) and
MODBUSTCP32 (to access a pair of 16 bit Modbus registers) are used.
Example 1:
Client e180 wishes to take data from a local integer variable and write this to Netinteger(3) on a MicroFlex e150 via Modbus TCP.
The MicroFlex e150 has IP address 192.168.0.11 and is configured as Server ID 4 in the list of connected devices…
Dim nValue As Integer
MODBUSTCP32 (4, 6) = nValue
Example 2:
Client e180 wishes to read data from a remote NETFLOAT location 2 on another MotiFlex e180 via Modbus TCP. The MotiFlex e180 has IP address 192.168.0.2 and is configured as Server ID 1 in the list of connected devices…
Dim fValue As Float
NETINTEGER(999) = MODBUSTCP32 (1, 4) fValue = NETFLOAT(999)
8
Application note Integrated Modbus support AN00198-003
Because all Modbus data is transferred as an integer note the use of a local (unused) Netdata location (999) in this example to perform the “conversion” between a 32 bit integer representation of the floating point value (IEEE format) and the actual floating point value stored in the variable ‘fValue’
Example 3:
Client e150 wishes to write an integer value of 3 to a remote Modbus register (location 0x3B00) on a vision system supporting operation as a Modbus TCP server. The vision system has IP address 192.168.0.3 and is configured as Server ID 2 in the list of connected devices…
MODBUSTCP16 (2, 0x3B00) = Int16(0x0003)
Function Int16(ByVal a As Integer) As Integer
Int16 = IIf(a > 0x7FFF, a - 0x10000, a)
End Function
Note the use of the custom Int16 function written in Mint to ensure the correct representation of signed 16 bit data.
Mint Events
When the e150 or e180 drive is operating as a Modbus server (RTU or TCP) Netdata events will only be raised whenever the
Modbus client writes
modified
data to Netinteger / Netfloat locations 0 to 31.
Physical Connection
The table below shows the physical connection possibilities for MicroFlex e150 and MotiFlex e180 drive products supporting integrated Modbus protocols. AC500 and CP600 products are included for reference.
RS232
2 wire RS485
4 wire RS422
Ethernet
No
Yes e150 MotiFlex AC500
No
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
No
CP600
Yes
Yes
Yes
Yes
When using 2-wire RS485 be sure to include 120 ohm terminating resistors between data lines A and B at each end of the network to avoid data corruption.
When using 4-wire RS422 be sure to include 120 ohm terminating resistors between RX+ and RX- at each end of the network to avoid data corruption.
When using Modbus TCP / Ethernet, wire the network in a ‘star’ type configuration using an Ethernet switch between the client and the connected server(s). Straight-through or crossover cables may be used between the devices and the switch.
Important
: AC500 and CP600 products use a non-standard RS232 pinout so be sure to check the relevant product manual before connecting other serial devices to these products. Failure to observe the correct pinout may result in damage to the connected device.
ABB Motion control products www.abb.com/motion
9
Application note Integrated Modbus support AN00198-003
Diagnostics
The web page built into the MicroFlex e150 and MotiFlex e180 drive products contains diagnostic information about Modbus TCP operation. Right click the Mint HTTP server tray application icon and select ‘Properties’. From this dialog click the web link shown to open your default web browser and display a list of connected e150/e180 devices…
Click on the yellow button relating to the drive you wish to examine and then click the ‘Home’ button…
From the Home page you can now select from ‘Modbus TCP Server’ or ‘Modbus TCP Client’ to access the available diagnostics…
The server diagnostics page displays the current configuration and counters showing the number of successful and unsuccessful
Modbus TCP transactions (and also shows how many transactions of each Modbus function code type have been actioned).
ABB Motion control products www.abb.com/motion
10
Application note Integrated Modbus support AN00198-003
The client diagnostics page lets the user initiate a ‘Read holding registers’ Modbus TCP function (function code 03). Diagnostics about the transaction are displayed after clicking the ‘Send’ button. This allows the user to test basic Modbus TCP operation without the need to write any Mint code…
For Modbus RTU diagnostics (MicroFlex e150 only, as MotiFlex e180 does not have a serial port), select ‘Log Channel’ from the
‘Home’ menu in the web pages and then click the Enable button to turn on logging of Modbus RTU frames….
ABB Motion control products www.abb.com/motion
11
Application note Integrated Modbus support AN00198-003
Once Modbus RTU logging is enabled the Workbench trace window (enabled by right clicking the terminal window and selecting
‘Trace mode’) and the Log page of the web pages will display detailed diagnostic information about the incoming and outgoing
Modbus RTU frames…
Contact us
For more information please contact your local ABB representative or one of the following: www.abb.com/motion www.abb.com/drives www.abb.com/drivespartners www.abb.com/PLC
ABB Motion control products www.abb.com/motion
12
© Copyright 2016 ABB. All rights reserved.
Specifications subject to change without notice.

Download
Advertisement
Key features
- Supports Modbus RTU/TCP
- Works with third party devices
- Operates as Modbus server
- Integrated Modbus support
- Simple integration with any Modbus device
- Connects to AC500 PLCs and CP600 HMIs
- Supports various baud rates
- Customizable byte and word order
- Diagnostic information available
- Configuration via Mint keywords or Workbench