0% found this document useful (0 votes)
12 views

Modicon Libraries General Purpose Communication Components User Guide

Uploaded by

Joe
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)
12 views

Modicon Libraries General Purpose Communication Components User Guide

Uploaded by

Joe
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/ 154

Modicon Libraries General Purpose

EIO0000002091 04/2020

Modicon Libraries General


Purpose
Communication Components User Guide
04/2020
EIO0000002091.09

www.schneider-electric.com
The information provided in this documentation contains general descriptions and/or technical
characteristics of the performance of the products contained herein. This documentation is not
intended as a substitute for and is not to be used for determining suitability or reliability of these
products for specific user applications. It is the duty of any such user or integrator to perform the
appropriate and complete risk analysis, evaluation and testing of the products with respect to the
relevant specific application or use thereof. Neither Schneider Electric nor any of its affiliates or
subsidiaries shall be responsible or liable for misuse of the information contained herein. If you
have any suggestions for improvements or amendments or have found errors in this publication,
please notify us.
You agree not to reproduce, other than for your own personal, noncommercial use, all or part of
this document on any medium whatsoever without permission of Schneider Electric, given in
writing. You also agree not to establish any hypertext links to this document or its content.
Schneider Electric does not grant any right or license for the personal and noncommercial use of
the document or its content, except for a non-exclusive license to consult it on an "as is" basis, at
your own risk. All other rights are reserved.
All pertinent state, regional, and local safety regulations must be observed when installing and
using this product. For reasons of safety and to help ensure compliance with documented system
data, only the manufacturer should perform repairs to components.
When devices are used for applications with technical safety requirements, the relevant
instructions must be followed.
Failure to use Schneider Electric software or approved software with our hardware products may
result in injury, harm, or improper operating results.
Failure to observe this information can result in injury or equipment damage.
© 2020 Schneider Electric. All rights reserved.

2 EIO0000002091 04/2020
Table of Contents

Safety Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Part I General Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Chapter 1 General Overview of Communication Components . . . . 15
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Chapter 2 General Overview of Communication DFBs . . . . . . . . . . 17
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Chapter 3 General Concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Logical Architecture – Communication . . . . . . . . . . . . . . . . . . . . . . . . 20
Communication Process Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Part II Modbus and Modbus TCP Ethernet Communication 23
Chapter 4 Client Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
DFB Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Inputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Inputs/Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Public Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Chapter 5 Port Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
DFB Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Inputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Inputs/Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Public Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Chapter 6 Scanner Profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
DFB Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Inputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Inputs/Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Public Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

EIO0000002091 04/2020 3
Chapter 7 ModBusGateway - Serial Modbus-Ethernet Gateway . . . 57
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
DFB Representation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Outputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Inputs/Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Public Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Part III Ethernet IP Communication . . . . . . . . . . . . . . . . . . . 67
Chapter 8 EthernetIPPortMxx - Ethernet IP Port Profile . . . . . . . 69
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
DFB Representation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Outputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Inputs/Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Chapter 9 EthernetIPClient - Ethernet IP Client Profile . . . . . . 77
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
DFB Representation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Outputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Inputs/Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Chapter 10 StatisticCounter1 - Statistic Counter Profile . . . . . . 85
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
DFB Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Outputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Part IV Profibus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Chapter 11 PRMMgt - PRM Management . . . . . . . . . . . . . . . . . . . . . . 93
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
DFB Representation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Outputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Inputs/Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Public Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

4 EIO0000002091 04/2020
Part V Diagnostic Information Management . . . . . . . . . . . . 101
Chapter 12 Diagnostic Information Management Codes. . . . . . . . . . 103
Description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Read_Var and Write_Var Diagnostic Codes. . . . . . . . . . . . . . . . . . 106
MBP_MSTR Diagnostic Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Client Parameter Diagnostic Codes . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Scanner Parameter Diagnostic Codes . . . . . . . . . . . . . . . . . . . . . . . . 113
EthernetIP Communication Diagnostic Codes . . . . . . . . . . . . . . . . . . 114
Part VI Communication Technologies. . . . . . . . . . . . . . . . . . 119
Chapter 13 Supported Architectures . . . . . . . . . . . . . . . . . . . . . . . . . 121
Device/Communication Port Architectures . . . . . . . . . . . . . . . . . . . . . 121
Chapter 14 Ethernet Technology. . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Ethernet Communication Architecture. . . . . . . . . . . . . . . . . . . . . . . . . 126
Addressing Example for the M340/M580 Platform . . . . . . . . . . . . . . . 128
Addressing Example for the Quantum Platform . . . . . . . . . . . . . . . . . 129
Chapter 15 Gateway Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Gateway Communication Architecture . . . . . . . . . . . . . . . . . . . . . . . . 132
Addressing Example for the M340/M580 Platform . . . . . . . . . . . . . . . 134
Addressing Example for the Quantum Platform . . . . . . . . . . . . . . . . . 136
Chapter 16 Modbus Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Modbus Communication Architecture . . . . . . . . . . . . . . . . . . . . . . . . . 140
Addressing Example for the Modicon M340/M580 Platform . . . . . . . . 141
Chapter 17 EthernetIP Technology . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Ethernet IP Communication Architecture . . . . . . . . . . . . . . . . . . . . . . 144
EIPPort Client Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Appendices ......................................... 149
Appendix A Editing the WorkMemory Array Size. . . . . . . . . . . . . . . . 151
....................................................... 151
Index ......................................... 153

EIO0000002091 04/2020 5
6 EIO0000002091 04/2020
Safety Information

Important Information

NOTICE
Read these instructions carefully, and look at the equipment to become familiar with the device
before trying to install, operate, service, or maintain it. The following special messages may appear
throughout this documentation or on the equipment to warn of potential hazards or to call attention
to information that clarifies or simplifies a procedure.

EIO0000002091 04/2020 7
PLEASE NOTE
Electrical equipment should be installed, operated, serviced, and maintained only by qualified
personnel. No responsibility is assumed by Schneider Electric for any consequences arising out of
the use of this material.
A qualified person is one who has skills and knowledge related to the construction and operation
of electrical equipment and its installation, and has received safety training to recognize and avoid
the hazards involved.

8 EIO0000002091 04/2020
About the Book

At a Glance

Document Scope
This document provides an operating information of a project developed by using Modicon
Libraries General Purpose.
This document does not cover any development procedures and internal functionality details.
Users of the Control Expert services are supposed to have a working knowledge in the
employment of Control Expert .

Validity Note
This document has been updated with the release of Modicon Libraries General Purpose 2020.
General Purpose Library of communication components support the following software versions of
Control Expert:
 Control Expert V14.0 and V14.1

This library is compatible with the following hardware platforms:


 Quantum
 M340
 M580

EIO0000002091 04/2020 9
Product Related Information

WARNING
LOSS OF CONTROL
 Perform a Failure Mode and Effects Analysis (FMEA) of your application, and apply preventive
and detective controls before implementation.
 Provide a fallback state for undesired control events or sequences.
 Provide separate or redundant control paths wherever required.
 Supply appropriate parameters, particularly for limits.
 Review the implications of transmission delays and take actions to mitigate.
 Review the implications of communication link interruptions and take actions to mitigate.
 Provide independent paths for control functions (for example, emergency stop, over-limit
conditions, and fault conditions) according to the safety analysis and applicable codes, and
regulations.
 Apply local accident prevention and safety regulations and guidelines. 1
 Test each implementation of this library for proper operation before placing it into service.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

1 For additional information, refer to NEMA ICS 1.1 (latest edition), Safety Guidelines for the

Application, Installation, and Maintenance of Solid State Control and to NEMA ICS 7.1 (latest
edition), Safety Standards for Construction and Guide for Selection, Installation and Operation of
Adjustable-Speed Drive Systems or their equivalent governing your particular location.
The application of this product requires expertise in the design and operation of control systems.

WARNING
UNINTENDED EQUIPMENT OPERATION
 Allow only authorized personnel with expertise in the design and operation of control systems
to program, install, alter, and apply this product.
 Follow local and national safety codes and standards.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

10 EIO0000002091 04/2020
Examples described in this manual are provided for information only.

WARNING
UNINTENDED EQUIPMENT OPERATION
Adapt examples that are given in this manual to the specific functions and requirements of your
industrial application before you implement them.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

EIO0000002091 04/2020 11
12 EIO0000002091 04/2020
Modicon Libraries General Purpose
General overview
EIO0000002091 04/2020

Part I
General Overview

General Overview

Overview
This part provides:
 Overview of communication components.
 Overview of communication resources.
 Basic concepts used to implement the communication Control Expert components.

What Is in This Part?


This part contains the following chapters:
Chapter Chapter Name Page
1 General Overview of Communication Components 15
2 General Overview of Communication DFBs 17
3 General Concepts 19

EIO0000002091 04/2020 13
General overview

14 EIO0000002091 04/2020
Modicon Libraries General Purpose
General Overview of Communication Components
EIO0000002091 04/2020

Chapter 1
General Overview of Communication Components

General Overview of Communication Components

Introduction

Overview
The Modicon Libraries - General Purpose provides the function blocks (DFB) that are pre-
configured and tested by Schneider Electric and that are designed for automating systems with
networks or communication buses.
The Control Expert components (function blocks, components, and libraries) provide the
commonly required functions facilitating the development of the control systems under the M340,
M580, and Quantum automation platforms and the development of the devices connected to them
(for example, variable speed drives, starters, power meters, servo drives). The physical connection
between these devices and the controllers is established with a Modbus or Ethernet fieldbus.
The system provides the DFBs that can be used jointly with the tools for code generation and that
complement the DFB from this device library.
This document describes the basic concepts behind the platform function blocks.

EIO0000002091 04/2020 15
General Overview of Communication Components

16 EIO0000002091 04/2020
Modicon Libraries General Purpose
General Overview of Communication DFBs
EIO0000002091 04/2020

Chapter 2
General Overview of Communication DFBs

General Overview of Communication DFBs

Overview

This chapter lists the DFBs designed for network or communication bus-based communication.

List of Function Blocks


The DFBs are designed for the automation of Modbus and Modbus TCP Ethernet communication
systems.
The DFBs are classified based on the families being used.
The following table lists the function blocks and its description:

Family Profile name Function blocks Description


name
Modbus Client ModBusClientBasic Modbus client basic.
and (see page 25)
Modbus
TCP ModBusEthernetClient Ethernet client.
Ethernet (see page 25)
Port ModbusPortM (see page 35) M340 Modbus port.
ModbusPortMx80 Mx80 Modbus port.
(see page 35)
ModbusPortM58x80 M58x80 Modbus port.
(see page 35)
ModbusEthernetPortM M340 Modbus TCP Ethernet port.
(see page 35) or
EthernetPortM340
ModbusEthernetPortQ Quantum Modbus TCP Ethernet port.
(see page 35) or
EthernetPortQuantum
Scanner ModBusScanner (see page 47) Modbus scanner.
ModBudEthernetScanner Ethernet scanner.
(see page 47)
ModBusGateway ModBusGateway (see page 57)r Serial modbus-Modbus TCP/IP gateway
(Ethernet) or Modbus – Ethernet gateway.

EIO0000002091 04/2020 17
General Overview of Communication DFBs

Family Profile name Function blocks Description


name
Ethernet IP Ethernet IP Port EthernetIPPortMxx Port for Ethernet IP communication.
Communi- Profile (see page 69)
cation
Ethernet IP Client EthernetIPClient Client for Ethernet IP communication.
Profile (see page 77)
Statistic Counter StatisticCounter1 Communication client statistics.
Profile (see page 85)
Profibus PRM management PRMMgtM (see page 93) PRM management M340
PRMMgtQ (see page 93) PRM management Quantum

18 EIO0000002091 04/2020
Modicon Libraries General Purpose
General Concepts
EIO0000002091 04/2020

Chapter 3
General Concepts

General Concepts

Overview
This chapter describes the basic concepts behind the communication Control Expert components.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Logical Architecture – Communication 20
Communication Process Diagram 21

EIO0000002091 04/2020 19
General Concepts

Logical Architecture – Communication

Basics
The basic operation of the communication functions consists of various clients or scanners storing
issued requests in a memory that is managed by the ports.
The ports are linked to a physical port on the controller and they send the requests to the correct
destination based on a defined algorithm, managed priorities, and waiting times. Finally, the ports
return the corresponding response to the client or scanner that generated the request.

Memory Management
To provide appropriate memory management, the data exchange zone consists of a dynamic
structure that adapts to the needs of each program.
The necessary work memory (WorkMemory) is calculated during the first scanning cycle.
NOTE: To enable the port to carry out an optimal calculation of the work memory, configure clients
and scanners and execute program instances when the first scanning cycle of the controller
occurs. This action maintains the correct order of execution. Clients or scanners serialize the
requests, followed by the port.

Gateway
A Gateway is a hardware device that connects Modbus Ethernet networks with serial Modbus
networks. To use this device, use a DFB that converts requests from serial clients to Ethernet client
requests.
After the Gateway receives these requests, it converts the requests into serial requests again and
sends them to the corresponding devices. The main difference between serial requests and
Ethernet requests is how the device is addressed.
Internally, a Gateway is made up of a modified serial Modbus port and an Ethernet client. Instead
of calling the serial communication functions (that is what a normal port does), the serial Modbus
port enters the request data into the Ethernet client, waits for its response, and returns the data like
a normal port would.

