Redlion MPiec Modbus Configuration W Crimson2 v007
Redlion MPiec Modbus Configuration W Crimson2 v007
Redlion MPiec Modbus Configuration W Crimson2 v007
QuickStart Guide
Doc#: AN.MCD.08.122 Copyright Yaskawa Electric America 2008 September 23, 2013
Page 1 of 10
Subject: Tech Note and Sample Code Product: MPiec Doc#: AN.MCD.08.122
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
Table of Contents
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
1. Application Overview:
This document is intended to guide a user through the steps of configuring a RedLion HMI as a MODBUS master
communicating with the MPiec controller as a slave. This application note was created with a G310 series HMI
with Crimson 2.0 software. The MPiec controller has firmware version 1.0.0.1 and MotionWorks IEC Express
software version 1.0.0.1.
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
Products Used:
Hardware Sigma series servopack and motor, RedLion G310 HMI, Ethernet switch
2. Configuration Procedure
I. Set the IP addresses of the devices (HMI, controller, PC with programs). In the test set up, the IP
addresses were: Controller: 192.168.1.1, HMI: 192.168.1.2, PC: 192.168.1.3
The default IP address on the MPiec controller is 192.168.1.1 unless changed by a user.
II. To set the IP address of the RedLion G310: On the opening page of Crimson 2.0, double click on the
communications tab.
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
Double click on Ethernet and set the IP address of the HMI as shown in Figure 4.
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
Figure 7 shows the Modbus memory map, and how it relates to the Global Variables in MotionWorks IEC.
Note that function codes 01 and 03 return data that was sent to the controller from the master and do not
reflect data from the Global Variables in the application program.
The Modbus data memory is copied to the Global Variables at the task update rate.
Modbus coil 0 equates to the Global Variable at %IX24560. 128 coils are available.
Modbus register 40000 equates to the Global Variable at %IW28672. 1024 registers are available.
Modbus input 10000 equates to the Global Variable at %QX24560. 128 inputs are available.
Modbus register 30000 equates to the Global Variable at %QW28672. 1024 registers are available.
As shown in Figure 7a below, the input and output memory is in a different location even though they
have the same numerical addressing.
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
IV. Launch the Hardware Configuration in MotionWorks IEC. Connect to the controller through the hardware
configuration. Select the MODBUS TCP option and enable the controller as a MODBUS slave. Save this
configuration and reboot the controller. These steps will activate the MODBUS communication driver on
the MPiec controller.
Figure 7b: Enabling the MPiec controller as a MODBUS TCP slave (server)
V. The global variables worksheet in MotionWorks IEC will now have MODBUS TCP groups which will
have to be populated by the user. These memory areas are generic: no variables are automatically
created, the user can decide on the arrangement and type of data to populate within the communications
memory region
A word coming from the HMI will be mapped from register 40001 in the RedLion to %IB28672. The
user should verify the data type used for data transfer. Bits written from the HMI to the controller are
mapped from 00001 to %IX24560.0. Outputs from the controller are mapped from %QB28672
->300001 and %QX24560.0 -> 10001
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
3. HMI variables
Create output bits/words on the HMI.
1. ServoStatus
2. InVelocity
3. Actual Position
4. Actual Velocity
5. Actual Torque
The variable tags have been defined in the data tags tab in the RedLion project.
When creating a new tag, the user can specify the data type of the tag. The user can also map the tag
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
and specify what register location that tag should be associated with. For example, the tag
ServoEnable is mapped to a location in PLC1, which is the slave IEC controller. On clicking the edit
button, the register and data type can be seen as shown in Figure 10. It can be seen that a bit was
chosen as the data type. The register to which that tag is mapped is 00001 and it is a coil. This bit will
be mapped to the first bit mapped under Function Code (FC) 5. The access to this tag is set as Write
Only as this variable is used for writing to the controller. FWD and REV are similar bit tags. The Jog
speed tag mapping is shown in Figure 11. A word swap transformation is carried out for words. The
register used for the word is 40001. Figure 12 illustrates the mapping of a tag that is a read access
variable that reads the servo status from the controller to display at the HMI panel. Figure 13 illustrates
a controller output real variable displayed at the HMI.
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
The global variable list with the MODBUS variables being used is shown in detail in Figure 14. The first two
groups corresponding to function codes 05 and 16 are the input variables written from the HMI to the controller.
The groups under function codes 02 and 04 are used to transfer variables from the controller to the HMI. They
are denoted by %QX and %QB. Table 1 shows the variable mapping in this sample project.
Title: Quickstart guide to configure RedLion HMI and MPiec controller communication via MODBUS
5. Execution
Communication between the Red Lion HMI and the MPiec controller should commence as soon as the
two projects start running on the two devices.