Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Modbus AB World v01

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Handling Modbus in an AB World

Lynn A Linse Principal Engineer

Linking Modbus and AB


Multiple ways to do on the market
AB PLC with Modbus driver Add PLC rack card with Modbus Use virtual PLC supporting 2 protocols Digi One IAPs Protocol Irrelevance

Cover the Pros and Cons of each Demonstrate Digi One IAPs approach

Modbus Staying Power


Modbus has been around for over 25 years; is older than other common protocols Modbus prospers because:
Drivers can be written literally in a few hours; complex modern protocols like Ethernet/IP, ProfiNET, or IDA require months to write Modbus forces no specific design on data Massive list of interoperable products Easy to emulate in BASIC and hard-code into PLC downloadable code modules

AB PLC with Serial Modbus


MicroLogix 1100, 1200 & 1500 support Modbus driver directly DF1 is disabled

AB PLC with Serial Modbus


Pro
Is Free; nothing extra to buy maybe

Con
Locks out RSLinx & RSLogix access Must reboot PLC to re-enable Rockwell protocol access temporarily May cause you to buy-up to a 2-port model to avoid loss of RSLinx support

AB PLC with Rack Card


Add Modbus serial or Ethernet port to AB PLC Rack Allows concurrent Modbus and Rockwell access

AB PLC with Rack Card


Pros
Well established paradigm; it works

Cons
High cost due to custom hardware, custom engineering and limited volumes PLC program must change Consumes rack slot and backplane power Requires 2nd Ethernet cable and resource Result is not transparent; Polling a Modbus register tells nothing about AB data it represents

Virtual PLC Solution


Magic Box
Modbus on one side AB on the other

Limited or no direct Rockwell protocol access allowed

Virtual PLC Solution


Pros
Cost likely lower than rack card Well established paradigm Cache behavior for multiple masters Unlimited ability to massage & rearrange data Requires explicit configuration to define mapping Future configuration changes hard to detect by old masters Detecting slave failure requires reading special registers Blocks RSLinx/RSLogix access to AB PLC serial port

Cons

Digi Protocol Irrelevance


Modbus requests are handled using appropriate Modbus or AB slave protocols AB requests are handled using appropriate Modbus or AB slave protocols

Digi Protocol Irrelevance


Radical new approach. Is transaction oriented.
Digi One IAP has no concept of data and no retained data memory. Each request received creates one transaction to the slave with the appropriate protocol and values.

Network or serial masters can query any mix of network or serial slaves.

Traditional AB Bridging
Ethernet/IP querying AB/DF1 with DOIAP
Ethernet/IP request is received. Bridge examines request details (connection path) to learn which slave this request targets. Bridge extracts the core PCCC request this is the SLC5 or PLC5 style read/write command. Bridge rewraps PCCC as CSPv4 or DF1 request. When response is received, Bridge reverses the process to reconstruct Ethernet/IP response.

Bridge works because both Master & Slave understand the PCCC message structure.

Traditional Modbus Bridging


Modbus/TCP querying Modbus/RTU with DOIAP
Modbus/TCP request is received. Bridge examines request details (Unit Id) to learn which slave this request targets. Bridge extracts the core Modbus ADU this is the read/write holding registers and other commands. Bridge rewraps Modbus ADU as Modbus/RTU. When response is received, Bridge reverses the process to reconstruct Modbus/TCP response.

Bridge works because both Master & Slave understand the Modbus ADU structure.

AB reading Modbus
Ethernet/IP querying Modbus/RTU
Ethernet/IP request is received. DOIAP examines request details (connection path) to learn which slave this request targets. DOIAP extracts the core PCCC request this is the SLC5 or PLC5 style read/write command. DOIAP detects slave does NOT understand PCCC. DOIAP examines PCCC; breaks down request
Commands reduced to (example) read twenty words Addresses such as N7:20 or N50:0 are converted by formula to a virtual offset 20 and 4000 respectively

AB reading Modbus (cont)


Ethernet/IP querying Modbus/RTU (cont)
DOIAP queues generic request for Modbus slave driver.
Example: read twenty 16-bit words starting at offset 4000

Modbus driver opens request


Detects that it is NOT Modbus ADU Generates Modbus ADU with same meaning Example: becomes function 3 read starting at 4x04001

Modbus driver sends Modbus request to Slave When response is received, DOIAP reverses the process:
Convert Modbus response into generic 20 word data response Convert generic 20 word data response to PCCC Returns PCCC to Ethernet/IP master

AB reading Modbus
What did we accomplish?
ControlLogix thinks it is reading 20 elements starting at N50:0 from a SLC5 or MicroLogix Modbus slave thinks it is being polled for 20 registers with Function 3 starting at 4x04001

DOIAP does this conversion mechanically without explicit configuration Any Modbus data can be accessed given the appropriate SLC5/MicroLogix notation
N11:74 accesses register 4x00175 B10:14/6 accesses coil 0x00231 Excel spreadsheet shows correct AB notation, given Modbus

Digi Doc: 90000652.xls

