R-IN32M3 Module (RY9012A0)

Document preview
File info: application/pdf · 25 pages · 1.23MB

R-IN32M3 Module (RY9012A0)

7

RIN32M3, module, Ethernet, Industrial, PROFINET, EtherNet/IP, EtherCAT, TwinCAT

The connection procedure described in this manual assumes that the following conditions are met. For the setup method of each evaluation board, refer to the application note corresponding to each sample software include…

Original Document

If the viewer doesn’t load, open the PDF directly.

Extracted Text

APPLICATION NOTE

R-IN32M3 Module (RY9012A0)
Software PLC Guide: TwinCAT

R30AN0380ED0201 Rev.2.01 2021.6.14

Introduction
This document explains the procedures for EtherCAT� slave functionalities with R-IN32M3 module.

Target Device
R-IN32M3 Module

Contents
1. Overview .........................................................................................................................3
1.1 Abstract ........................................................................................................................................ 3 1.2 Operating environment............................................................................................................... 3
1.2.1 Software environment .......................................................................................................... 3 1.2.2 Hardware environment ......................................................................................................... 4
2. Features ..........................................................................................................................5
3. TwinCAT3........................................................................................................................6
3.1 Pre-setup...................................................................................................................................... 6 3.1.1 ESI file .................................................................................................................................... 6 3.1.2 Network Adapter ................................................................................................................... 7
3.2 Run TwinCAT3............................................................................................................................. 8 3.2.1 TwinCAT setup ...................................................................................................................... 8 3.2.2 Scan module.......................................................................................................................... 9 3.2.3 Communication Status ....................................................................................................... 11
4. Sample Program...........................................................................................................12
4.1 Mirror Sample ............................................................................................................................ 12 4.2 Remote IO Sample .................................................................................................................... 14 4.3 Sensor Sample .......................................................................................................................... 16 4.4 Motor Sample............................................................................................................................. 18
Appendix-A. EtherCAT Driver Install ...............................................................................20
Appendix-B. EEPROM program .......................................................................................22
Notice .....................................................................................................................................2

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 1 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

List of Abbreviations and Acronyms
In this document, the terms below are defined as follows.

Terms EEPROM ESC PDO SII

Description Electrically Erasable Programmable Read-Only Memory EtherCAT Slave Controller Process Data Object Slave Information Interface

RELATED DOCUMENTS

Document Type Document Title

Document No.

Data Sheet

R-IN32M3 Module Datasheet

R19DS0109ED****

User's Manual R-IN32M3 Module User's Manual: Hardware

R19UH0122ED****

User's Manual R-IN32M3 Module User's Manual: Software

R17US0002ED****

Quick Start Guide R-IN32M3 Module Application Note: Quick Start Guide

R12QS0042ED****

Application Note R-IN32M3 Module (RY9012A0) User's Implementation Guide

R30AN0386EJ****

User's Manual Adaptor Board with R-IN32M3 module YCONNECT-IT-I-RJ4501 R12UZ0094EJ****

Quick Start Guide Evaluation Kit for RA6M3 Microcontroller Group EK-RA6M3 Quick R20QS0011EU***

Start Guide

Application Note R-IN32M3 Module (RY9012A0) Application Note RA6M3/RA6M4 R30AN0388EJ****

Application Note R-IN32M3 Module (RY9012A0) Application Note RX66T

R12AN0111EJ****

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 2 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

1. Overview
1.1 Abstract
This document describes how to setup R-IN32M3 module with TwinCAT�. Configuration tool.

1.2 Operating environment
For details on the software environment and hardware environment, refer to the application note included in the sample package (r18an0052xx0 ***).

Table 1-1 Application Note 
R-IN32M3 Module Application Note RA6M3 / RA6M4 R-IN32M3 Module Application Note RX66T


R30AN0388EJ**** R12AN0111EJ****

The connection procedure described in this manual assumes that the following conditions are met. For the setup method of each evaluation board, refer to the application note corresponding to each sample software included in the sample package.
1.) EtherCAT support requires firmware version 2.0.0.0 or later for the R-IN32M3 module. For the firmware update method, refer to the R-IN32M3 Module Quick Start Guide (R12QS0042ED****).
2.) EtherCAT sample project running on the host MCU and the environment are properly configured. For the connection between R-IN32M3 module and the host MCU and the EtherCAT execution procedure, refer to the application note for the target host MCU.

