Modbus – Yaskawa MP2000iec Series User Manual

Page 12

Advertising
background image

MP2000iec Series QRG Rev 3.3

MODBUS

Overview

Step Description

Detail

1

Add slave device to controller (master)

Go Online. Under Modbus TCP, "Add Slave Device".
Enter Name, IP Address of device. Name the global status
variable that will display the connection status of the device.
Set update interval at or higher than the task scan time.

2

Add input and output data blocks to the device

Click on the device under ModBus TCP.
Click "Add Data Block"
Enter the I/O Group name that will appear as a header in the
global variable list for that data block.
Choose the desired function code. FC#4 is Read Input
Registers. FC#16 is Write Multiple Registers
Starting address already includes any modbus offset, so use
address 1 for the first modbus data in the device.
# of Items is number of modbus words (16 bit word).

3

Enable Slave Device

Some slave devices are enabled when powered on.
When another MP2300Siec is used as a modbus slave, it must
be enabled by checking "enable controller as a modbus slave"

4

Activate changes to controller*

(A) Save, (B) Make, (C) Download, (D) Cycle Power. Be sure
controller is in RUN mode.
If the slave device is another MP2300Siec, do the same to
activate changes on the slave controller.

5

Verify communication to device

Monitor the staus variable that was named in Step 1.
Expect value of 16#1000 or 16#1400 indicating connected
status.

6

Create variables in controller (master)

In global variable list, note the address range for each data
block as given in the gray Group heading. (%IB for inputs, and
%QB for outputs)
Create variables with addresses in the range listed.
R-click "create variable set" to create several variables quickly.

7

Create variables in controller (slave)

If the slave device is another MP2300Siec, also go to its global
variable list.
Note the address range for each data block given in the gray
Group heading. (%IB for inputs, and %QB for outputs)
Create variables with addresses in the range listed.
R-click "create variable set" to create several variables quickly.

8

Activate changes to controller

Make and run the program with the new variabels. Monitor the
communication of variables and test operation of slave device.
If the data type is chosen as "word" or "byte", individual bits can
be selected in the variable declaration window. For example
"Var.X0" for bit zero of Variable "Var".

Common Mistakes
1. The controller is not in RUN mode (see resource tab)
2. Variables have the wrong address, or wrong type (I or Q)
3. I/O Driver Error - Repeat step 4 (Save, Make, Download, Cycle Power)

*

Data is sent over ethernet using two possible protocols; ModBus/TCP and Ethernet/IP. Modbus uses "Function
Codes" and EIP uses "Instances" as channels of communication between the controller and another device.
All configuration is accomplished using MotionWorks IEC Configuration Tool.

It is important to Save, Make, Download, Cycle Power in this order. Save creates controller configuration files,
and also creates I/O drivers in for the program. Make is required before cycling power, or else the controller will
run the old bootproject, which does not have the drivers to run the new hardware configuration (I/O driver Error).

Page 12 of 15

Advertising