Wed. Dec 1st, 2021

Introduction

This doc describes the applying and use of the Modbus TCP Client Add-On Instruction.


Modbus TCP Client Add-On Instruction (AOI) permits customers to implement Modbus TCP Client performance into the Logix household of controllers. AOIs can be utilized standalone or may be added to an present utility following the instructions outlined beneath.

                                     

Requirements

Hardware Requirements

 

Software Requirements

The Modbus TCP Client AOI code helps Logix controller revisions 20 and increased.

 

Memory Requirements

First occasion of the Modbus TCP Client AOI makes use of about 93 Kbytes of reminiscence. Each extra AOI occasion requires about 20 Kbytes of reminiscence. These estimates based mostly on the ControlLogix 5570 household of controllers. Please word some Compactlogix controllers have a beginning reminiscence dimension as little as 384Kbytes. This code can take a big quantity of reminiscence in smaller CompactLogix controllers.

 

Functional Requirements and Description

Supported Modbus Function Codes

Bit Level Commands

 

Function

Code

Name

Description

Supported

Values

Modbus Range

01

Read Coils

This operate code is used to learn contiguous standing of coils in a
distant system (0xxxx addresses). The coils within the response message are packed
as one coil per little bit of the info subject.

Local Address: 0 to 1023

Server Address: 0 to 9999

Length:

1 to 256 coils

Local Address
00001-01024

Server Address 00001-09999

02

Read Discrete Inputs

This operate code is used to learn contiguous standing of discrete
inputs in a distant system (1xxxx addresses).

The inputs within the response message are packed as one
coil per little bit of the info subject.

Local Address: 0 to 1023

Server Address: 0 to 9999

Length:

1 to 256 Inputs

Local Address
10001-11024

Server Address 10001-19999

05

Write Single Coil

This operate code is used to jot down a single coil to both ON or
OFF in a distant system (0xxxx addresses).

Local Address: 0 to 1023

Server Address: 0 to 9999

Local Address
00001-01024

Server Address 00001-09999

15

Write Multiple Coils

This operate code is used to jot down to a number of coils in a
sequence of coils to both ON or OFF in a distant system (0xxxx addresses).

Local Address: 0 to 1023

Server Address: 0 to 9999

Length:

1 to 256 coils

Local Address
00001-01024

Server Address 00001-09999

 

Word Level Commands

 

Function

Code

Name

Description

Supported

Values

Modbus Range

03

Read Holding Registers

This operate code is used to learn the contents of a contiguous
block of holding registers (4xxxx addresses) in a distant system.

Local
Address: 0 to 1023

Server Address: 0 to 9999

Length:

1 to 120 registers

Local Address 40001-

41024

Server Address 40001-49999

04

Read Input Registers

This operate code is used to learn the contents of a contiguous
block of enter registers (3xxxx addresses) in a distant system.

Local
Address: 0 to 1023

Server Address: 0 to 9999

Length: 1 to 120

enter registers

Local Address 30001-

31024

Server
Address 30001-39999

06

Write a Single
Holding Register

This operate code is used to jot down to single holding register
(4xxxx addresses) in a distant system

Local Address: 0 to 1023

Server Address: 0 to 9999

Local Address 40001-

41024

Server Address 40001-49999

16

Write Multiple Holding Registers

This operate code is used to jot down to contiguous holding
registers (4xxxx addresses) in a distant system.

Local
Address: 0 to 1023

Server Address: 0 to 9999

Length:

1 to 120
registers

Local Address 40001-

41024

Server
Address 40001-49999

 

Implementation

 

Modbus TCP Client AOI implementation

Using Periodic Task

It’s really helpful so as to add AOIs right into a Periodic job with Rate of 10ms (or increased). Slower charges will cut back controller load and cut back efficiency. Faster job charges will enhance efficiency however will add a big load to the controller.

Rung Import and tag naming modifications

The pre-configured Add-On Instructions are provided in a Rung format.


The Rung Import format should be used to implement the AOI.

Important: Use solely the Rung Import course of. Do not use Copy/Paste performance or add these AOIs utilizing Instructions device bar. Doing it will take away configurations from pre-configured message directions, making AOIs non-functional.

Rung Import course of for Modbus TCP Client AOI

1. Open a Ladder Routine inside your utility
2. Right click on on any empty space and choose Import Rungs

                                             

3. Select raC_Opr_NetModbusTCPClient_Rung.L5X file and click on Import

                                         

4. When Import Configuration Dialog opens, choose Tags

                                            

5. You can depart ultimate names as-is or change them to accommodate your utility.

                       

6. To change Final Names click on Find/Replace button

                                                                  

When Dialog opens, substitute default identify Client_01 with desired prefix, confirm that Final Names Box is checked then click on Replace All Close 

                             

Close Find/Replace dialog and confirm Final Names

                                                            

7. Click Ok to complete the Import course of The new rung ought to appear to be proven beneath with none errors 

               

8. Repeat Steps 2-7 if utility requires extra Clients. DO NOT Copy/Paste.

 

Configure Local Operational Parameters


Modbus TCP Client requires a neighborhood EtherNet/IP module that helps Logix Sockets.

In this part we’ll hyperlink Modbus TCP Client AOI to this EtherNet/IP module.