1.2.1 Software environment
Table 1-2 shows the software operating environment. Sample software and various documents are included in the sample package.

Table 1-3 Software environment
Name R-IN32M3module sample package TwinCAT Beckhoff Automation

DL Link r18an0052xx0*** https://www.beckhoff.com/

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 3 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

1.2.2 Hardware environment This document applies only to the following configurations:

1) R-IN32M3 module Adapter board with EK-RA6M3 / EK-RA6M4 2) R-IN32M3 module Adapter board with SK-S7G2 3) R-IN32M3 module CPU card

1) R-IN32M3 module + EK-RA6M4

2) R-IN32M3 module + SK-S7G2 3) R-IN32M3 module CPU card [SEMB1320]

Fig. 1.1 Evaluation environment

Table 1-4 Evaluation environment
Name
R-IN32M3 Module Adapter board R-IN32M3 Module CPU card RA6M3 MCU Group Evaluation Board RA6M4 MCU Group Evaluation Board SK-S7G2 starter kit.

Type
YCONNECT-IT-I-RJ450 SEMB1320 EK-RA6M3 EK-RA6M4 SK-S7G2

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 4 of 23

R-IN32M3 Module (RY9012A0)
2. Features
R-IN32M3 Module function overview.
� ESM (EtherCAT State Machine) � mailbox protocols:
 CoE (CAN application protocol over EtherCAT)  EoE (Ethernet over EtherCAT)  FoE (File Access over EtherCAT) � synchronization Modes  Free Run  Sync Manager Synchronization  DC Synchronization

Software PLC Guide: TwinCAT

EtherCAT� and TwinCAT� are registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany.

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 5 of 23

R-IN32M3 Module (RY9012A0)
3. TwinCAT3 3.1 Pre-setup
Settings before running TwinCAT.

Software PLC Guide: TwinCAT

3.1.1 ESI file
Before starting TwinCAT, put the ESI files that are included in the sample package to TwinCAT folder ("\TwinCAT\3.x\Config\IO\EtherCAT"). The ESI files are provided for each sample application.

Table 3-1 ESI file

Sample application

sample

RA sample Synergy sample

Mirror Remote IO Sensor Mirror Mirror

RX66T sample

Remote IO

Motor

ESI RA6_CCM_V***\appl\mirror_sample\ac\03_ecat_slave_renesas\esi RA6_CCM_V***\appl\remote_io_sample\ac\03_ecat_slave_renesas\esi RA6_CCM_V***\appl\sensor_sample\ac\03_ecat_slave_renesas\esi Synergy_CCM_V***\appl\2015013_irj45\ac\09_ecat_slave\esi RX66T_CCM_V***\appl\mirror_io_sample\03_ecat\esi RX66T_CCM_V***\appl\remote_io_sample\03_ecat\esi RX66T_CCM_V***\appl\motor_sample\03_ecat\esi

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 6 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

3.1.2 Network Adapter
The network configuration need to set enable a dedicated EtherCAT driver for real-time connections. EtherCAT driver  TwinCAT RT-Ethernet Filter Driver  TwinCAT Ethernet Protocol for All Network Adapters

Fig. 3.1 Network Adapter
Depending on the type of network adapter, it may be available "TwinCAT Ethernet Protocol for All Network Adapters" only.
If TwinCAT RT-Ethernet Filter Driver is not indicated or the driver is not installed, install the driver according to Appendix A.

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 7 of 23

R-IN32M3 Module (RY9012A0)
3.2 Run TwinCAT3 3.2.1 TwinCAT setup
Start TwinCAT3, start menu: [Beckhoff]  [TwinCAT3]  [TwinCAT XAE ****] or task bar: [Beckhoff]  [TwinCAT3]  [TwinCAT XAE ****]

Software PLC Guide: TwinCAT

start menu

task bar Fig. 3.2 Start TwinCAT

After the TwinCAT is started, selecting [File]  [New]  [Project], create a new project of the TwinCAT XAE Project type.

Fig. 3.3 Open Project
R30AN0380ED0201 Rev.2.01 2021.6.14

Page 8 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