20 EIO0000002091 04/2020
General Concepts

Communication Process Diagram

The following diagram represents the communication process.

EIO0000002091 04/2020 21
General Concepts

22 EIO0000002091 04/2020
Modicon Libraries General Purpose
Modbus and Modbus TCP Ethernet Communication
EIO0000002091 04/2020

Part II
Modbus and Modbus TCP Ethernet Communication

Modbus and Modbus TCP Ethernet Communication

Overview
This part provides the detailed description of the Modbus and Modbus TCP Ethernet
communication-based DFBs.
These function blocks do not reflect any specific installation.

WARNING
LOSS OF CONTROL
 Perform a Failure Mode and Effects Analysis (FMEA) of your application, and apply preventive
and detective controls before implementation.
 Provide a fallback state for undesired control events or sequences.
 Provide separate or redundant control paths wherever required.
 Supply appropriate parameters, particularly for limits.
 Review the implications of transmission delays and take actions to mitigate.
 Review the implications of communication link interruptions and take actions to mitigate.
 Provide independent paths for control functions (for example, emergency stop, over-limit
conditions, and fault conditions) according to the safety analysis and applicable codes, and
regulations.
 Apply local accident prevention and safety regulations and guidelines. 1
 Test each implementation of this library for proper operation before placing it into service.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

1
For additional information, refer to NEMA ICS 1.1 (latest edition), Safety Guidelines for the
Application, Installation, and Maintenance of Solid State Control and to NEMA ICS 7.1 (latest
edition), Safety Standards for Construction and Guide for Selection, Installation and Operation of
Adjustable-Speed Drive Systems or their equivalent governing your particular location.

What Is in This Part?


This part contains the following chapters:
Chapter Chapter Name Page
4 Client Profile 25
5 Port Profile 35
6 Scanner Profile 47
7 ModBusGateway - Serial Modbus-Ethernet Gateway 57

EIO0000002091 04/2020 23
Modbus and Modbus TCP Ethernet Communication

24 EIO0000002091 04/2020
Modicon Libraries General Purpose
Client Profile
EIO0000002091 04/2020

Chapter 4
Client Profile

Client Profile

Overview
This chapter describes the DFBs of the Client profile.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 26
DFB Representation 27
Inputs 28
Outputs 30
Inputs/Outputs 32
Public Variables 33

EIO0000002091 04/2020 25
Client Profile

Description

General
A communication client allows device data to be written or read through Modbus, and Ethernet
Communication Protocols.
By using a communication client, you can access remote device data that cannot be accessed
normally with components generated with the Control Expert solution. For example, this enables
you to read/write from/to a variable speed drive parameter if this parameter is not available on the
respective control block of the speed drive.
Access to this data is explicit, that is, you need to program the access to this data. This is different
from the implicit access used in other communication, as with Ethernet IO Scanning, in which
access needs to be configured but not programmed.
The ModBusClientBasic and ModBusEthernetClient DFBs send a read or write request for
n registers on a Modbus communication bus and an Ethernet communication network.
The ModBusClientBasic and ModBusEthernetClient DFBs belong to the Modbus
communication and Modbus TCP Ethernet profile.

Function Description
The main functions of the client DFB are described in the following table:

Function Description
Read/Write Enables you to select whether a parameter has read or write access.
Multiple register Enables several consecutive registers to be read (available only in
reading/writing ModBusEthernetClient and ModBusClientBasic.
Diagnostic Monitors detected transaction problems and identifies them on 3-levels to
information determine the source of the error detected.
management
Priorities Enables you to define priorities for systems with multiple client accesses.
Statistics Obtains the transactions OK/NOK status and their access times.

26 EIO0000002091 04/2020
Client Profile

DFB Representation

Representation
The following figure represents the functional module of Client:

NOTE: The underlined parameters are specific for some components.


The table shows the parameters available for specific DFBs:

Parameters Components
Modbus Ethernet
ModBusClientBasic ModBusEthernetClient
Inputs DeviceAddress – X
ModbusAddress X –
X: Parameter is available
–: Parameter is not available

EIO0000002091 04/2020 27
Client Profile

Inputs

Input Parameter Description

Parameter Type Description


Start EBOOL 1 = Resets detected errors. Indicates to the client that the data on the
inputs is valid and a request to a server needs to be issued.
0 = Triggers an ACK of the end-of-operation notification and the client is
ready for the next cycle.
When the signal is activated, it copies the parameters to the function so
modifying the parameters has no effect.
ReadWrite BOOL 1 = Write operation.
0 = Read operation.
BitWord BOOL 1 = Operation performed on words.
0 = Operation performed on bits.
NOTE: Bit operation is not available if the client block is used with
ModBusEthernetPortQ, ModBusEthernetPortQ16 and
ModBusPortQx80 port block.
MemoryInput BOOL 1 = Selects input zones (30000 or %IW registers).
0 = Selects memory zones (40000 or %MW registers).
NOTE: CPU embedded ethernet ports cannot be used to read input
registers through the client blocks.
MemoryAddress INT Memory address where the requested operation starts.
Any value is valid for the master because the slave needs to validate the
address based on its memory map. You can enter the values as
hexadecimal or decimal values.
These indexes are expressed in decimal values in device manuals. To
express the index as a hexadecimal value, use the string 16# before the
index, that is, 16#index.
DeviceAddress* STRING[26] Device address. Refer to the Ethernet Technology (see page 125) to
see examples.
Depending on the platform, the following definitions apply:
Platform IP addressing DeviceAddress (variable)
M340 ‘{IP}ID’
Quantum ‘{IP}ID’
NOTE: Do not omit punctuation marks.
ModbusAddress INT Address of the Modbus slave that the client needs to access. The range
of possible values goes from 1 to 255.
*
This parameter is available only with ModBusEthernetClient.

28 EIO0000002091 04/2020
Client Profile

Parameter Type Description


Priority INT Command priority. The lower the value, the higher the priority, that is, 0
is the maximum priority. Any value is valid.
If you integrate a Modbus client together with any element from the
Control Device library, consider the following priorities to not interfere
with these elements:
Variable Description
value
1 Control commands. They have maximum priority.
2 Command confirmation. The read operations are carried out to confirm
that the commands have been executed.
Medium priority.
3 Data reading.
If these priority levels are not observed, the client requests do not
execute or the client does not allow other requests to be transmitted.
If you do not integrate it together with other Control Device library
elements, you can define any priority levels that you want. Otherwise,
use priority levels greater than or equal to 4.
Length INT Length of the data involved in the request that has been carried out.
For Modbus (ModBusClientBasic) or Ethernet
(ModBusEthernetClient) communication, the length can be in bits
or words depending on the BitWord variable. The maximum length for
words is 120.
*
This parameter is available only with ModBusEthernetClient.

EIO0000002091 04/2020 29
Client Profile

Outputs

Output Parameter Description

Parameter Type Description


Busy BOOL Activated while a request is taking place.
1 = Indicates that the client is busy, and that you cannot make
new requests.
End BOOL Activated when a request cycle ends.
1 = Indicates that the operation has ended (with or without a
detected error). This signal is acknowledged (ACK) by setting
the Start signal to Low.
Fail BOOL Activated when a detected error occurs in the request
transmission.
1 = Indicates that the operation is unsuccessful.
To reset the detected error, activate the client again by
setting the Start signal to High.
Timing diagram:

NOTE: If for any reason the Start signal is FALSE when


the End signal is activated, only an edge for one cycle of the
End signal is produced. This can result in the program
(depending on how it is designed) not detecting the End
signal, which is why this should not be allowed. The
corresponding behavior would be as follows:

30 EIO0000002091 04/2020
Client Profile

Parameter Type Description


FailCode ARRAY [0..2] OF INT Indicates the last detected error that took place according to
3 detected error levels (see page 101).
StatisticConnector STATISTICCONNECTOR The information data is used to obtain network statistics
(requests carried out, time between requests, and so on).
This structure has been created for its use together with the
StatisticCounter module in Communication library.
The following table describes the StatisticConnector:
Parameter Type Description
Start BOOL 1 = Operation has started.
EndOk BOOL 1 = Operation has ended correctly.
EndNOk BOOL 1 = Operation has ended with a detected error.
PartialTime DINT Partial time.

EIO0000002091 04/2020 31
Client Profile

Inputs/Outputs

Input/Output Parameter Description

Parameter Type Description


Data ANY_AR- Holds the write data or the read data depending on the
RAY_INT ReadWrite input parameter.
WorkMemory ANY_ARR Array is used for communication. This variable is used in a
AY_INT CanPort/ModBusPort/ModBusEthernetPort, which
serializes client requests in an optimum manner.

32 EIO0000002091 04/2020
Client Profile

Public Variables

Public Variable Parameter Description

Parameter Type Description


MaxReadSize INT This configuration parameter indicates how many words are
read in the request issued by this client. If no value is
specified, the maximum possible value is used by default
(125 words for Ethernet/Modbus). This parameter is used for
calculating and managing the work memory area
(WorkMemory).
NOTE: If several requests are made with the same client,
use the maximum length of the read requests to be issued as
the value of the parameter.
MaxWriteSize INT This configuration parameter indicates how many words are
written in the largest request issued by this client. If no value
is specified, the maximum possible value is used by default
(125 words for Ethernet/Modbus). This parameter is used for
calculating and managing the work memory area
(WorkMemory).
NOTE: If several requests are made with the same client,
use the maximum length of the write requests to be issued as
the value of the parameter.

EIO0000002091 04/2020 33
Client Profile

34 EIO0000002091 04/2020
Modicon Libraries General Purpose
Port Profile
EIO0000002091 04/2020

Chapter 5
Port Profile

Port Profile

Overview
This chapter describes the DFBs of the Port profile.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 36
DFB Representation 39
Inputs 40
Outputs 41
Inputs/Outputs 43
Public Variables 45

EIO0000002091 04/2020 35
Port Profile

Description

General
A Port DFB is a function which is capable of serializing and managing requests sent to a physical
medium working on Modbus TCP/IP, Modbus serial on local rack or Modbus serial on X80 rack.
A client is a Modbus communication (ATV, PM, ATS, and so on) device DFB or a generic read/write
DFB used to communicate a device on the physical medium (clients and scanners).
The basic operation consists of various clients storing requests in a memory that is managed by
the port (Modbus, or Ethernet). The port takes out requests from the queue based on a defined
algorithm that manages priorities and waiting times and sends them to the appropriate destination
after the port returns the response of the destination to the client that generated the request.
Use a Port DFB for any messaging requests. A minimum of 1 port per controller hardware is
necessary to effect communication of this type.
NOTE:
 In a serial Modbus (RTU) project, use at least 1 Port DFB because communication on a Modbus
takes place through messaging by definition.
 If the General Purpose library for device is used with Modbus TCP/IP networks (IOScanning),
Port DFBs are not required for their control because these devices exchange cyclic data through
IOScanning technology on Modbus TCP/IP. Any information that is not included in the Device
library DFBs needs to be requested through acyclic exchange, that is, through requests sent to
a Port DFB.
 New device DFB cannot be added to the existing explicit communication (Port DFB) while
controller is running.
To add a new device DFB user can instantiate a new port DFB which is mapped to the same
physical port.
NOTE: For Port and its client DFBs to work as expected in HSBY controller, it is mandatory that
these DFBs should not run in standby controller. This configuration can be done in the HSBY
controller configuration as shown below.

36 EIO0000002091 04/2020
Port Profile

Depending on the technology used, the function name varies to enable you to identify the product
range to which the function belongs during generation:

EIO0000002091 04/2020 37
Port Profile

These functions are further classified to support, maximum number of concurrent operations based
on Communication or CPU module. The table describes which port function to be used with the
controller.

Communicatio M340 M580 Quantum X80 Maximum


n Simultaneous
Sends
Modbus RTU – ModbusPortQX80 4
– – – ModbusPortM58X80 4
ModbusTCP/IP ModbusEthernetPortM ModbusEther- – 4
netPortQ
ModbusEthernetPortM16 ModbusEthern – 16
etPortQ16
– ModbusEthernet – – 32
PortM32
– ModbusEthernet – – 48
PortM48
– ModbusEthernet – – 64
PortM64
– ModbusEthernet – – 80
PortM80

38 EIO0000002091 04/2020
Port Profile

DFB Representation

Representation
The following figure represents the functional module of Port:

NOTE: The underlined parameters are specific for some components.


The table shows the parameters available for specific DFBs:

Parameters Components
Modbus Ethernet
ModBusPortM ModBusPortQ ModBusPortM58x ModbusEther- Mod-
x80 80 net- busEther-
PortM/16/32/48 netPortQ/
/64/80 16
In- AuxData – X – – –
puts/ Locate- – – – – X
Out- dArea
puts
X: Parameter is available
–: Parameter is not available

EIO0000002091 04/2020 39
Port Profile

Inputs

Input Parameter Description

WARNING
Unintended Equipment Operation
Use InitRequest pin only when the devices connected to Port function block are not running.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

Parameter Type Description


ResetStatistics BOOL 1 = Resets the data on the Statistics output variable
to its default values (0).
The input is level-based, that is, Statistics remains
0 as long as the input is TRUE.
InitRequest BOOL Reset all the current processing request of the Ethernet
client. On triggering this pin, client connected to the port
block may go into fail state. This input pin works on
rising edge.
NOTE: This input pin has to be used only when the
PLC data restore operation is performed.

40 EIO0000002091 04/2020
Port Profile

Outputs

Output Parameter Description

Parameter Type Description


Fail BOOL 1 = Indicates that a detected error has occurred while
transmitting a request. It is only an indication, and the port
process continues. The bit does not have to be reset, and it
cannot be reset. As soon as a request is issued without a
detected error, it is set to 0.
If Fail bit is set to 1, following can be the possibilities:
 If Workmemory area is less than the WantedArraySize
 If the PortAddress is not correctly configured.

Check the diagnostic codes in each DFB belonging to devices


or clients/scanners.
WantedArraySize INT Indicates the size necessary for the WorkMemory array to
function correctly. Declare the array with the minimum size of
[0..WantedArraySize-1] because arrays start on 0.
If you add more Modbus, or Modbus TCP/IP clients/scanners
or more serial Modbus (RTU) devices to the program during
programming, the size of this variable increases making it
necessary to monitor the growing size of the WorkMemory
array.
NOTE:
This variable is calculated during the first scanning cycle so
adding serial Modbus (RTU) clients or devices in the online
mode has the following effects:
 The size of the array will not increase.
 The ModbusGateway DFB does not consider requests
from these new clients.
LostMessages INT Indicates the number of messages that have been lost (that
the client has not received).
This value needs to be 0. Otherwise, the user has written an
incorrect program (a client/scanner instance is probably not
executed every cycle).
If messages are lost, the user has to diagnose the reason
(either hardware wiring or incorrect program).

EIO0000002091 04/2020 41
Port Profile

Parameter Type Description


Statistics STATISTICDATA Holds a structure with statistical data on the operation of the
Port DFB. This data is useful for debugging the application.
The information obtained in this data structure is the statistic
for the requests managed by this Port DFB. The clients
associated with this DFB through the WorkMemory array
send the requests.
The following table describes the StatisticData type:
Name Type Description
RequestsSended DINT Total number of requests sent.
RequestsOk DINT Total number of requests that ended correctly.
RequestsError DINT Total number of requests that ended in a detected
error.
MinTime DINT Minimum time required to end a request (msec).
AvgTime REAL Average time required to end a request (msec).
MaxTime DINT Maximum time required to end a request (msec).
LastTime DINT Time required to end the last request (msec).
CurrentTime DINT Time spent on processing the current request (0 if
no request is in progress).
RequestsSecond DINT Number of requests that can be sent per second
(calculated with the AvgTime value).
LastCycleNumber DINT Number of controller cycles that the last request
took to be executed.
CurrentCycleNumber DINT Number of controller cycles that the current request
has taken so far (0 if no request is in progress).
TimeOnQueue DINT Time that the last request has been waiting in the
queue before being sent (only useful for client
statistics).

42 EIO0000002091 04/2020
Port Profile

Inputs/Outputs

Input/Output Parameter Description

Parameter Type Description


AuxData* CRADATA This structure is used for managing CRA data requests.
Parameter Type Description
CRADataSubPort1 ARRAY CRA data for SubPort1.
CRADataSubPort2 ARRAY CRA data for SubPort2.
CRADataSubPort3 ARRAY CRA data for SubPort3.
CRADataSubPort4 ARRAY CRA data for SubPort4.
WorkMemory ANY_ARRAY_INT This array is for use with a Modbus-RTU, or Modbus
TCP/IP Port DFB holds the read/write requests of the
clients/scanners.
The WorkMemory array is the work memory or link
between the serial Modbus clients/scanners and an
Ethernet port DFB.
During the first scanning cycle, the clients/scanners or
devices reserve read/write %Mwords from this array based
on the exchange words required by each DFB. After they
have been reserved, the Port DFB counts them, and as a
result specifies and identifies how many pieces of data are
to be serialized.
Adjust the WorkMemory parameter to set:
 The size of the data exchange area between the device
and client DFBs.
 The Port DFB to the size needed for the elements that
are being used.
The system is not limited by fixed sizes or unused memory.
* This parameter is available only with ModbusPortQx80 and ModbusPortM58X80.
**
This parameter is available only with ModbusEthernetPortQ.
**
This parameter is available only with ModbusEthernetPortQ16.

EIO0000002091 04/2020 43
Port Profile

Parameter Type Description


LocatedArea** QUANTUMPORTLOCATEDD Due to internal requirements, the Quantum port needs
ATA some variables to be mapped.
As a result, this input provides the port with a memory area
that has the internal structure necessary for it to work. The
internal data does not have to be checked, and do not
modify this internal data.
Declare this variable in the variable table and allocate an
address to it; otherwise the port does not work. To do this,
specify the variable address.
The necessary data consists of 436 words. If, for example,
the variable has been addressed on %MW100, this is
equivalent of reserving a %MW100:436 array. If you use
this address again, it leads to a detected error when the
project is compiled. This has been done to force the
programmer to address the variable within the PLC
working range. If this input is not mapped, diagnostic code
16#200E (Hex) appears at level 0.
Use memory maps to reserve memory area for this
variable (refer to memory segment figures in this section).
LocatedArea** QUANTUMPORTLOCATEDD Due to internal requirements, the Quantum port needs
* ATA16 some variables to be mapped.
As a result, this input provides the port with a memory area
that has the internal structure necessary for it to work. The
internal data does not have to be checked, and do not
modify this internal data.
Declare this variable in the variable table and allocate an
address to it; otherwise the port does not work. To do this,
specify the variable address.
The necessary data consists of 436 words. If, for example,
the variable has been addressed on %MW100, this is
equivalent of reserving a %MW100:436 array. If you use
this address again, it leads to a detected error when the
project is compiled. This has been done to force the
programmer to address the variable within the PLC
working range. If this input is not mapped, diagnostic code
16#200E (Hex) appears at level 0.
Use memory maps to reserve memory area for this
variable (refer to memory segment figures in this section).
* This parameter is available only with ModbusPortQx80 and ModbusPortM58X80.
**
This parameter is available only with ModbusEthernetPortQ.
**
This parameter is available only with ModbusEthernetPortQ16.

Calculating the WorkMemory Array Size


For more details, refer to Editing the WorkMemory Array Size (see page 151).

44 EIO0000002091 04/2020
Port Profile

Public Variables

Public Variable Description

Parameter Type Description


TimeOut TIME Time to wait for a response, after this port will send a communication timeout
to the requesting device.
SimultaneousSends INT Indicates how many requests are queued (serialized) in the Modbus master.
The value ranges from 1 to 4. The more requests in the card queue, the better
the general performance of the system. You need to consider the following:
 There is a maximum number of queued requests per CPU. This means
that if a high number is selected, limit the number of simultaneous
transmissions so that the total of these values does not exceed the limit.
 Priority management does not consider requests that are queued in the
hardware buffer, which enables a high-priority command to wait until
lower-priority commands that are already in the queue are sent first. This
action results in a longer response time for high-priority commands.
For detail description, refer to SimultaneousSends table (see page 36).

PortAddress* STRING Defines the physical port that the DFB uses to send the Modbus TCPIP
request to (M340/M580/Quantum/NOE/NOC) Modbus TCPIP port. To define,
refer to Ethernet communication architecture (see page 126).

EthPortAddress** STRING Defines the physical port that the DFB uses to send the Modbus TCPIP
request to (M580CPU/CRP/NOE/NOC) Modbus TCPIP port. To define, refer
to Ethernet communication architecture (see page 126).
CRAIPAddress** STRING Defines the physical port that the DFB uses to send the Modbus TCPIP
request to CRA. To define, configure ip address as {ip.ip.ip.ip}.
MaxRetryAfterSwitch INT Maximum number of retry for first request is to be successful after the
*** controller switchover. If the response is not received from the field devices
after a specified number of retry then, port block will send the detected error
received in the last retry to the client which was requesting the data.
MBPortAddress** STRING Defines the physical port that the DFB uses to send the Modbus serial request
to Modbus serial port. It is calculated automatically by the template. To define,
configure Modbus port address as Rack.Slot.Channel
* This parameter is available only with ModbusPortM, ModbusEthernetPortM and ModbusEthernetPortQ.
**
These parameters are available only with ModbusPortQx80 and ModbusPortM58x80.
***
This parameter is not applicable to ModbusPortM.

EIO0000002091 04/2020 45
Port Profile

46 EIO0000002091 04/2020
Modicon Libraries General Purpose
Scanner Profile
EIO0000002091 04/2020

Chapter 6
Scanner Profile

Scanner Profile

Overview
This chapter describes the DFBs of the Scanner profile.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 48
DFB Representation 49
Inputs 51
Outputs 53
Inputs/Outputs 54
Public Variables 55

EIO0000002091 04/2020 47
Scanner Profile

Description

General
A communication scanner is a function block that uses an internal client to send several sequential
requests to different memory positions in the remote device. It enables you to program up to 10
read/write requests that will be sent sequentially, activated either cyclically or with 1 single cycle.
By using a communication scanner, you can access a set of memory addresses (consecutive or
non-consecutive) in remote devices which cannot be accessed normally with components
generated with the Control Expert solution – just like with a client, but by programming several
accesses to different memory positions in the device sequentially and individually, without the use
of multiple clients.
Access to this data is explicit, that is, you need to program access to this data. This is different from
the implicit access used in other communication, as with Ethernet IO Scanning, in which access
needs to be configured but not programmed.
The ModBusScanner and ModBusEthernetScanner DFBs periodically refreshes read or write
requests for n registers issued to a single node on a Modbus communication bus and Ethernet
communication.
The ModBusScanner and ModBusEthernetScanner DFBs belong to the Modbus
communication profile.

Function Description
The main functions of the scanner DFB are described in the following table

Function Description
Cyclic Allows reading or writing with cycling timing.
reading/writing
Multiple register Allows several consecutive registers to be read with each line. Available
reading/writing only in ModBusEthernetClient and ModBusClientBasic.
Individual Enables you to select individually which requests need to be activated
activation of (out of the 10 available ones).
scanner requests
Diagnostic Monitors incorrect transactions and identifies them on 3-levels to
information determine the source of the error detected.
management
Priorities Enables you to define priorities for systems with multiple scanner
accesses.
Statistics Obtains the OK/NOK status of the transactions and their access times.

48 EIO0000002091 04/2020
Scanner Profile

DFB Representation

Representation
The following figure represents functional module of Scanner:

NOTE: The underlined parameters are specific for some components.

EIO0000002091 04/2020 49
Scanner Profile

The table shows the parameters available for specific DFBs:

Parameters Components
Modbus Modbus TCP Ethernet
ModBusScanner ModBusEthernetScanner
Inputs DeviceAddress – X
ModbusAddress X –
X: Parameter is available
–: Parameter is not available

50 EIO0000002091 04/2020
Scanner Profile

Inputs

Input Parameter Description

Parameter Type Description


EnableDFB BOOL 1 = Enables communication.
0 = Initializes scanner.
ResetFail EBOOL 1 = Resets a communication interruption or incorrect parameter
configuration.
Priority INT Command priority. The lower the value, the higher the priority, that
is, 0 is the maximum priority. Any value is valid.
DeviceAddress* STRING [26] Device address. Refer to the Ethernet Technology (see page 125) to
see an example.
Depending on the platform, the following definitions apply:
Platform IP addressing DeviceAddress (variable)
M340/M580/Quan- ‘{IP}ID’
tum
NOTE: Do not omit punctuation marks.
ModbusAddress** INT Address of the Modbus slave that the client needs to access. The
range of possible values goes from 1 to 255.
MemoryAddress ANY_ARRAY_INT Each position in the array holds the memory address where the
requested scanner operation starts.
Any value is valid for the master because the slave needs to validate
the address based on its memory map.
You can enter values as hexadecimal or decimal values. These
indexes are expressed in decimal values in device manuals. To
express the index as a hexadecimal value, use the string 16# before
the index, that is, 16#index.
MemoryInput ANY_ARRAY_BOOL Array of memory or input operations
 MemoryInput[x] = 0: Selects memory zones (40000 or %MW
registers)
 MemoryInput[x] = 1: Selects input zones (30000 or %IW
registers)
Enabled ANY_ARRAY_BOOL Array of enabled operations
 Enabled[x] = 0: Operation is skipped
 Enabled[x] = 1: Operation is performed

ReadWrite ANY_ARRAY_BOOL Array of read or write operations


 ReadWrite[x] = 0: Read operation
 ReadWrite[x] = 1: Write operation
*
This parameter is available only with ModbusEthernetScanner.
**
This parameter is available only with ModbusScanner.

EIO0000002091 04/2020 51
Scanner Profile

Parameter Type Description


BitWord ANY_ARRAY_BOOL Array of operations
 BitWord[x] = 0: Operation is performed in bits
 BitWord[x] = 1: Operation is performed in words

Length ANY_ARRAY_INT Integer array. Length of the data involved in the request that has
been carried out.
For Modbus (ModBusClientBasic) or Ethernet
(ModBusEthernetClient) communication, the length can be in
bits or words depending on the BitWord variable. The maximum
length for words is 120 (100 words in Quantum platform).
NOTE: Modifying the lengths of the write operations for each
request misalign the WriteData array.
WriteData ANY_ARRAY_INT Integer array. The integers hold the data to be written in each
scanner line. This table holds the data to be written for the read
requests. The size of the variables used for each request is marked
by the Length variable. As a result, each write request reserves its
zone in this array.
StatisticSelector INT Variable used to obtain network statistics (requests carried out, time
between requests, and so on). This data provides information for
using the StatisticConnector with the StatisticCounter
module in the Communication library.
Variable value Description
1 Statistics of complete scanner cycles.
2 Statistics of each scanner line
*
This parameter is available only with ModbusEthernetScanner.
**
This parameter is available only with ModbusScanner.

52 EIO0000002091 04/2020
Scanner Profile

Outputs

Output Parameter Description

Parameter Type Description


Ready BOOL 1 = The scanner is ready for operation.
Busy BOOL 1 = The scanner is busy waiting for the response to a
request.
End BOOL 1 = The operation in progress has ended.
Fail BOOL 1 = Detected error in the function during the current
request.
If communication with the slave does not respond, it stops
requests until a ResetFail is carried out.
LastSectionProcessed INT If End is true, this output shows the index of the scanner
operation that has ended.
FailCode ARRAY [0..2] OF INT Indicates the last detected error that took place according
to 3 detected error levels (see page 101).
ReadData ANY_ARRAY_INT Data read by the scanner if the last operation was a read
operation. This zone is common to read requests that have
been configured in the parameters. As a result, the data is
overwritten with each new processed read request.
NOTE: ReadData holds the read data for
LastSectionProcessed hence, this data is updated
every time a new read operation is processed. The
program unloads this data from this array if needed after
the next request. Use End variable to unload data when
read request ended (LastSectionProcessed AND
End).
StatisticConnector STATISTICCONNECTOR The information data is used to obtain network statistics
(requests carried out, time between requests, and so on).
This structure has been created for its use together with
the StatisticCounter module in Communication
library.
The following table describes the
StatisticConnector:
Parameter Type Description
Start BOOL 1 = Operation has started.
EndOk BOOL 1 = Operation has ended correctly.
EndNOk BOOL 1 = Operation has ended with a detected error.
PartialTime DINT Partial time.

EIO0000002091 04/2020 53
Scanner Profile

Inputs/Outputs

Input/Output Parameter Description

Parameter Type Description


WorkMemory ANY_ARRAY_INT Array is used for communication. This variable is used in a
ModBusPort/ModBusEthernetPort, which serializes
client requests in an optimum manner.

54 EIO0000002091 04/2020
Scanner Profile

Public Variables

Public Variable Parameter Description

Parameter Type Description


Refresh TIME Time that the scanner waits before it repeats an operation
cycle.
MaxReadSize INT This configuration parameter indicates how many words are
read in the request issued by this client. If no value is
specified, the maximum possible value is used by default
(125 words for Ethernet/Modbus). This parameter is used
for calculating and managing the work memory area
(WorkMemory).
NOTE: If several requests are made with the same client,
use the maximum length of the read requests to be issued
as the value of the parameter.
MaxWriteSize INT This configuration parameter indicates how many words are
written in the largest request issued by this client. If no value
is specified, the maximum possible value is used by default
(125 words for Ethernet/Modbus). This parameter is used
for calculating and managing the work memory area
(WorkMemory).
NOTE: If several requests are made with the same client,
use the maximum length of the write requests to be issued
as the value of the parameter.

EIO0000002091 04/2020 55
Scanner Profile

56 EIO0000002091 04/2020
Modicon Libraries General Purpose
ModBusGateway
EIO0000002091 04/2020

Chapter 7
ModBusGateway - Serial Modbus-Ethernet Gateway

ModBusGateway - Serial Modbus-Ethernet Gateway

Overview
This chapter describes the ModBusGateway DFB.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 58
DFB Representation 59
Inputs 60
Outputs 61
Inputs/Outputs 63
Public Variables 65

EIO0000002091 04/2020 57
ModBusGateway

Description

General
The ModBusGateway is the DFB that functions as a bridge between serial devices and Ethernet
buses.
By using a gateway (TSXETG100), you can establish communication between a CPU with Ethernet
ports and devices that implement only an RS485 interface.

Function Description
The main functions of the DFB are described in the following table:

Function Description
Request Enables read/write requests to be issued to devices on a 485 bus through
conversion an Ethernet port (available only for ModBusClientBasic and
ModBusScanner).
Statistics Obtains the OK/NOK status of the transactions and their access times.

58 EIO0000002091 04/2020
ModBusGateway

DFB Representation

Representation
The following figure represents the functional module of ModBusGateway:

EIO0000002091 04/2020 59
ModBusGateway

Inputs

Input Parameter Description

WARNING
Unintended Equipment Operation
Use InitRequest pin only when the devices connected to Port function block are not running.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

Parameter Type Description


ResetStatistics BOOL 1 = Resets the data on the Statistics output variable to its default
values (0).
The input is level-based, that is, statistics remains 0 as long as the input
is TRUE.
GatewayAddress STRING[26] IP address for the gateway where the serial Modbus devices are
physically located.
Depending on the platform used and the position in which the Ethernet
port is located inside the PLC rack, enter IP addressing in the following
formats:
Platform Gateway addressing
M340/M580/ ‘{IP}’
Quantum
InitRequest BOOL Reset all the current processing request of the Modbus client. On
triggering this pin, client connected to the gateway block may go into fail
state. This input pin works on rising edge.
NOTE: This input pin has to be used only when the PLC data restore
operation is performed.

The slot indicates the position occupied by the Ethernet port inside the PLC rack.
NOTE: Follow the naming conventions (periods, brackets) to configure the Modbus slave address.

60 EIO0000002091 04/2020
ModBusGateway

Outputs

Output Parameter Description

Parameter Type Description


Fail BOOL 1 = Indicates that a detected error has occurred while
transmitting a request. It is only an indication, and the port
process continues.
The bit does not have to be reset, and it cannot be reset. As soon
as a request is issued without an error detected, it is set to 0.
Check the diagnostic codes in each DFB belonging to devices or
serial Modbus clients.
WantedArraySize INT Indicates the size necessary for the WorkMemoryRS485 array to
function correctly.
Declare the array with the minimum size of
[0..WantedArraySize-1] because arrays start on 0.
If you add additional serial Modbus (RTU) clients or devices to
the program, the size of this variable increases making it
necessary to monitor the WorkMemoryRS485 array.
NOTE:
This variable is calculated during the first scanning cycle so
adding serial Modbus (RTU) clients or devices during online
mode has the following effects:
 The size of the array does not increase.
 The ModbusGateway DFB does not consider requests from
these new clients.
LostMessages INT Indicates the number of messages that have been lost (that the
client has not received).
This value needs to be 0. Otherwise, the user has written an
incorrect program (a ModbusClientBasic/ModbusScanner
instance is probably not executed each cycle).
If messages are lost, the user has to diagnose the reason (either
hardware wiring or incorrect programming).

EIO0000002091 04/2020 61
ModBusGateway

Parameter Type Description


Statistics STATISTICDATA Holds a structure with statistical data on the operation of the
ModBusGateway DFB. This data is useful for debugging the
application.
The information obtained in this data structure is the statistic for
the requests managed by this ModBusGateway DFB. The
clients that are associated with this DFB by using the
WorkMemoryRS485 array send requests.
The following table describes the StatisticData type:
Name Type Description
RequestsSended DINT Total number of requests sent.
RequestsOk DINT Total number of requests that ended correctly.
RequestsError DINT Total number of requests that ended in an error
detected.
MinTime DINT Minimum time required to end a request (msec).
AvgTime REAL Average time required to end a request (msec).
MaxTime DINT Maximum time required to end a request (msec).
LastTime DINT Time required to end the last request (msec).
CurrentTime DINT Time spent on processing the current request (0 if
no request is in progress).
RequestsSecond DINT Number of requests can be sent per second
(calculated with the AvgTime value).
LastCycleNumber DINT Number of controller cycles that the last request
took to be executed.
CurrentCycleNumber DINT Number of controller cycles that the current request
has taken so far (0 if no request is in progress).
TimeOnQueue DINT Time that the last request has been waiting in the
queue before sending (only useful for client
statistics).

62 EIO0000002091 04/2020
ModBusGateway

Inputs/Outputs

Input/Output Parameter Description

Parameter Type Description


WorkMemoryRS485 ANY_AR- This array holds the read/write requests of the clients/scanners.
RAY_INT The WorkMemoryRS485 array is the work memory or link between the serial
Modbus clients/scanners and an Ethernet port DFB.
During the first scanning cycle, the devices reserve read/write %Mwords from
this array based on the exchange words required by each DFB. The
ModbusGateway DFB counts them, and as a result specifies and identifies
how many pieces of data are to be serialized.
Adjust the WorkMemoryRS485 variable previously to set:
 The size of the data exchange area between the device and client DFB.
 The ModbusGateway DFB to the size needed for the elements that are
used.
The system is not limited by fixed sizes or unused memory.
WorkMemoryEthernet ANY_AR- This variable holds the requests that are in the WorkMemoryRS485 in
RAY_INT Modbus TCP/IP requests.
As a result, this variable needs to have a bigger size than the
WorkMemoryRS485 variable because each request holds more data, such
as the destination IP address, and so on.
NOTE: The WantedArraySize output variable only indicates the size that
is required for the WorkMemoryRS485 variable. To know the appropriate
size for the variable, check the WantedArraySize output variable of the
Ethernet port DFB to which the ModbusGateway DFB is linked.

EIO0000002091 04/2020 63
ModBusGateway

Calculating the WorkMemoryRS485 Array Size


The necessary size for the array of the variable associated to WorkMemoryRS485 is automatically
calculated by the DFBs of the port shown by the WantedArraySize output.
Check if the size of the array for the WorkMemoryRS485 variable of the ModbusGateway DFB,
which has been calculated by the code generator, has a size greater than or equal to the one that
the WantedArraySize variable requires.

The following steps explain how to check the value:

Step Action
1 Execute the program with the calculated array.
2 Check the value returned by the ModbusEthernetPortM DFB.
3 Resize the array to the WantedArraySize value (the array needs to have a
size of [0... WantedArraySize-1] as a maximum).

The DFB rebuilds the serial Modbus requests that are in WorkMemoryRS485 as Modbus TCP/IP
requests, which are copied to the WorkMemoryEthernet variable.

64 EIO0000002091 04/2020
ModBusGateway

Public Variables

Public Variable Parameter Description

Parameter Type Description


SimultaneousSends INT Indicates how many requests are in the gateway
queue. You can configure this input.
The value ranges from 1 to 4. The more requests in
the gateway queue, the better the general
performance of the system. You need to consider the
following:
 The maximum number of requests in the CPU
buffer.
 The maximum number of requests for a gateway
queue.
 Priority management does not consider requests
that are queued in the hardware buffer, which
enables a high-priority command to wait until
lower-priority commands that are already in the
queue are sent first. This action results in a longer
response time for high-priority commands.

EIO0000002091 04/2020 65
ModBusGateway

66 EIO0000002091 04/2020
Modicon Libraries General Purpose
Ethernet IP Communication
EIO0000002091 04/2020

Part III
Ethernet IP Communication

Ethernet IP Communication

Overview
This part explains about Ethernet IP communication technology.

WARNING
LOSS OF CONTROL
 Perform a Failure Mode and Effects Analysis (FMEA) of your application, and apply preventive
and detective controls before implementation.
 Provide a fallback state for undesired control events or sequences.
 Provide separate or redundant control paths wherever required.
 Supply appropriate parameters, particularly for limits.
 Review the implications of transmission delays and take actions to mitigate.
 Review the implications of communication link interruptions and take actions to mitigate.
 Provide independent paths for control functions (for example, emergency stop, over-limit
conditions, and fault conditions) according to the safety analysis and applicable codes, and
regulations.
 Apply local accident prevention and safety regulations and guidelines. 1
 Test each implementation of this library for proper operation before placing it into service.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

What Is in This Part?


This part contains the following chapters:
Chapter Chapter Name Page
8 EthernetIPPortMxx - Ethernet IP Port Profile 69
9 EthernetIPClient - Ethernet IP Client Profile 77
10 StatisticCounter1 - Statistic Counter Profile 85

EIO0000002091 04/2020 67
Ethernet IP Communication

68 EIO0000002091 04/2020
Modicon Libraries General Purpose
EthernetIPPortMxx - Ethernet IP Port Profile
EIO0000002091 04/2020

Chapter 8
EthernetIPPortMxx - Ethernet IP Port Profile

EthernetIPPortMxx - Ethernet IP Port Profile

Overview
This chapter describes the DFB of the Ethernet IP port profile.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 70
DFB Representation 71
Inputs 72
Outputs 73
Inputs/Outputs 74

EIO0000002091 04/2020 69
EthernetIPPortMxx - Ethernet IP Port Profile

Description

Overview
EthernetIPPortMxx DFB is a function block which is capable of serializing and managing requests
sent to a physical device communicating on explicit messaging using Ethernet IP protocol.
The function of this DFB is to serialize requests generated by various clients connected to this port
via the work memory to the appropriate physical destination. The DATA_EXCH function of
Control Expert is used to generate EIP requests within this DFB. The received response is sent
back to the respective clients who have generated the requests. This serialization of requests
enables you to connect more number of clients to the same physical port.

70 EIO0000002091 04/2020
EthernetIPPortMxx - Ethernet IP Port Profile

DFB Representation

Description
The following figure represents the functional module of EthernetIPPortMxx

NOTE: xx can have the values of 4, 16, 32, 48, 64, 80 and 96. The values indicate the maximum
number of SimultaneousSends supported by the function block.

EIO0000002091 04/2020 71
EthernetIPPortMxx - Ethernet IP Port Profile

Inputs

Input Parameter Description

Parameter Type Description


Init BOOL Initialize the EthernetIPPortMxx DFB.
EnableStatistics BOOL Enable the statistics counters.
ResetStatistics BOOL Reset the statistics.
EngParam EIPPortEngParam Engineering parameters of the Ethernet IP port.
NOTE:
 If SimultaneousSends is 0, then the default value
of 1 is considered by the DFB.
 If Timeout is configured as 0, then a default value
of t#3s is considered by the DFB.

EIPPortEngParam DDT structure

Parameter Type Description


PortAddress string[14] Communication network name. For example
Ethernet_1 or hardware address
rack.module.channel.
NOTE: If PortAddress is empty, then the nearest
Ethernet port to CPU will be considered for
communication.
SimultaneousSends INT Number of simultaneous sends.
Timeout TIME Time to wait a response. Request time in the
network/bus.

72 EIO0000002091 04/2020
EthernetIPPortMxx - Ethernet IP Port Profile

Outputs

Output Parameter Description

Parameter Type Description


Fail BOOL Displays if there are errors detected during
communication.
Statistics StatisticDataPort Statistics of the data sent.

EIO0000002091 04/2020 73
EthernetIPPortMxx - Ethernet IP Port Profile

Inputs/Outputs

Input/Output Parameter Description

Parameter Type Description


WorkMemory EIPWorkMemory Memory Area which contains the
client reference.

EIPWorkMemory DDT Structure

Parameter Type Description


Header Array [0..15] OF WORD Common data.
ClientDataReference Array[0..95] OF Array of client references.
EIPSocketData

StatisticDataPort DDT Structure

Parameter Type Description


RequestsSent UDINT Number of requests sent including retries.
RequestsOk UDINT Number of requests that ended successfully.
RequestsError UDINT Number of requests that ended with detected
failure.
MinTime UDINT Minimum time to process a request in the
communication port (ms).
AvgTime UDINT Average time to process a request in the
communication port (ms).
MaxTime UDINT Maximum time to process a request in the
communication port (ms).
MinCycleNumber UDINT Minimum number of PLC cycles to process a
request in the communication port.
AvgCycleNumber UDINT Average number of PLC cycles to process a
request in the communication port.
MaxCycleNumber UDINT Maximum number of PLC cycles to process a
request in the communication port.
MinTotalTime DINT Minimum amount of time spent on the
requests sent (ms).
AvgTotalTime DINT Average amount of time spent on the
requests sent (ms).
MaxTotalTime DINT Maximum amount of time spent on the
requests sent (ms)

74 EIO0000002091 04/2020
EthernetIPPortMxx - Ethernet IP Port Profile

Parameter Type Description


RequestsperSecond UINT Number of requests sent per second.
SimultaneousRequests UINT Number of active requests.

EIO0000002091 04/2020 75
EthernetIPPortMxx - Ethernet IP Port Profile

76 EIO0000002091 04/2020
Modicon Libraries General Purpose
EthernetIPClient - Ethernet IP Client Profile
EIO0000002091 04/2020

Chapter 9
EthernetIPClient - Ethernet IP Client Profile

EthernetIPClient - Ethernet IP Client Profile

Overview
This chapter describes the DFB of the Ethernet IP client profile.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 78
DFB Representation 79
Inputs 80
Outputs 81
Inputs/Outputs 82

EIO0000002091 04/2020 77
EthernetIPClient - Ethernet IP Client Profile

Description

Overview
The EthernetIPClient DFB facilitates EthernetIP services to be executed on the devices via
Ethernet IP communication protocol. This function has provision to capture the parameters for the
execution of the EIP service on specific device.
Access to the client data is explicit, that is, you need to program the access to this data. This is
different from the implicit access used in other communication, as with Ethernet IO Scanning, in
which access needs to be configured but not programmed.

Function Description

Function Description
EIP Services Enables user to execute various EIP services on
devices.
Diagnostic information management Monitors detected transaction problems and
identifies them on two levels to determine the source
of the error detected.
Priorities Enables user to define priority for the client requests.
Statistics Obtains the status of the request (OK/NOK) and its
execution time.
Timeout If the client is waiting after generating a request for a
time greater than the Timeout configured, the client is
declared inoperable.
Retries If client is interrupted due to any detected error
generated from DATA_EXCH block, the request gets
retried for the configured retry count in the client.
Inactivity period If the number of retries are expired then the client
waits for the inactivity time configured before
generating the next request.

78 EIO0000002091 04/2020
EthernetIPClient - Ethernet IP Client Profile

DFB Representation

Description
The following figure represents the functional module of EthernetIPClient

EIO0000002091 04/2020 79
EthernetIPClient - Ethernet IP Client Profile

Inputs

Input Parameter Description

Parameter Type Description


Start EBOOL Rising edge enables client to create request.
ServiceID BYTE EIP service ID.
ClassID UINT Class ID of the device on which the EIP service has
to be executed.
InstanceID UINT Instance ID held by the ClassID on which the EIP
service has to be executed.
AttributeID UDINT Attribute ID held by the InstanceID on which the
EIP service has to be executed.
DeviceAddress String[20] IPAddress of device in format
{IP1.IP2.IP3.IP4}.
Priority UINT Priority of the request. Lesser the value higher the
priority.
Length UINT Length of the write data in bytes.
RequestData ANY_ARRAY_INT Data to be written along with EIP header.
EngParam EIPClientEngParam EIP Client Engineering parameters.

EIPPortEngParam DDT structure

Parameter Type Description


CommFailRetries INT Number of retries in case of a communication
interruption.
Timeout TIME Time for which client will wait for a response, once a
request is initiated before moving to Fail state.
NOTE: If the Timeout is either configured t#0s or
not configured, then client will be in Busy state until it
gets a response from EthernetIPPortMxx DFB. In
order to move to next state, you have to either
initialize the EthernetIPPortMxx DFB or
confiigure Timeout online.
InactivityTime TIME The period for which the client will not initiate a
request after the retries are expired.

80 EIO0000002091 04/2020
EthernetIPClient - Ethernet IP Client Profile

Outputs

Output Parameter Description

Parameter Type Description


Busy BOOL Indicates that the DFB is busy processing a
request.
End BOOL Indicates that the DFB has completely the
requested EIP service.
Fail BOOL Indicates the request has interrupted.
NOTE: All detected failed clients will be in ready
state after port is initialized.
Inactive BOOL DFB is in inactive period (Request will not be
generated when this pin is logical high).
Failcode ARRAY[0..2] OF INT Failcode of the last request which got
interrupted.
ResponseData ANY_ARRAY_INT Response received from the device.
NOTE: The data returned by the device (if there
is any data), will be available in the
ResponseData, irrespective of the status of the
request (success or detected failure).
StatisticConnector StatisticConnector1 Statistic connector.

EIO0000002091 04/2020 81
EthernetIPClient - Ethernet IP Client Profile

Inputs/Outputs

Input/Output Parameter Description

Parameter Type Description


ClientData EIPClientData All the client details are available within
this structure.
NOTE: Modifying the ClientData
input/output pin will result in unexpected
behavior of the DFB.
WorkMemory EIPWorkMemory Memory area which contains the client
reference.

EIPWorkMemory DDT Structure

Parameter Type Description


Header Array [0..15] OF Common data.
WORD
ClientDataReference Array[0..95] OF Array of client references.
EIPSocketData

EIPSocketData DDT Structure

Parameter Type Description


ClientRef REF_TO EIPClientData Reference of the client data.
Status WORD Status of the socket.

EIPClientData DDT Structure

Parameter Type Description


Data ARRAY[0..251] Data buffer.
OF INT
IPAddress string[20] IPAddress of the device
{IP1.IP2.IP3.IP4}.
AttributeID UDINT Attribute ID of the request.
InstanceID UINT Instance ID of the request.
ClassID UINT Class ID of the request.
Length UINT Length of data to be written.
Priority UINT Priority of the request.

82 EIO0000002091 04/2020
EthernetIPClient - Ethernet IP Client Profile

Parameter Type Description


ErrorCode INT Detected error Information.
ErrorCode1 INT Type of detected error.
Retries INT Number of retries.
ReadLength INT Length of data received from port in bytes.
OrderNumber INT Order number of request.
Status WORD The list of statuses are:
 0- Idle
 1 -Client has placed a request.
 2 - Port is processing the request.
 3 - Port has processed without a detected
error.
 4 - Port has processed with detected error.
ServiceID BYTE EIP Service ID.

EIO0000002091 04/2020 83
EthernetIPClient - Ethernet IP Client Profile

84 EIO0000002091 04/2020
Modicon Libraries General Purpose
StatisticCounter1 - Statistic Counter Profile
EIO0000002091 04/2020

Chapter 10
StatisticCounter1 - Statistic Counter Profile

StatisticCounter1 - Statistic Counter Profile

Overview
This chapter describes the DFB of Statistic counter profile.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 86
DFB Representation 87
Inputs 88
Outputs 89

EIO0000002091 04/2020 85
StatisticCounter1 - Statistic Counter Profile

Description

General
StatisticCounter1 DFB is used to log the statistical data of the requests handled by the client
over Ethernet IP protocol.

86 EIO0000002091 04/2020
StatisticCounter1 - Statistic Counter Profile

DFB Representation

Representation
The following figure represents the functional module of StatisticCounter1.

EIO0000002091 04/2020 87
StatisticCounter1 - Statistic Counter Profile

Inputs

Input Parameter Description

Parameter Type Description


EnableStatistics BOOL Enable the statistic counter.
ResetStatistics BOOL Reset the statistics.
StatisticConnector StatisticConnector1 Statistic Connector structure. To be connected from
the client.

StatisticConnector1 DDT Structure

Name Type Description


Start BOOL Start command.
EndOK BOOL Request ended successfully.
EndNOK BOOL Request ended with detected fail.
TotalTime DINT Total time taken for current request.

88 EIO0000002091 04/2020
StatisticCounter1 - Statistic Counter Profile

Outputs

Output Parameter Description

Parameter Type Description


StatisticData StatisticDataClient Client statistic data.

StatisticDataClient DDT structure

Name Type Description


RequestsSent UDINT Number of requests sent.
RequestsOK UDINT Number of requests that ended successfully.
RequestsError UDINT Number of requests that ended with a detected fail.
MinCycleNumber UINT Minimum number of PLC cycles to process a request.
AvgCycleNumber UINT Average number of PLC cycles to process a request.
MaxCycleNumber UINT Maximum number of PLC cycles to process a
request.
CurrentCycleNumber UINT Number of PLC cycles spent on the current request.
MinTotalTime UINT Minimum amount of time spent on the requests sent.
AvgTotalTime UINT Average amount of time spent on the requests sent.
MaxTotalTime UINT Maximum amount of time spent on the requests sent.
LastTotalTime UINT Amount of time spent on the last request sent.
CurrentTotalTime UINT Time spent on current request.
RequestsperSecond UINT Number of requests sent per second.

EIO0000002091 04/2020 89
StatisticCounter1 - Statistic Counter Profile

90 EIO0000002091 04/2020
Modicon Libraries General Purpose
Profibus
EIO0000002091 04/2020

Part IV
Profibus

Profibus

EIO0000002091 04/2020 91
Profibus

92 EIO0000002091 04/2020
Modicon Libraries General Purpose
PRMMgt
EIO0000002091 04/2020

Chapter 11
PRMMgt - PRM Management

PRMMgt - PRM Management

Overview
This chapter describes the DFBs of the PRM Management profile.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 94
DFB Representation 95
Inputs 96
Outputs 97
Inputs/Outputs 99
Public Variables 100

EIO0000002091 04/2020 93
PRMMgt

Description

Overview
This block is mandatory and has to be used in the application to start the PRM on a
M340/M580/Quantum controller platform.
While enabled (FDB, LD language) or continuously executed (ST language), PRM Management
automatically starts the PRM using the information given by the Master_Info structure.
The start is not possible in case of an error detected inside this structure. The block is configured
to restart the PRM, 3 times automatically. You can still start the PRM but after rectifying the
detected error logged in the Master_Info.ddt. The RETRY input needs to be triggered. The block
again tries to start the PRM, 3 times and trigger RETRY input.
In addition, activate the input EnableFullStatus using PRM Management to get the PRM status
(complete diagnostic information).
The conditions to read are:
 DFB enable input = TRUE
 ERROR output = FALSE

94 EIO0000002091 04/2020
PRMMgt

DFB Representation

Description
The following figure represents the functional module of PRM Management:

NOTE: The underlined parameters are specific for some components.


The table shows the parameters available for specific DFBs:

Parameters Components
PRMMgtM PRMMgtQ
Inputs/Outputs LocatedArea – X
X: Parameter is available
–: Parameter is not available

EIO0000002091 04/2020 95
PRMMgt

Inputs

Input Parameter Description

Parameter Type Description


EnableDFB BOOL 1 = Enables the DFB function.
EnableFullStatus BOOL 1 = Request to read the PRM status and update the
FSTS output accordingly.
PRMStatus T_PRM_IN Dynamic information, PRM implicit status To be
(see page 96) connected to the variable named: <PRM Master
alias name>_IN.
Retry BOOL 1 = Request to retry to start the PRM.

T_PRM_IN Type

Parameter Type Description


PRM_MASTER_STATUS BYTE  0 = No IO exchange
 1 = No configuration
 2 = No link
 3 = Stop
 4 = Run
PROFIBUS_STATUS BYTE  0 = Unknown
 9 = Inoperable devices
 10 = Devices in diagnostics
 11 = Inoperable devices and devices in
diagnostics
 12 = Detected error in Profibus
 16 = OK
DPM1_STATUS BYTE  0 = Unknown
 1 = Offline
 2 = Stopped
 3 = Operate
 4 = Clear
DPM2_STATUS BYTE Number of pending Profibus acyclic requests.
DIAG_LIST ARRAY OF List of configured devices with pending diagnosis.
WORD
MAILBOX_STATUS ARRAY OF Status of the mailboxes used by DFBs.
BYTE

96 EIO0000002091 04/2020
PRMMgt

Outputs

Output Parameter Description

Parameter Type Description


Valid BOOL 1 = Valid PRM diagnostic (FSTS) received.
Busy BOOL 1 = DFB working – other outputs are undefined.
Error BOOL 1 = No link established between the PRM and the
PLC.
PRM_Master_Status in the INIT, NO CONF, or
NO LINK state.
Stop BOOL 1 = The PRM is ready, the link is established with
the PLC, but the PRM is waiting for a start from the
PLC.
PRM_Master_Status in the STOP state.
FullStatus T_PRM_FSTS Record of the PRM complete status.
(see page 97)
PRM_Data T_PRM_DATA DDT contains information on communication path
(see page 98) to the PRM and the PRM status.

T_PRM_FSTS Type

Parameter Type Description


Name STRING [32] Product name assigned in the DTM browser.
IP ARRAY [0..3] of Current IP address.
BYTE
Rotary ARRAY [0..1] of Position of rotary switch
BYTE  Rotary[0] = Lower switch
 Rotary[1] = Upper switch

CRC UDINT CRC_IOMAPPING expected by the PRM.


PRM_MASTER_STATUS BYTE  0 = No IO exchange
 1 = No configuration
 2 = No link
 3 = Stop
 4 = Run
PROFIBUS_STATUS BYTE  0 = Unknown
 9 = Inoperable devices
 10 = Devices in diagnostics
 11 = Inoperable devices and devices in diagnostics
 12 = Detected error in Profibus
 16 = OK

EIO0000002091 04/2020 97
PRMMgt

Parameter Type Description


DPM1_STATUS BYTE  0 = Unknown
 1 = Offline
 2 = Stopped
 3 = Operate
 4 = Clear
DPM2_STATUS BYTE Number of pending Profibus acyclic requests.
IOscanner_Requests BYTE Number of Modbus IO scanner requests received in an
IO scanner cycle.
PROFIBUS_IO_Bandwith BYTE Profibus bandwidth used by PRM for data exchange (%).

T_PRM_DATA Type

Parameter Type Description


PRM_Address T_PRM_INFO_M Address of PRM.
Rack_number BYTE Rack number of the Ethernet module linked to the
PRM.
Module_number BYTE Position of Ethernet module in the rack.
Channel_number BYTE Channel number of the Ethernet port into the
Ethernet module.
IP ARRAY [1..4] of BYTE Current IP address.
 IP4 = Most significant byte of IP address of the
PRM
 IP1 = Least significant byte of IP address of the
PRM

98 EIO0000002091 04/2020
PRMMgt

Inputs/Outputs

Input/Output Parameter Description

Parameter Type Description


LocatedArea* ARRAY of INT Array of located variables (%MW) required
for Quantum.
*
This parameter is available only with PRMMgtQ.

EIO0000002091 04/2020 99
PRMMgt

Public Variables

Public Variable Description

Parameter Type Description


PortAddress STRING Entered as Rack Number.Module
Number.Channel Number.
Position of the Ethernet module linked to the
PRM (254 if CPU and slot number if NOE).
IPAddress STRING IP address of the PRM.

100 EIO0000002091 04/2020


Modicon Libraries General Purpose
Diagnostic Information Management
EIO0000002091 04/2020

Part V
Diagnostic Information Management

Diagnostic Information Management

EIO0000002091 04/2020 101


Diagnostic Information Management

102 EIO0000002091 04/2020


Modicon Libraries General Purpose
Diagnostic Information Management Codes
EIO0000002091 04/2020

Chapter 12
Diagnostic Information Management Codes

Diagnostic Information Management Codes

Overview
This chapter describes the diagnostic information management codes.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Description 104
Read_Var and Write_Var Diagnostic Codes 106
MBP_MSTR Diagnostic Codes 108
Client Parameter Diagnostic Codes 112
Scanner Parameter Diagnostic Codes 113
EthernetIP Communication Diagnostic Codes 114

EIO0000002091 04/2020 103


Diagnostic Information Management Codes

Description

General
The client and scanner function blocks manage information related to detected errors in
communication and reporting the status of the last transaction with a detected problem result.
The FailCode [..] output, which has 3 detected error levels to specify the detected error source,
is provided in the following table for this function:
For FailCode[2]:

FailCode[2] Meaning
16#0000 Client/scanner requests
16#0001 Read requests from Device library blocks
16#0002 Write requests from Device library blocks

For FailCode[1]:

FailCode[1] Meaning
16#0001 A Read_Var request
16#0002 A Write_Var request
16#0004 A read MBP_MSTR request
16#0005 A write MBP_MSTR request
16#0006 Client parameter error detected
16#0007 Scanner parameter error detected

Serial Modbus-Modbus TCP/IP gateway


If the client is connected to the network through a serial Modbus-Modbus TCP/IP gateway, the
detected error is the same on level 0 and on level 1. The high byte is used for the level 1 diagnostic
code of the gateway client (that is, of the gateway itself) and the low byte is used for the diagnostic
code of the actual client:
Level 1: 16#ppcc Where pp represents the gateway detected error and cc the client detected error
If the detected error comes from the Gateway, the low byte of the word is FF.
Example:
FailCode [1] 16#02FF
FailCode [0] 16#xxxx
In this case, the client is reporting that the code for level 0 (xxxx) was returned by the Write_Var
function through the Gateway.

104 EIO0000002091 04/2020


Diagnostic Information Management Codes

Another example:
FailCode [1] 16#0006
FailCode [0] 16#xxxx
In this case, the system is normal. The client returns the level 0 code due to a parameter detected
error.

EIO0000002091 04/2020 105


Diagnostic Information Management Codes

Read_Var and Write_Var Diagnostic Codes

Description
For FailCode[1]:

FailCode[1] Meaning
16#0001 A Read_Var request
16#0002 A Write_Var request

For FailCode[0] (without Advantys bridge):

FailCode[0] Meaning
16#0001 Exchange stopped due to timeout
16#0002 Exchange stopped following a user request (CANCEL) / Init request initiated
in the port block.
16#0003 Incorrect address format
16#0004 Incorrect destination address
16#0005 Incorrect management parameter format
16#0006 Incorrect specific parameters
16#0007 Interruption while transmitting to the destination
16#0009 Insufficient reception buffer size
16#000A Insufficient transmission buffer size
16#000B Not enough processor system resources
16#000C Incorrect exchange number
16#000D No frames have been received
16#000E Incorrect length
16#000F Frame service not configured
16#0010 Missing network coupler
16#0011 No request present
16#0012 Application server already active
16#0013 Incorrect UNI-TE V2 transaction number
16#00FF Message rejected
16#0100 Request not processed
16#0200 Incorrect response
16#01FF No processor resources
16#02FF No line resources
16#04FF Incorrect line

106 EIO0000002091 04/2020


Diagnostic Information Management Codes

FailCode[0] Meaning
16#05FF Incorrect length
16#06FF Inoperable communication channel
16#07FF Invalid addressing
16#08FF Invalid application
16#0BFF No system resources
16#0CFF Inactive communication function
16#0DFF Destination not present
16#0FFF Non-authorized access between stations or non-configured channel
16#11FF Non-managed address format
16#12FF No destination resources
16#14FF Non-operational connection (for example, Ethernet TCP/IP)
16#15FF No local channel resources
16#16FF Non-authorized access (for example, Ethernet TCP/IP)
16#17FF Inconsistent network configuration (for example, Ethernet TCP/IP)
16#18FF Connection temporarily unavailable
16#21FF Stopped application server
16#300B Timeout in Gateways serial bus
16#30FF Incorrect transmission

EIO0000002091 04/2020 107


Diagnostic Information Management Codes

MBP_MSTR Diagnostic Codes

Description
For FailCode[1]:

FailCode [1] Meaning


16#0004 A read MBP_MSTR request
16#0005 A write MBP_MSTR request

For FailCode[0]:

FailCode [0] Meaning


16#0002 Init request initiated in port block.
16#1001 Interruption on behalf of user.
16#2001 An operation type that is not supported is defined in the control block.
16#2002 One or several control block parameters are modified while the MSTR
element is active (only valid for operations that require several cycles to
end). You can modify the control block parameters when the MSTR
element is inactive.
16#2003 Invalid value in the control block length field.
16#2004 Invalid value in the control block offset field.
16#2005 Invalid value in the control block length and offset fields.
16#2006 Data field not allowed on slave.
16#2007 Network field not allowed on slave.
16#2008 Network access path not allowed on slave.
16#2009 Access path equivalent to its own address.
16#2010 Attempt to receive a larger number of global data words than is available.
16#2014 The control block is not assigned, or parts of the control block are located
outside of the configured %MW (4x) area.
16#3001 Slave does not support requested operation.
16#3002 Registers from a non-existent slave have been requested.
16#3003 A data value that is not supported was requested.
16#3005 The slave has received a long program command.
16#3006 The function cannot be executed: A long command is being executed.
16#3007 The slave has rejected a long program command.
16#3011 The request has timed out on the gateway.
16#4001 Inconsistent response through Modbus slave.
16#5001 Inconsistent response through network.

108 EIO0000002091 04/2020


Diagnostic Information Management Codes

FailCode [0] Meaning


16#5056 Non-operational TCP connection.
16#6001 No response has been received.
16#6002 Access to a program denied.
16#6003 Disconnected node. Communication is impossible.
16#6004 Extraordinary response received.
16#6005 Busy router node data paths.
16#6006 The slave is in detected error state.
16#6007 Bad destination address.
16#6008 Non-supported node type in access path.
16#6010 The slave rejected the command.
16#6020 The slave has forgotten the activated transaction.
16#6040 An unexpected master output path has been received.
16#6080 An unexpected response has been received.
16#6101 Detected error in first device on the path. No response has been
received.
16#6102 Detected error in first device on the path. Access to a program denied.
16#6103 Detected error in first device on the path. Disconnected node.
Communication is impossible.
16#6104 Detected error in first device on the path. Extraordinary response
received.
16#6105 Detected error in first device on the path. Busy router node data paths.
16#6106 Detected error in first device on the path. The slave was not responding.
16#6107 Detected error in first device on the path. Bad destination address.
16#6108 Detected error in first device on the path. Non-supported node type in
access path.
16#6110 Detected error in first device on the path. The slave has rejected the
command.
16#6120 Detected error in first device on the path. The slave has forgotten the
activated transaction.
16#6140 Detected error in first device on the path. An unexpected master output
path has been received.
16#6180 Detected error in first device on the path. An unexpected response has
been received.
16#6201 Detected error in second device on the path. No response has been
received.
16#6202 Detected error in second device on the path. Access to a program
denied.

EIO0000002091 04/2020 109


Diagnostic Information Management Codes

FailCode [0] Meaning


16#6203 Detected error in second device on the path. Disconnected node.
Communication is impossible.
16#6204 Detected error in second device on the path. Extraordinary response
received.
16#6205 Detected error in second device on the path. Busy router node data
paths.
16#6206 Detected error in second device on the path. The slave was not
responding.
16#6207 Detected error in second device on the path. Bad destination address.
16#6208 Detected error in second device on the path. Non-supported node type
in access path.
16#6210 Detected error in second device on the path. The slave has rejected the
command.
16#6220 Detected error in second device on the path. The slave has forgotten the
activated transaction.
16#6240 Detected error in second device on the path. An unexpected master
output path has been received.
16#6280 Detected error in second device on the path. An unexpected response
has been received.
16#6301 Detected error in third device on the path. No response has been
received.
16#6302 Detected error in third device on the path. Access to a program denied.
16#6303 Detected error in third device on the path. Disconnected node.
Communication is impossible.
16#6304 Detected error in third device on the path. Extraordinary response
received.
16#6305 Detected error in third device on the path. Busy router node data paths.
16#6306 Detected error in third device on the path. The slave was not responding.
16#6307 Detected error in third device on the path. Bad destination address.
16#6308 Detected error in third device on the path. Non-supported node type in
access pat.h
16#6310 Detected error in third device on the path. The slave has rejected the
command.
16#6320 Detected error in third device on the path. The slave has forgotten the
activated transaction.
16#6340 Detected error in third device on the path. An unexpected master output
path has been received.

110 EIO0000002091 04/2020


Diagnostic Information Management Codes

FailCode [0] Meaning


16#6380 Detected error in third device on the path. An unexpected response has
been received.
16#6144 A wrong destination node was specified for the MSTR operation.

EIO0000002091 04/2020 111


Diagnostic Information Management Codes

Client Parameter Diagnostic Codes

Description
For FailCode[1]:

FailCode[1] Meaning
16#0006 Client parameter detected error

For FailCode[0]:

FailCode[0] Meaning
16#2001 Invalid request length
16#2003 Invalid slave address
16#2010 No data buffer
16#2011 Data buffer size insufficient to execute the request
16#2012 Request length larger than specified MaxReadSize
16#2020 No data buffer
16#2021 Data buffer size insufficient to execute the request
16#2022 Invalid request length
16#2023 Request length larger than specified MaxWriteSize
16#2100 Insufficient WorkMemory size
16#2101 There are clients called after the communication port, or not called
continuously

112 EIO0000002091 04/2020


Diagnostic Information Management Codes

Scanner Parameter Diagnostic Codes

General
For FailCode[1]:

FailCode[1] Meaning
16#0007 Scanner parameter detected error

For FailCode[0]:

FailCode[0] Meaning
16#1001 Data buffer size insufficient to execute read request 1
16#1002 Data buffer size insufficient to execute read request 2
16#1003 Data buffer size insufficient to execute read request 3
16#1004 Data buffer size insufficient to execute read request 4
16#1005 Data buffer size insufficient to execute read request 5
16#1006 Data buffer size insufficient to execute read request 6
16#1007 Data buffer size insufficient to execute read request 7
16#1008 Data buffer size insufficient to execute read request 8
16#1009 Data buffer size insufficient to execute read request 9
16#1010 Data buffer size insufficient to execute read request 10
16#2001 Data buffer size insufficient to execute write request 1
16#2002 Data buffer size insufficient to execute write request 2
16#2003 Data buffer size insufficient to execute write request 3
16#2004 Data buffer size insufficient to execute write request 4
16#2005 Data buffer size insufficient to execute write request 5
16#2006 Data buffer size insufficient to execute write request 6
16#2007 Data buffer size insufficient to execute write request 7
16#2008 Data buffer size insufficient to execute write request 8
16#2009 Data buffer size insufficient to execute write request 9
16#2010 Data buffer size insufficient to execute write request 10
16#3000 The input parameter arrays have different lengths

EIO0000002091 04/2020 113


Diagnostic Information Management Codes

EthernetIP Communication Diagnostic Codes

Description
For FailCode[1]:

FailCode [1] Meaning


16#0001 Data_Exch Communication error.
16#0002 Data_Exch Report error
16#0003 System Event
16#0004 Protocol Error
16#0005 Generic request error
16#0006 Parameter fault

Below given tables give the information of values of FailCode [0] for different values of
FailCode[1].
For FailCode[1] = 1

FailCode [0] Meaning


16#01 Exchange stop on timeout
NOTE: OK value returned when a Modicon M340 CPU sends a MODBUS
BROADCAST request.
16#02 Exchange stop on user request.
16#03 Incorrect address format.
16#04 Incorrect destination address.
16#05 Incorrect management parameter format.
16#06 Incorrect specific parameters.
16#07 Problem in sending to the destination.
16#08 Reserved.
16#09 Insufficient receive buffer size.
16#0A Insufficient send buffer size.
16#0B No system resources: The number of simultaneous communication EFs
exceeds the maximum that can be managed by the processor.
16#0C Incorrect Exchange number.
16#0D No telegram received.
16#0E Incorrect length.
16#0F Telegram service is not configured.
16#10 Network module is missing.

114 EIO0000002091 04/2020


Diagnostic Information Management Codes

FailCode [0] Meaning


16#11 Request missing.
16#12 Application server already active.
16#13 UNI-TE V2 transaction number incorrect.
16#FF Message refused.
NOTE: OK value returned when a TSX SCP*** or TSX SCY*** sends
a MODBUS BROADCAST request.

For FailCode[1] = 2

FailCode [0] Meaning


16#01 No resources toward the processor.
16#02 No line resources.
16#03 No device or device without resources.
16#04 Line error.
16#05 Length error.
16#06 Faulty communication channel.
16#07 Detected addressing error.
16#08 Detected application error.
16#0B No system resources: The number of simultaneous communication EFs
exceeds the maximum that can be managed by the processor.
16#0C Communication function not active.
16#0D Destination missing
16#0F Intra-station routing problem or channel not configured.
16#11 Address format not managed.
16#12 No destination resources.
16#14 Non-operational connection. Foe example, Ethernet TCP/IP.
16#15 No resource on the local channel.
16#16 Access not authorized. For example, Ethernet TCP/IP
16#17 Inconsistent network configuration. For example, Ethernet TCP/IP.
16#18 Connection temporarily unavailable.
16#21 Application server stopped.
16#30 Detected transmission error.

EIO0000002091 04/2020 115


Diagnostic Information Management Codes

For FailCode[1] = 3

FailCode [0] Meaning


16#800D Timeout on the explicit message request.
16#8012 Inoperable device.
16#8015 Either:
 Neither resources to handle the message, nor
 Internal detected error: No buffer available, no link available, not
possible to send to the TCP task.
16#8018 Either:
 Another explicit message for this device is in progress, or
 TCP connection or encapsulation session in progress.

16#8030 Timeout on the Forward_Open request.


NOTE: The following 16#81xx detected errors are Forward_Open response detected errors
that originate at the remote target and are received via the CIP connection.
16#8100 Faulty communication channel.
16#8103 Transport class and trigger combination not supported.
16#8106 Ownership conflict.
16#8107 Target connection not found.
16#8108 Invalid network connection parameter.
16#8109 Invalid connection size.
16#8110 Target for connection not configured.
16#8111 RPI not supported.
16#8113 Out of connections.
16#8114 Vendor ID or product code mismatch.
16#8115 Product type mismatch.
16#8116 Revision mismatch.
16#8117 Invalid produced or consumed application path.
16#8149 Secondary resources available.
16#814A Rack connection already established.
16#814B Module connection already established.
16#814C Miscellaneous
16#814D Redundant connection mismatch.
16#814E No more user-configurable link consumer resources: The configured
number of resources for a producing application has reached the limit.
16#814F No more user-configurable link consumer resources: There are no
consumers configured for a producing application to use.
16#8160 Vendor specific.

116 EIO0000002091 04/2020


Diagnostic Information Management Codes

FailCode [0] Meaning


16#8170 No target application data available.
16#8171 No originator application data available.
16#8173 Not configured for off-subnet multicast.
16#81A0 Detected error in data assignment.
16#81B0 Optional object state detected error.
16#81C0 Optional device state detected error.
NOTE: All 16#82xx detected errors are register session response detected errors.
16#8200 Target device does not have sufficient resources.
16#8208 Target device does not recognize message encapsulation header.
16#820F Reserved or unknown detected error from target.

For FailCode[1] = 4

FailCode [0] Meaning


16#00 Success.
16#01 Connection unsuccessful.
16#02 Resource unavailable.
16#03 Invalid parameter value.
16#04 Path segment error.
16#05 Path destination unknown.
16#06 Partial transfer.
16#07 Connection lost.
16#08 Service not supported.
16#09 Invalid attribute value.
16#0A Attribute list error.
16#0B Already in requested mode/state.
16#0C Object state conflict.
16#0D Object already exists.
16#0E Attribute not settable.
16#0F Privilege violation.
16#10 Device state conflict.
16#11 Reply data too large.
16#12 Fragmentation of primitive value.
16#13 Not enough data.
16#14 Attribute not supported.

EIO0000002091 04/2020 117


Diagnostic Information Management Codes

FailCode [0] Meaning


16#15 Too much data.
16#16 Object does not exist.
16#17 Service fragmentation sequence not in progress.
16#18 No stored attribute data.
16#19 Store operation unsuccessful.
16#1A Routing unsuccessful, request packet too large.
16#1B Routing unsuccessful, response packet too large.
16#1C Missing attribute list entry data.
16#1D Invalid value list.
16#1E Embedded detected service error.
16#1F Vendor specific error.
16#20 Invalid parameter.
16#21 Write-once value or medium written.
16#22 Invalid reply received.

For FailCode[1] = 5

FailCode [0] Meaning


16#3001 Client timeout error.
16#3002 Port was initialized while processing the request.

For FailCode[1] = 6

FailCode [0] Meaning


16#2050 Client timeout error.
16#2001 Invalid request length.
16#2010 Insufficient request data buffer.
16#2011 Insufficient response data buffer.

118 EIO0000002091 04/2020


Modicon Libraries General Purpose
Communication Technologies
EIO0000002091 04/2020

Part VI
Communication Technologies

Communication Technologies

Overview
This part explains about communication technologies.

What Is in This Part?


This part contains the following chapters:
Chapter Chapter Name Page
13 Supported Architectures 121
14 Ethernet Technology 125
15 Gateway Technology 131
16 Modbus Technology 139
17 EthernetIP Technology 143

EIO0000002091 04/2020 119


Communication Technologies

120 EIO0000002091 04/2020


Modicon Libraries General Purpose
Supported Architectures
EIO0000002091 04/2020

Chapter 13
Supported Architectures

Supported Architectures

Device/Communication Port Architectures

Device/Communication Port Matrix


The following table describes the architectures that General Purpose library supports for managing
communication between controllers and devices.

Device family Device Controller family Required communication port blocks


Circuit Compact NSX M340 ModbusPortM
Breakers ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
Masterpact M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
Masterpact Draw- M340 ModbusPortM
Out ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
Digital Sepam 20 M340 ModbusPortM
Protective ModBusGateway ModbusEthernetPortM
Relays
Quantum ModBusGateway ModbusEthernetPortQ
Sepam 40 M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
Sepam 80 M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
1 No Communication port is required for I/O scanning. Instead, in addition to the application device template,
instantiate the topological template that corresponds to the device to create the communication channels between
the controller and the device.

EIO0000002091 04/2020 121


Supported Architectures

Device family Device Controller family Required communication port blocks


Motor Tesys T M340 ModbusEthernetPortM
Controllers ModbusPortM ModBusGateway
and Starters
Quantum ModBusGateway ModbusEthernetPortQ
Tesys U M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
Power PM 700 M340 ModbusPortM
Monitoring ModBusGateway ModbusEthernetPortM
Devices
Quantum ModBusGateway ModbusEthernetPortQ
PM 800 M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
PM 1200 M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
PM 9C M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
MBSMARTUPS M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
ACCUSINE M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
Progressive ATS 22 M340 ModbusPortM
Starters ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
ATS 48 M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
1 No Communication port is required for I/O scanning. Instead, in addition to the application device template,
instantiate the topological template that corresponds to the device to create the communication channels between
the controller and the device.

122 EIO0000002091 04/2020


Supported Architectures

Device family Device Controller family Required communication port blocks


Variable ATV 12 M340 ModbusPortM
Speed Drives ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
ATV 31 M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
ATV 312 M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
ATV 212 M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
1 No Communication port is required for I/O scanning. Instead, in addition to the application device template,
instantiate the topological template that corresponds to the device to create the communication channels between
the controller and the device.

EIO0000002091 04/2020 123


Supported Architectures

Device family Device Controller family Required communication port blocks


Variable ATV 61 M340 ModbusEthernetPortM
Speed Drives Quantum ModbusEthernetPortQ
M340 EATV61HW(1)
Quantum
M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
ATV 71 M340 ModbusEthernetPortM
Quantum ModbusEthernetPortQ
M340/M580 EATV71HW(1)
Quantum
M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
ATV 6xx M340 ModbusEthernetPortM
Quantum ModbusEthernetPortQ
M340 EATV71HW(1)
Quantum
M340 ModbusPortM
ModBusGateway ModbusEthernetPortM
Quantum ModBusGateway ModbusEthernetPortQ
PBATV7161 M340 PRMMgtM
Quantum PRMMgtQ
1 No Communication port is required for I/O scanning. Instead, in addition to the application device template,
instantiate the topological template that corresponds to the device to create the communication channels between
the controller and the device.

124 EIO0000002091 04/2020


Modicon Libraries General Purpose
Ethernet Technology
EIO0000002091 04/2020

Chapter 14
Ethernet Technology

Ethernet Technology

Overview
This chapter describes the Ethernet technology.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Ethernet Communication Architecture 126
Addressing Example for the M340/M580 Platform 128
Addressing Example for the Quantum Platform 129

EIO0000002091 04/2020 125


Ethernet Technology

Ethernet Communication Architecture

Architecture Diagram
The following diagram represents Ethernet communication architecture.

Description
This first part allows to correctly address the Ethernet client DFB components that have to carry
out non-cyclic messaging through the various Ethernet port DFB components.
Depending on the PLC platform used, IP addressing for Ethernet clients varies and needs to be
handled separately. Independently of the PLC platform used, acyclic messaging requires an
Ethernet port. IP addressing is implemented with the DeviceAddress input variable.
The Ethernet port DFB component carries out the Modbus TCP/IP request by means of
Read_Var, Write_Var, or MBP_MSTR-type instructions in Quantum. Hence, the clients message
is sent through WorkMemory.

126 EIO0000002091 04/2020


Ethernet Technology

Depending on the platform, the following definitions apply:

Platform Device Addressing Gateway Port Addressing


Addressing
M340/M580 CPU '{IP}ID' '{IP}' 'Rack Number.Slot Number.Channel
Number'
NOE
and
NOC
Quantum CPU '{IP}ID' '{IP}' ‘254’
NOE 'Slot or Rack
and Number.SlotNumber.ChannelNumber'
NOC (In case of ModbusPortQX80)

If the destination device is another CPU with an Ethernet port, the above table applies.

EIO0000002091 04/2020 127


Ethernet Technology

Addressing Example for the M340/M580 Platform

WARNING
UNINTENDED EQUIPMENT OPERATION
Adapt the below examples to configure device or communication network parameters before you
implement them.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

Description
The current platform allows addressing with the name of the channel through which the Modbus
TCP/IP requests are made.
Addressing for the Ethernet client with M340/M580 needs to be as in the following example
(addressing for an ModBusScanner, DeviceAddress needs to be implemented the same way):

The ID ({IP}ID) is necessary and is based on the slave addressing and ranges from 0 to 255. For
example, if it is an ATV71; 0 = ATV71 variant, 251= Ethernet card, 252 = Controller inside, 255 =
IO Scanning.
Regarding the Ethernet port DFB component to/from which the client transmits/receives external
requests with WorkMemory, you need to define the public variable based on address table
(see page 126).

128 EIO0000002091 04/2020


Ethernet Technology

Addressing Example for the Quantum Platform

Introduction
Quantum platforms do not have XWAY addressing because the instructions they use for Modbus
TCP/IP communication do not require this type of addressing.
Depending on the physical location of the Ethernet port, communication is to be established.

The ID ({IP}ID) is necessary and is based on the slave addressing and ranges from 0 to 255.

EIO0000002091 04/2020 129


Ethernet Technology

130 EIO0000002091 04/2020


Modicon Libraries General Purpose
Gateway technology
EIO0000002091 04/2020

Chapter 15
Gateway Technology

Gateway Technology

Overview
This chapter describes the Gateway technology.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Gateway Communication Architecture 132
Addressing Example for the M340/M580 Platform 134
Addressing Example for the Quantum Platform 136

EIO0000002091 04/2020 131


Gateway technology

Gateway Communication Architecture

Architecture Diagram
The following diagram represents the architecture used in communication implemented with a
Serial Modbus-Modbus TCP/IP Gateway:

132 EIO0000002091 04/2020


Gateway technology

Description
This part enables you to correctly address the Modbus client/scanner components that have to
carry out non-cyclic messaging through Modbus Ethernet gateways and the various Ethernet port
instances.
Depending on the PLC platform to be used, IP addressing for Ethernet clients varies and needs to
be handled separately. Independent of the PLC platform used, acyclic messaging requires an
Ethernet gateway instance (ModBusGateway). IP addressing is implemented with the
DeviceAddress input variable.
The Ethernet Modbus TCP/IP-Serial Modbus gateway component receives requests from the
Modbus slaves (clients/scanners) through WorkMemoryRS485 and converts them into serial
Modbus requests for the Ethernet port.
The programmed Ethernet port instance sends the Modbus TCP/IP request by means of
Read_Var, Write_Var, or MBP_MSTR-type instructions in Quantum. Because of this, the clients
message is sent through EthernetWorkMemory.
Depending on the platform, the following definitions apply:

Platform Gateway Addressing Client/Scanner Addressing


ModbusAddress (variable)
M340/M580/Quantum ‘{IP}’ Modbus slave number

NOTE: Do not omit the punctuation marks.

EIO0000002091 04/2020 133


Gateway technology

Addressing Example for the M340/M580 Platform

WARNING
UNINTENDED EQUIPMENT OPERATION
Adapt the below examples to configure device or communication network parameters before you
implement them.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

Introduction
In this programming example, an M340/M580 series PLC sends requests to a Modbus slave (slave
number 3) through a Serial Modbus-Modbus TCP/IP Gateway. This example has a client on
Modbus (addressing in ModbusAddress and an ModBusScanner with various WorkMemorys
need to be implemented the same way).
The name of the EGtwMB_MBWorkMemory variable needs to be same in the ModBusCli-
entBasic and ModBusGateway.
The name of the EMPortM_EWorkMemory variable needs to be same in the ModBusGateway and
EPortP.

Modbus Slave with Address 3

134 EIO0000002091 04/2020


Gateway technology

The result of the read operation will be found in MBClientBs_Data after MBClientBs_End has
been activated. To carry out a write operation, the values to be written are found in
MBClientBs_Data.

Modbus TCP/IP – Serial Modbus Gateway


The IP address needs to be entered into the GatewayAddress input variable.

Ethernet Port
The DFB has a public variable PortAddress in which the number of the slot needs to be entered.
The PLC sends requests to the slave through this channel (see page 126).

The name of the EGtwMB_MBWorkMemory variable needs to be same in the ModBusCli-


entBasic and ModBusGateway.
The name of the EMPortM_EWorkMemory variable needs to be same in the ModBusGateway and
ModbusEthernetPortM.

EIO0000002091 04/2020 135


Gateway technology

Addressing Example for the Quantum Platform

General
The following figure represents the addressing example for the Quantum platform.

The objective is to establish communication between a Quantum PLC with an ATS48 Modbus
slave (Modbus slave number 3) through a Modbus Ethernet-Serial Modbus Gateway to write to the
cascade function activation register (register 4058).

136 EIO0000002091 04/2020


Gateway technology

Modbus Slave - ATS48 Speed Driver with Address 3

Modbus TCP/IP – Serial Modbus Gateway


The Ethernet address needs to be addressed correctly. Communication is carried out through the
PLC integrated port.

EIO0000002091 04/2020 137


Gateway technology

Ethernet Port

The name of the EGtwMB_MBWorkMemory variable needs to be same in the ModBusCli-


entBasic and ModBusGateway.
The name of the EPortQ_EWorkMemory variable needs to be same in the ModBusGateway and
ModbusEthernetPortQ.

138 EIO0000002091 04/2020


Modicon Libraries General Purpose
Modbus Technology
EIO0000002091 04/2020

Chapter 16
Modbus Technology

Modbus Technology

Overview
This chapter describes the Modbus technology.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Modbus Communication Architecture 140
Addressing Example for the Modicon M340/M580 Platform 141

EIO0000002091 04/2020 139


Modbus Technology

Modbus Communication Architecture

Architecture Diagram
The following figure represents the Modbus communication architecture.

140 EIO0000002091 04/2020


Modbus Technology

Addressing Example for the Modicon M340/M580 Platform

WARNING
UNINTENDED EQUIPMENT OPERATION
Adapt the below examples to configure device or communication network parameters before you
implement them.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

Introduction
A Modicon M340/M580 PLC is used in this example to read the value of the ACC and DEC
(registers 9001 and 9002) of the ATV 31 speed driver with slave number 1.

NOTE: This example can be applied to any CPU of the Modicon M340/M580 families that can
communicate on Modbus.

EIO0000002091 04/2020 141


Modbus Technology

ModBusClientBasic - Client with Address 1

The first register of the MBClientBs_Data[0] array holds the acceleration value. The second
register holds the deceleration read from the device every time that MBClientBs_Start is TRUE
and the MBClientBs_End reading operation ends in TRUE.

Modbus Port

The name of the MBPortM_MBWorkMemory variable needs to be same in the ModBusCli-


entBasic and ModbusPortM.

142 EIO0000002091 04/2020


Modicon Libraries General Purpose
EthernetIP Technology
EIO0000002091 04/2020

Chapter 17
EthernetIP Technology

EthernetIP Technology

Overview
This chapter describes the EthernetIP technology.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Ethernet IP Communication Architecture 144
EIPPort Client Configuration 145

EIO0000002091 04/2020 143


EthernetIP Technology

Ethernet IP Communication Architecture

Architecture Diagram
The following figure represents the Ethernet IP communication architecture.

144 EIO0000002091 04/2020


EthernetIP Technology

EIPPort Client Configuration

Overview
In this section, the configuration required for establishing communication on EIP unconnected
explicit messaging is detailed. The configuration is detailed with an example using the EIP Port and
client block which will execute a Get_Single attribute service.
NOTE: The project setting Force References Initialization should be unchecked while using EIP
port and client

Instantiation

Step Action
1 Instantiate EthernetIPClient DFB and EthernetIPPortxx DFB.
NOTE: The Port DFB should be selected based on the controller family.
2 Declare Failcode variable and the WorkMemory variable and link them to the Failcode and
WorkMemory pin respectively of the EthernetIPClient DFB (mandatory).
3 Link the same WorkMemory variable to the EthernetIPPortxx DFB.

EIO0000002091 04/2020 145


EthernetIP Technology

Configuration in Client

Step Action
1 Define the device address (Only IP Address). For example, {192.168.1.25}
2 Configure the service ID to be executed.
NOTE: If the service ID is in Hexadecimal format, prefix 16# has to be used while configuring.
For example 16#0E.
3 Define a variable of required array size and connect to the ResponseData pin of
EthernetIPClient DFB
4 Configure the ClassID, InstanceID and AttributeID on which the service has to be
executed.

NOTE: If the service ID is in Hexadecimal format, prefix 16# has to be used while configuring.
For example 16#0E.

146 EIO0000002091 04/2020


EthernetIP Technology

Configuration in Port

Step Action
1 Configure the PortAddress, SimultaneousSends and Timeout in the EngParam of Port,
as shown in the below example.

NOTE:
 On initialization all statistics data will be reset.
 Valid range of SimultaneousSends is 1 to xx. The value of SimultaneousSends remains 1 if the
entered value is less than 1, similarly the value of SimultaneousSends remains xx if the entered
value is greater than xx.
 In case of Set_Attribute_List (Service Code is 03hex) and Get_Attribute_List
(Service Code is 04hex) services, if reading/ writing of any attribute in the list interrupts, the
whole request is considered as a success and no detected error is notified by the protocol. The
user application has to take care of this scenario and interpret the data.

EIO0000002091 04/2020 147


EthernetIP Technology

148 EIO0000002091 04/2020


Modicon Libraries General Purpose

EIO0000002091 04/2020

Appendices

EIO0000002091 04/2020 149


150 EIO0000002091 04/2020
Modicon Libraries General Purpose
Editing the WorkMemory Array Size
EIO0000002091 04/2020

Appendix A
Editing the WorkMemory Array Size

Editing the WorkMemory Array Size

The necessary size for the array of the variable associated to WorkMemory is automatically
calculated by the DFBs of the port shown by the WantedArraySize output.
Check if the size of the array for the WorkMemory variable of the Port DFB, has a size ≥
WantedArraySize, else edit the size of the array as described in the following example.
Example with a ModbusEthernetPortM DFB:

The following table describes the procedure to check the value of the WantedArraySize output:

Step Action
1 Execute the program with the calculated array.
2 In the Control Participant Project Browser, click Variables & FB Instances→
Derived FB Instances→EMPortM and check the value returned by the
ModbusEthernetPortM DFB.

EIO0000002091 04/2020 151


Editing the WorkMemory Array Size

The following table describes the procedure to edit the size of the array for the WorkMemory
variable of the Port DFB:

Step Action
1 In the Control Participant Project Browser, click Variables & FB Instances→
Elementary Variables→EMPortM.
2 Edit the value of WorkMemory in the Type column of the variable.

NOTE: The array should have a size of [0... WantedArraySize-1] as a


minimum).