1. Right Click on the tag hooked up to the Ref_Connection parameter and choose Monitor “…”

                   

2. Expand Parameters tag. Specify the slot of the Local EtherNet/IP module.

                   

For 1756 ControlLogix processors specify the precise slot of desired 1756-EN2T(R) module. For 1756-L8xE controllers utilizing the in-built Ethernet port specify the 1756-L8xE controller slot. For CompactLogix 5370, 5380, 5480 controllers depart .LocalSlot at 0.

3. Specify the .LocalAddress of the EtherNet/IP module.

                     

For CompactLogix 5380 and 5480 in Dual IP Mode solely, specify the IP Address of the Local Ethernet connection used for Modbus TCP communications. Leave this subject clean for all different instances.


4. Specify Ethernet IP Address of the Modbus Server system. This tackle should be specified and can’t stay clean.

                     

5. Leave Default Modbus TCP port at 502. This worth is Modbus TCP protocol normal.
6. If you alter any of those Parameters throughout operation remember to reset and then set the AOI Inp_Enable parameter tag.

Configure Data Transactions

1. Expand Transactions tags to reveal Transaction 0 member tags

             

2. Set Polling Interval worth in milliseconds.
Default worth is 1000 (1 second). Minimum worth is 80 msec. Any transaction with polling fee beneath 80ms will probably be polled at 1 second fee

            

3. Set Modbus Function code in TransType tag. See Supported Modbus Function Codes part for the checklist of supported instructions.

              

4. Set StartAddress tag. The worth represents the start tackle in distant system (Modbus TCP Server) to learn from or write to. Depending on the operate used above, values 0…9998 characterize Modbus addresses 00001-09999, 10001-19999, 30001-39999, 40001-49999 respectively.

              

5. Set Count tag. The worth represents the variety of objects in distant system (Modbus TCP Server) to learn from or write to.

            

6. Set LocalAddress tag. The worth represents the start tackle on this applications’ “_Data” arrays.

                                                   
                    

7. Start Modbus TCP Client by setting tag hooked up to Inp_Enable parameter to 1.

                                   

Implementation Restrictions

1. Implementation should be carried out utilizing Import Rung operate solely to protect Message instruction configurations. Do not use Copy/Paste because it is not going to carry full Message instruction configurations and tags. Do not use Search/Replace tags as soon as rung is applied. All alternative may be carried out solely throughout rung import.


2. Multiple cases of Client AOI are supported per controller. Each occasion should use personal set of backing and Message tags, nevertheless “…_Data” tag construction may be shared between AOIs.


3. Modbus TCP Server and Modbus TCP Client AOIs can reside in the identical program. However Server functions could trigger a short lived Client disconnection because of the shared Logix Sockets object.

Monitoring Modbus TCP Server operations

 1. Modbus Tags are positioned underneath Ref_ModbusData parameter tag.

                                       

This tag accommodates 4 separate information areas for coils (0xxxx), discrete inputs (1xxxx), enter registers (3xxxx) and holding registers (4xxxx). These tag values may be learn and populated by the consumer utility with none restrictions.

                                   

2. Modbus TCP AOI Status Bits

                               
  • Sts_EN output signifies that Modbus TCP Client performance is enabled.
  • Sts_Connected output signifies that Client connection request was accepted by the Server. It doesn’t point out the energetic information circulate. The standing of particular person transactions ought to be checked to confirm the info change.
  • Sts_Faulted output signifies that one of many message directions is faulted.
  • Sts_Overlap output signifies that a number of transaction just isn’t finishing earlier than subsequent set off
  • Sts_Overload output signifies extreme Overlaps in a number of transactions.

3. Individual Transaction standing
info. These tags exist for every of the 5 in-built transactions.
Transaction 0-4).

TransComplete bit is about
when requested transaction was accomplished. It’s cleared by the

program when
subsequent transaction is requested.

TransStatus worth signifies the present standing of transaction. 0 = success, 1 =
in course of, 2 = retry, -1 = exception

                                      

4. Transaction Diagnostic information construction supplies inside dynamic info whereas the transaction is energetic. Do not write to those tags.

      

Performance information

 Modbus Client efficiency may be affected by many elements together with: periodic job fee, efficiency of the Server system, pace of Client controller, how busy the Client controller is, community efficiency, community card, variety of Clients within the controller, the variety of energetic transactions and so forth.


Below are typical efficiency expectations when utilizing an L7x Controller with a 10ms periodic job:

Number of
Transaction Enabled

Recommended Minimum

BallotInterval for all Transactions

1

80 mS

2

130 mS

3

220 mS

4

300 mS

5

380 mS

When utilizing the really helpful BallotInterval settings or better, you may anticipate the precise information
supply to be very near the BallotInterval.

NOTE:

If chosen BallotInterval settings
are marginally too quick you’ll doubtless see occasional Sts_Overlap errors and your system ought to work moderately properly.

If chosen BallotInterval settings
are extraordinarily out of line, you will note each Sts_Overlap and Sts_Overload
errors and your system is not going to work reliably. If you’re getting Sts_Overload errors, you could make
changes to your BallotInterval settings.

 

  Sample AOI Download

 Credits to RockwellAutomation

.

By admin