3.2.2 Scan module
� (Scan for device): Under solution explorer -> I/O -> Devices, select `Scan'.

Fig. 3.4 Scan Device
� (I/O driver set): The EtherCAT I/O driver with EtherCAT enabled is automatically selected (). � Then, select OK and run "Scan for box".

Fig. 3.5 Select I/O device

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 9 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

� (Activate slave): R-IN32M3 module is listed in the boxes, in this reference case "Renesas Module" in box.
� And start "activate free-run".

Fig. 3.6 Activate Slave
Note1: If "Box 1 (PFFFFFFFF RFFFFFFFF)" appears, the Slave Information Interface (SII) may not have been programmed in the EEPROM on the RIN32M3 module. In this case, program the EEPROM according to Appendix-B EEPROM Program. The EEPROM of RIN32M3 module is not programmed at the factory release.

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 10 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

3.2.3 Communication Status
(Check for slave state): Check the state of EtherCAT slave in `Online' tab. If the connection is completed correctly, "Current State" show "OP".

Fig. 3.7 State Machine

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 11 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

4. Sample Program
This section describes the method of TxPDO/RxPDO communication between the TwinCAT master and RIN32M3 module. The following sample application is provided in the sample package.
For the implementation procedure of various sample software and the method of setting up the hardware environment, refer to the application note for the target host MCU. 1.2 Operating environment

Table 4-1 Sample application

Sample project

Mirror

RA sample software



Synergy sample software



RX66T sample software



Remote IO


Sensor




Motor


4.1 Mirror Sample
In the mirror sample, the 1-byte data received from the master is controlled to be sent back to the master. Therefore, in the master, the data written in RxPDO can be read as TxPDO.
RxPDO [digital Outputs 1-8]: 1-byte Output value from the TwinCAT master to R-IN32M3 module TxPDO [digital Inputs 1-8]: Receive the mirror 1-byte data Input value from R-IN32M3 module
Mirror sample software Target MCU: RA sample, Synergy sample, RX66T sample

1. Write RxPDO [digital Outputs 1-8] 1-1. Click "digital Outputs 1-8", and select "Online Write"

Fig.4.1 Write Output
R30AN0380ED0201 Rev.2.01 2021.6.14

Page 12 of 23

R-IN32M3 Module (RY9012A0)
1-2. Set the value on "Set Value Dialog" , and "OK".

Software PLC Guide: TwinCAT

Fig.4.2 Set write Output Value 1-3. Reflected in "digital Outputs 1-8"
Fig.4.3 Reflected Write Output Value 2. Read TxPDO [digital Inputs 1-8]
2-1. Reflect the received value from slave in "digital Inputs 1-8"
Fig,4.4 Input Value (TxPDO)

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 13 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

4.2 Remote IO Sample
In the remote io sample, Controls the slave's 4-bit-LED or 4-bit switch data to be sent to the master based on the data received from the master.

RxPDO [LED]: 4-bit LED data to Slave TxPDO [Switch]: 4-bit Switch data from Slave

Remote IO sample software Target MCU: RA sample*, RX66T sample
* RA requires PmodTM extension of LED and SW on the EK-RA6M3 / EK-RA6M4.

1. Write RxPDO [LED] 1-1. Click "LDE", and select "Online Write"

Fig.4.5 Write Output 1-2. Set the value on "Set Value Dialog", and "OK".

Fig.4.6 Set write Output Value
R30AN0380ED0201 Rev.2.01 2021.6.14

Page 14 of 23

R-IN32M3 Module (RY9012A0)
1-3. Reflected in "LED" also LED turn ON in the slave

Software PLC Guide: TwinCAT

Fig.4.7 Reflected Write Output Value
2. Read TxPDO [SW] 2-1. Reflect the received value from slave in "Switch"

Fig.4.8 Reflected Read Input Value (TxPDO)

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 15 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

4.3 Sensor Sample
In the sensor sample, Shows the received data from the slave sensor PmodTM.

RxPDO: Setting of Sampling Interval [ms] TxPDO: ToF sensor data from slave

Sensor sample software Target MCU: RA sample (EK-RA6M4)*
* EK-RA6M4 board requires PmodTM extension of ToF sensor.

1. Write RxPDO and Read TxPDO [SW] 1-1. Right click at "Sampling Interval [ms]". Select "Online Write"

