Beruflich Dokumente
Kultur Dokumente
Table of Contents
1.
Introduction .......................................................................................................................................... 2
2.
3.
4.
3.1
3.2
3.3
3.4
3.5
4.2
ModBus Communication.............................................................................................................. 9
4.3
4.4
4.5
1. Introduction
PLCs have been in use since very long and have always had the
advantage of being small and inexpensive. They are widely
used in small scale independent operations. The use of PLCs as
an intermediary communication device is also fast growing
because of the cost advantages.
A PLC can communicate in various protocols like Ethernet,
ModBus, Profibus, DeviceNet, CAN, etc.
This document describes the process to configure a PLC to
communicate with Multi-Function Meters (MFM) used for
Energy Monitoring over Modbus RTU and Profibus to
communicate with 800xA DCS.
2. Device Details
The details of the Hardware, Communication Protocols and the Software used during this document is
as follows:
PLC
PLC - Device Protocol
PLC - DCS Protocol
MFM Model
PLC Configuration Software
PLC Programing Software
AC500 PM573-ETH
Modbus RTU
(PLC as Master)
ProfiBus DP
(PLC as Slave)
Schneider Conzerv EM6400
PS501 Control Builder Plus Rev 2.3.0
CodeSys Rev 2.3.9.40
PS501 Control Builder Plus is the complete software suite and automatically installs CodeSys and the
Gateway OPC.
Control Builder Plus is used to configure the PLC and the connected hardware modules whereas CodeSys
is used for configuring the software. It is worthwhile to mention that CodeSys is completely integrated
into Control Builder Plus.
3. Procedure to Configure
Install PS501 Control Builder Plus from the installation media or by downloading the setup from Solution
Bank.
This will create a project with the AC500 PLC selected and its associated modules.
Once the PLC is found, click on it and scroll down to enter the new IP Address of the PLC. Click on send
to set the IP address. Make sure the PLC is in STOP mode before sending the new IP address.
COM 1
COM 2
RS-485 POSITVE
Pin 2
Pin 3
RS-458 NEGATIVE
Pin 3
Pin 8
To configure, go to Interfaces --> right click on COM 1 --> Plug Device. Now select COM 1
ModBus and select Plug Device and close.
Double click on the configured COM Port to open properties. Select RTS Control as Telegram and
Operation Mode as Client. This is done to configure the PLC as ModBus Master. Other parameters can
also be changed if required by the Slave Device.
Now that the PLC is configured as a ProfiBus Slave, the I/O Modules need to be added. Right click on the
FBP Port and select Add Device. In the new window, select 16 Word Input (IEC Output) to add a
module.
This single module can send 16 words of data to the ProfiBus Master (DCS). If more data needs to be
sent, add more modules. In case some data is to be received from DCS, add an appropriate module.
5
Please note the maximum data a ProfiBus Slave can send/receive is limited to 246 bytes. So the addition
of these modules should also be limited to stay within the threshold.
For the hardware connection, a PDP22 type FBP connects to the PLC. It has an IN port and an OUT port.
If the ProfiBus loop is terminating at the PLC, a terminating resistor, PDR11 must be used at the OUT
port. The PDP22 module requires +24V DC supply to be connected in order to work. Once powered, the
power LED starts glowing on the PDP22. For more details on FBP, refer ABB FBP Documentation.
4. Procedure to Program
Once the PLC has been configured, it has to be programed.
Save your project in Control Builder Plus. Double click on AC500 to open CodeSys. This uploads all
configuration data to CodeSys and opens the program editor. Make sure any configuration changes in
Control Builder Plus that you do are done only when CodeSys is closed.
CodeSys will open with only a single program: PLC_PRG. This is the main program which is executed
continuously. Any other functions / programs / code blocks must be called in this program for execution.
The editor is divided into Lines (in FBD). Multiple lines can be added and each line can have multiple
functions. These functions are called as Box. These lines are referred to as Network.
Right click on the first line --> select Box. This will insert a function (AND block
by default). Other options include Network (after), Network (before), Assign,
Jump, Comment and others.
Network (before/after) will add a new line.
Assign will open a dialog box to assign new variable.
Jump can be used to jump to a different code block.
Once the AND Block is inserted, the function can be changed by manually
entering the name of the desired function in place of AND.
The function block pins will change depending on the selected function. The ???
symbol stays till some variable is assigned to the pin. Click on ??? and enter the
variable name, if it is not declared, a dialog box will open to declare that variable
by selecting the data type and memory address.
In certain cases, the function block itself needs to be declared. Such blocks will have ??? on top of them
to declare a name for the function block. Simply enter a name and it will be declared.
This way multiple functions / function blocks can be added. If the language needs to be changed, right
click on the Function Block on the left and select Convert Object.
To execute these Function Blocks, go to PLC_PRG Program and enter the name of the Object Function
Block. This will call the function block for execution in a continuous loop.
Parameter
EN
COM
SLAVE
Data Type
BOOL
BYTE
BYTE
FCT
BYTE
TIMEOUT
ADDR
WORD
NB
DATA
DONE
ERR
ERNO
WORD
DWORD
BOOL
BOOL
WORD
Description
EN pin is used to enable the communication
COM pin is used to indicate whether its on COM1 or COM2
SLAVE pin is used to indicate the address of the slave
FCT pin is used to indicate the Function Code of the Slave,
generally the Holding Register
TIMEOUT is used to give the maximum timeout before error
ADDR is for the Slave register address from where the data is
to be read
NB is the number of data registers to be read
DATA is the address / location where the data is to be stored
DONE indicates that the Read Cycle is completed
ERR indicates an error in communication
ERNO indicates the error code.
In case of multiple slaves, multiple COM_MOD_MAST blocks must be used. In such a case, the EN of
succeeding block should be connected to the previous blocks DONE bit. This will allow a successive
execution, block after block.
Also important to note here is that the ADDR should be entered as Slave Data Address 1.
This way the data can be read from the slave device.
10
Go to Online menu on the top --> select Communication Parameters. In the new window, press
Gateway and select TCP/IP and other properties as
default.
Now select New --> TCP/IP and give a name to the
connection. In the address field, enter the IP address of the
PLC which has been set previously.
Once these parameters have been set, connect a LAN cable
from your PC to the PLC. Go to Online menu and select
Login. This will download the project. Login is similar to
the Download and go Online option in AC800M. To go offline, go to Online --> Logout.
Once the download is complete, go to Online menu and select Create Boot Project. This will save the
program to EEPROM. Make sure you are in Login/ Online mode when you Create a Boot Project.
To start the execution of the code, a RUN command has to be given to the PLC. This can be done by
going to Online menu --> Run.
Once all configuration is completed, Logout and save the project in CodeSys and exit CodeSys.
11
Once you have declared these variables, save the project and open CodeSys again. The variables
assigned in Control Builder Plus become Global Variables and can now be used in the Program to send
values.
12