152 EIO0000002091 04/2020


Modicon Libraries General Purpose
Index
EIO0000002091 04/2020

Index

A Gateway technology
addressing example for the M340/M580
architectures
platform, 134
supported communication architectures,
addressing example for the Quantum
121
platform, 136
Gateway communication architecture,
132
C general
communication communication DFBs overview, 17
device-communication matrix, 121 general concepts, 19
supported architectures, 121 General Purpose communication compo-
communication technologies nents, 15
Ethernet technology, 125 general concepts
Gateway technology, 131 communication process diagram, 21
Modbus technology, 139 logical architecture - communication, 20

D L
diagnostic information management logical architecture - communication
diagnostic information management basics, 20
codes, 103 gateway, 20
memory management, 20
E
Ethernet communication architecture M
description, 126 memory
diagram, 126 WorkMemory array size, 151
Ethernet technology Modbus communication
addressing example for M340/M580 plat- ModBusScanner, 47
form, 128 Port Profile, 35
addressing example for Quantum plat- Modbus communication architecture
form, 129 diagram, 140
Ethernet communication architecture, Modbus TCP Ethernet communication
126 ModBusGateway, 57
Modbus technology
addressing example for the Modicon
G M340/M580 platform, 141
Gateway communication architecture Modbus communication architecture, 140
description, 133
diagram, 132

EIO0000002091 04/2020 153


Index

P
Profibus
PRMMgt, 93

W
WorkMemory
checking array size, 151
editing array size, 151

154 EIO0000002091 04/2020

You might also like