Fig.4.9 Write Output
1-2. Input any RxPDO data in "Set Value Dialog", select "OK". Sampling Interval range is from 150 to 12000 (0x0096 to 0x2EE0) in intervals of 150 msec.

Fig.4.10 Write Output Value
R30AN0380ED0201 Rev.2.01 2021.6.14

Page 16 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

1-3. The input RxPDO data is reflected in the Sampling Interval, and the detection data from the ToF sensor is updated to TxPDO at set intervals.

Fig.4.11 Write Output / Read Input Value

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 17 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

4.4 Motor Sample
In the motor sample, Controls the inverter evaluation system from master.

RxPDO: Control the motor TxPDO: set value (same value with RxPDO)

Motor sample software Target MCU: RX66T sample
An inverter board [24V Motor Control Evaluation System for RX23T (RTK0EM0006S01212BJ)] that connects to the RX66T CPU card is required for this evaluation.

1. Write RxPDO 1-1. Click the set parameter, and select "Online Write"

Table 4-2 motor control RxPDO

RxPDO Motor start/stop switch

Value 0x00 0x01 0x02 Other

Control Stop FWD (CW) RVS (CCW) reserved

Motor velocity

0x0000 ~ 0xFFFF

speed *Big endian

Fig. 4.12 Write Output
R30AN0380ED0201 Rev.2.01 2021.6.14

Page 18 of 23

R-IN32M3 Module (RY9012A0)
1-2. Set the value on "Set Value Dialog", and "OK".

Software PLC Guide: TwinCAT

Fig.4.13 Set write Output Value 1-3. Reflected in parameter also move the Motor system in the slave

Fig.4.14 Reflected Write Output Value
2. Read TxPDO 2-1. Reflect the received value from slave

Fig.4.15 Reflected Read Input Value (TxPDO)

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 19 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

Appendix-A. EtherCAT Driver Install
The TwinCAT driver must be installed to use the TwinCAT. Perform the following installation procedure.

1. Ethernet adapter Select TwinCAT > Show real Time Ethernet Compatible Devices.

Figure A.1: Show Ethernet Adapter 2. Install TwinCAT driver. Select the network adapter to be an installation destination and click the [Install].
Figure A.2: Install

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 20 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

When the installed network adapter is displayed in "Installed and ready to use devices" at the end of installation, the installation has been successfully completed.

Figure A.3: Installed If the installation is unsuccessful, it means that the Ethernet adapter is not compatible with the driver.

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 21 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

Appendix-B. EEPROM program
The Slave Information Interface (SII) must have been programmed in the EEPROM. The EEPROM is blank in the initial state of the board. Perform the following procedure to program the SII.

1. Start Advanced Setting
Double-click the box of the slave in which the SII is programmed, and then select the EtherCAT tab. Click "Advanced Setting".

Figure B.1: Select Advanced Setting
2. Hex Editor Select ESC Access > E2PROM > Hex Editor. Click the [Download from List] button.

Figure B.2: EEPRON Editor
R30AN0380ED0201 Rev.2.01 2021.6.14

Page 22 of 23

R-IN32M3 Module (RY9012A0)

Software PLC Guide: TwinCAT

3. Select the ESI file Select the ESI file stored in section 3.3.1 ESI File, and then click [OK].

Figure B.3: Select ESI File
4. Download When hexadecimal information is displayed as shown below, the programming has been completed. After the EEPROM has been reprogrammed, turn off and on the board. and then click [OK].

Figure B.4: Program EEPROM Restart TwinCAT and R-IN32M3 module and rerun 3.2 Run TwinCAT.

R30AN0380ED0201 Rev.2.01 2021.6.14

Page 23 of 23

Revision History

Rev. 1.00 1.01

Date Dec 15, 2020 Feb 1, 2021

2.00

Apr 26, 2021

2.01

Jun 14, 2021

Description

Page

Summary



First edition

Add a supplementary explanation

P.3

- Chapter 3

P.5, 8

- Chapter 4



Add RA sample software and minor changes

16

Update Section 4.3

