Table of Contents
1. Introduction ........................................................................................................................ 1
1.1 List of Abbreviations and Acronyms .......................................................................................................... 1
1.2 Reference .................................................................................................................................................. 1
2. Software Structure ............................................................................................................. 2
2.1 Development Environment......................................................................................................................... 3
2.1.1 Hardware .......................................................................................................................................... 3
2.1.2 Software ........................................................................................................................................... 3
2.2 File structure .............................................................................................................................................. 4
3. Project Settings ............................................................................................................... 11
3.1 Start e2studio ............................................................................................................................................ 11
3.1.1 Workspace settings ........................................................................................................................ 11
3.1.2 Import project ................................................................................................................................. 12
3.1.3 Building project ............................................................................................................................... 13
3.2 Built Environment ..................................................................................................................................... 14
3.3 Macro Definition ....................................................................................................................................... 15
3.3.1 R_DEFINE_APP_MODE ............................................................................................................... 15
3.3.2 R_RL78_PLC ................................................................................................................................. 16
3.3.3 R_DEFINE_APP_BOOT ................................................................................................................ 16
3.4 Memory Map ............................................................................................................................................ 19
3.4.1 RX631 ............................................................................................................................................ 19
3.4.2 RX651 ............................................................................................................................................ 21
3.4.3 RL78G13 ........................................................................................................................................ 23
4. Sample Program .............................................................................................................. 25
4.1 G3-PLC Sample Application .................................................................................................................... 25
4.1.1 Application Control Parameters ..................................................................................................... 28
4.1.2 Command Processing Unit ............................................................................................................ 33
4.1.3 G3 Processing Unit ........................................................................................................................ 37
4.1.4 G3 API Wrapper ............................................................................................................................. 49
4.1.5 Flash control unit ............................................................................................................................ 52
4.1.6 IPv6 unit ......................................................................................................................................... 63
4.2 CPX3 SAP ............................................................................................................................................... 69
4.3 Common Process .................................................................................................................................... 69
4.3.1 CRC control .................................................................................................................................... 69
4.3.2 LED control ..................................................................................................................................... 69
4.3.3 Memory management .................................................................................................................... 69
4.3.4 Queue control ................................................................................................................................. 69
4.3.5 Console control .............................................................................................................................. 69
4.3.6 Soft timer control ............................................................................................................................ 70
4.3.7 Data operation ................................................................................................................................ 70
4.4 BSP .......................................................................................................................................................... 71
4.4.1 FIT .................................................................................................................................................. 71
4.4.2 API Functions ................................................................................................................................. 71
4.4.3 Library ............................................................................................................................................ 73
4.4.4 Startup ............................................................................................................................................ 73
4.5 Framework ............................................................................................................................................... 78
4.5.1 Sequence ....................................................................................................................................... 78
4.5.2 Process Flow .................................................................................................................................. 83
5. Resources Used .............................................................................................................. 86
5.1 Hardware Resources ............................................................................................................................... 86
5.1.1 RX631 ............................................................................................................................................ 86
5.1.2 RX651 ............................................................................................................................................ 87