User Documentation
AB N10:0 N10:1 N10:2 N10:3 N10:3/0 N10:3/1 N10:3/2 N10:3/3 N10:3/4 N10:4 N10:5 N10:6 N10:7 N10:8 Modbus 4x0001 4x0002 4x0003 4x0004 Mode Rd Rd Rd/Wr Rd/Wr Desc Drive Horsepower Software version Parameter Lock Run Commands bit 1: Stop / Brake bit 2: Forward Run bit 3: Reverse Run bit 4: Fault Reset bit 5: Coast to Stop Current Frequency Voltage Output Power Speed Values In HP (ie: 15 = 15hp) BCD like 0101 0/disable, 1/enable Only 1 bit may be set per write, or the write is ignored. Read back shows current status. By 0.1A By 0.01 Hz volts Watts RPM

4x0005 4x0006 4x0007 4x0008 4x0009

Rd Rd Rd Rd Rd

Modbus reading AB
Modbus/TCP querying DF1 Full-Duplex
Modbus/TCP request is received. DOIAP examines request details (Unit Id) to learn which slave this request targets. DOIAP extracts the Modbus ADU. DOIAP detects slave does NOT understand Modbus ADU. DOIAP examines Modbus; breaks down request
For example: read twenty 16-bit words Addresses such as 4x00175 or 4x04001 are converted by formula to a virtual offset 174 and 4000 respectively

Modbus reading AB (cont)


Modbus/TCP querying DF1 Full-Duplex (cont)
DOIAP queues generic request for DF1 Full-Duplex driver.
Example: read twenty 16-bit words starting at offset 12500

DF1 Full-Duplex driver opens request


Detects that it is NOT PCCC Attempts to generate PCCC with same meaning Example: becomes SLC5 read starting at N50:0

DF1 driver sends DF1 request to Slave When response is received, DOIAP reverses the process:
Convert PCCC response into generic 20 word data response Convert generic 20 word data response to Modbus

DOIAP returns Modbus to Modbus/TCP master

Modbus reading AB
What did we accomplish?
Modbus/TCP master thinks it is polling 20 registers with Function 3 starting at 4x12501 Micrologix thinks it is being asked for 20 elements starting at N50:0 from another Rockwell PLC or application

DOIAP does this conversion mechanically without explicit configuration Any PCCC data can be accessed given the appropriate Modbus notation
4x02825 accesses integer N11:74 0x08231 accesses bit B10:14/6 Excel spreadsheet shows correct Modbus notation, given AB

Digi Doc: 90000653.xls

AB/Modbus Data Details


The Rockwell polling Modbus formulas are different than Modbus polling Rockwell 16-bit words - AB to/from Modicon PLC
DOIAP swaps bytes DOIAP must not swap bytes Due to limitations in first 9 files: for example N2 & B6 are not legal AB notation

1-bit packed as words - AB to/from Modicon PLC 32-bit long/float AB to/from Modicon PLC Even though Modbus is Big-Endian, Modicon PLC use x86 chips and are native Little-Endian All AB special files (status, counters, etc) are converted to Modbus words as-is users must read AB docs to understand
DOIAP swaps bytes, but not the words

Digi One IAP solution


Pros
No data configuration required or allowed What works today; works next year Slave failure detected by failure to respond 100% transparent pass-thru of native protocols Concurrent access by Rockwell and Modbus One firmware does all conversions

Cons

No ability to rearrange or tweak data No cache behavior every request creates a new transaction

One Firmware does All


Serial, TCP/IP and UDP/IP supported for most

One Firmware does All


Example Applications:
AB PLC polling Modbus slaves Old PLC5E using Ethernet to poll ControlLogix ControlLogix and Modbus/TCP acting as peers Old AB/Ethernet (CSPv4) software polling ControlLogix Polling single-port Micrologix as both Modbus/TCP and DF1 slave concurrently Ethernet-enabling SLC5/03 or 04

Support Documentation

Support Documentation
Relevant Documentation at www.digi.com 90000643_a.pdf (Acrobat) 90000652_A.xls (Excel)
Calculator; Rockwell Master App Note; Rockwell polling Modbus

90000647_B.pdf (Acrobat) 90000653_B.xls (Excel)


Calculator; Modbus Master

App Note; Modbus polling Rockwell

Digi One IAP


Full Feature Model 10/100 HD/FD Ethernet 1 or 2 serial ports RS-232/422/485 10-30vdc Power Supply 2kv isolation between power and serial Div 1 Class II Protocols: Modbus, Rockwell, Omron, ASCII, user-defined Fall-2006:

400-watt TVS diodes Optional 802.3af PowerOver-Ethernet

Digi One IA
Industrial single-port model 10/100 HD/FD Ethernet 1 serial port RS-232/422/485 10-30vdc Power Supply 2kv isolation between power and serial Div 1 Class II Protocols: Raw or Limited Modbus Bridge (matches Modicon CEV specs) 400-watt TVS diodes (fall2006)

Digi One SP-IA


Lowest Cost DIN-rail 10/100 HD/FD Ethernet 1 serial port RS-232/422/485 10-30vdc Power Supply No DC supply isolation Raw access only; no special protocols Office-grade surge protection

Digi Connect WiSP


802.11b WiFi 1 serial port RS-232/422/485 10-30vdc Power Supply No DC supply isolation Raw access only; no special protocols Office-grade surge protection Optional DIN-rail bracket

You might also like