Notice
1. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples. You are fully responsible for the incorporation or any other use of the circuits, software, and information in the design of your product or system. Renesas Electronics disclaims any and all liability for any losses and damages incurred by you or third parties arising from the use of these circuits, software, or information.
2. Renesas Electronics hereby expressly disclaims any warranties against and liability for infringement or any other claims involving patents, copyrights, or other intellectual property rights of third parties, by or arising from the use of Renesas Electronics products or technical information described in this document, including but not limited to, the product data, drawings, charts, programs, algorithms, and application examples.
3. No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas Electronics or others.
4. You shall not alter, modify, copy, or reverse engineer any Renesas Electronics product, whether in whole or in part. Renesas Electronics disclaims any and all liability for any losses or damages incurred by you or third parties arising from such alteration, modification, copying or reverse engineering.
5. Renesas Electronics products are classified according to the following two quality grades: "Standard" and "High Quality". The intended applications for each Renesas Electronics product depends on the product's quality grade, as indicated below. "Standard": Computers; office equipment; communications equipment; test and measurement equipment; audio and visual equipment; home electronic appliances; machine tools; personal electronic equipment; industrial robots; etc. "High Quality": Transportation equipment (automobiles, trains, ships, etc.); traffic control (traffic lights); large-scale communication equipment; key financial terminal systems; safety control equipment; etc. Unless expressly designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas Electronics document, Renesas Electronics products are not intended or authorized for use in products or systems that may pose a direct threat to human life or bodily injury (artificial life support devices or systems; surgical implantations; etc.), or may cause serious property damage (space system; undersea repeaters; nuclear power control systems; aircraft control systems; key plant systems; military equipment; etc.). Renesas Electronics disclaims any and all liability for any damages or losses incurred by you or any third parties arising from the use of any Renesas Electronics product that is inconsistent with any Renesas Electronics data sheet, user's manual or other Renesas Electronics document.
6. When using Renesas Electronics products, refer to the latest product information (data sheets, user's manuals, application notes, "General Notes for Handling and Using Semiconductor Devices" in the reliability handbook, etc.), and ensure that usage conditions are within the ranges specified by Renesas Electronics with respect to maximum ratings, operating power supply voltage range, heat dissipation characteristics, installation, etc. Renesas Electronics disclaims any and all liability for any malfunctions, failure or accident arising out of the use of Renesas Electronics products outside of such specified ranges.
7. Although Renesas Electronics endeavors to improve the quality and reliability of Renesas Electronics products, semiconductor products have specific characteristics, such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Unless designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas Electronics document, Renesas Electronics products are not subject to radiation resistance design. You are responsible for implementing safety measures to guard against the possibility of bodily injury, injury or damage caused by fire, and/or danger to the public in the event of a failure or malfunction of Renesas Electronics products, such as safety design for hardware and software, including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. Because the evaluation of microcomputer software alone is very difficult and impractical, you are responsible for evaluating the safety of the final products or systems manufactured by you.
8. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product. You are responsible for carefully and sufficiently investigating applicable laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive, and using Renesas Electronics products in compliance with all these applicable laws and regulations. Renesas Electronics disclaims any and all liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations.
9. Renesas Electronics products and technologies shall not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable domestic or foreign laws or regulations. You shall comply with any applicable export control laws and regulations promulgated and administered by the governments of any countries asserting jurisdiction over the parties or transactions.
10. It is the responsibility of the buyer or distributor of Renesas Electronics products, or any other party who distributes, disposes of, or otherwise sells or transfers the product to a third party, to notify such third party in advance of the contents and conditions set forth in this document.
11. This document shall not be reprinted, reproduced or duplicated in any form, in whole or in part, without prior written consent of Renesas Electronics. 12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas
Electronics products.
(Note1) "Renesas Electronics" as used in this document means Renesas Electronics Corporation and also includes its directly or indirectly controlled subsidiaries.
(Note2) "Renesas Electronics product(s)" means any product developed or manufactured by or for Renesas Electronics.
(Rev.4.0-1 November 2017)

Corporate Headquarters
TOYOSU FORESIA, 3-2-24 Toyosu, Koto-ku, Tokyo 135-0061, Japan www.renesas.com
Trademarks
Renesas and the Renesas logo are trademarks of Renesas Electronics Corporation. All trademarks and registered trademarks are the property of their respective owners.

Contact information
For further information on a product, technology, the most up-to-date version of a document, or your nearest sales office, please visit: www.renesas.com/contact/.