SH 082520 Enga
SH 082520 Enga
Training Manual
C Controller Basic Course
SAFETY PRECAUTIONS
(Read these precautions before exercise.)
When designing the system, always read the relevant manuals and give sufficient consideration to safety.
During the exercise, pay full attention to the following points and handle the product correctly.
[EXERCISE PRECAUTIONS]
WARNING
● Do not touch the terminals while the power is on to prevent electric shock.
● Before opening the safety cover, turn off the power or ensure the safety.
CAUTION
● Follow the instructor's direction during the exercise.
● Do not remove the module of the demonstration machine or change wirings without permission.
Doing so may cause failures, malfunctions, personal injuries and/or a fire.
● Turn off the power before mounting or removing the module.
Failure to do so may result in malfunctions of the module or electric shock.
● When the demonstration machine emits abnormal odor/sound, press the "Power switch" or
"Emergency switch" to turn off.
● When a problem occurs, notify the instructor as soon as possible.
1
REVISIONS
*The manual number is given on the bottom left of the back cover.
Revision date *Manual number Description
March 2022 SH(NA)-082520ENG-A First edition
This manual confers no industrial property rights or any rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot
be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.
2
TRADEMARKS
Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries.
Unicode is either a registered trademark or a trademark of Unicode, Inc. in the United States and other countries.
The company names, system names and product names mentioned in this manual are either registered trademarks or
trademarks of their respective companies.
In some cases, trademark symbols such as '' or '' are not specified in this manual.
3
CONTENTS
SAFETY PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
REVISIONS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2
TRADEMARKS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
RELEVANT MANUALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
CHAPTER 1 OVERVIEW 8
1.1 Features of the C Controller Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2 C Controller System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Overall System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Peripheral configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Applicable Software. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
SD Memory Card. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3 External I/O Signals and I/O Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4
CHAPTER 5 OPERATING INTELLIGENT FUNCTION MODULES 91
5.1 Intelligent Function Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.2 Exchange of Information between Intelligent Function Modules and the C Controller Module . . . . . . . . 92
I/O signals for the C Controller module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Data communication with an intelligent function module. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.3 Methods of Communication with Intelligent Function Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Types of methods of communication with intelligent function modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
5.4 Exercise Structure for Intelligent Function Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5.5 Analog-Digital Converter Module R60AD4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
CONTENTS
Part names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
A/D conversion characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
List of I/O signals and buffer memory area assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Setting intelligent function module data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
5.6 Digital-Analog Converter Module R60DA4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Part names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
D/A conversion characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
List of I/O signals and buffer memory area assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Setting intelligent function module data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
5.7 Exercise 2 A/D conversion, D/A conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Exercise 2.1 Checking the operation of the analog-digital converter module and digital-analog converter module
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Exercise 2.2 Loading an A/D conversion output value into the HMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Exercise 2.3 Outputting a value in the HMI through D/A conversion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
APPENDICES 131
Appendix 1 Security Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Individual identification information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
File access restriction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Setting a service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Lockout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Appendix 2 Modules for Realizing Higher-Speed Analog I/O Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
High-speed analog input module R60ADH4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
High-speed analog output module R60DAH4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Appendix 3 CW Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Creating a new user program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
5
INTRODUCTION
To help users acquire the knowledge required for configuring a data collection system using the MES interface module, this
manual describes the functions and specifications of hardware and software used to configure a system, explains the
databases, and provides troubleshooting information.
RELEVANT MANUALS
Manual name [manual number] Description Available
form
MELSEC iQ-R C Controller Module User's Manual (Startup) Performance specifications, procedures before operation, and troubleshooting e-Manual
[SH-081366] of the C Controller module PDF
MELSEC iQ-R C Controller Module User's Manual Functions, devices, and parameters of the C Controller module e-Manual
(Application) PDF
[SH-081368]
MELSEC iQ-R C Controller Module Programming Manual Programming specifications and dedicated function library of the C Controller e-Manual
[SH-081370] module PDF
MELSEC iQ-R C Controller/C Intelligent Function Module Programming specifications and dedicated function library relating to data e-Manual
Programming Manual (Data Analysis) analysis of the C Controller module/C Intelligent Function Module PDF
[SH-081755]
CW Workbench/CW-Sim Operating Manual System configuration, specifications, functions, and troubleshooting of CW e-Manual
[SH-081372] Workbench/CW-Sim PDF
CW Configurator Operating Manual System configuration, parameter settings, and online operations of CW e-Manual
[SH-081381] Configurator PDF
e-Manual refers to the Mitsubishi Electric FA electronic book manuals that can be browsed using a dedicated
tool.
e-Manual has the following features:
• Required information can be cross-searched in multiple manuals.
• Other manuals can be accessed from the links in the manual.
• The hardware specifications of each part can be found from the product figures.
• Pages that users often browse can be bookmarked.
6
MEMO
7
1 OVERVIEW
The C Controller module is a CPU module developed based on the multi-core ARM and capable of executing multiple
programs simultaneously. Featuring both robustness and timing accuracy, the C Controller module can serve as an alternative
platform to personal computers or MCUs. Moreover, the fanless design adopted by the C Controller module, which prevents
the spread of dust, is most suitable for use in a clean environment such as a microchip factory. Taking advantage of the
excellent features of the MELSEC iQ-R series, such as high performance, flexibility, and robustness, the C Controller module
realizes automation systems for a variety of industrial uses.
1 OVERVIEW
8 1.1 Features of the C Controller Module
Security improved by stopping connection services
The states of services operating in the C Controller module can be set.
1
Whether to enable/disable services can be set with the C Controller Setting and Monitor Tool parameter setting to improve
security.
1 OVERVIEW
1.1 Features of the C Controller Module 9
1.2 C Controller System Configuration
Select the C Controller module and modules with various functions according to the application, and mount them on the base
unit, which operates as a backplane, to flexibly build a system.
For a C Controller system, a system can be flexibly and easily built, just by selecting necessary modules according to the
application and mounting them on a base unit.
(1) (2)
(3)
(5)
(4)
(6)
1 OVERVIEW
10 1.2 C Controller System Configuration
Peripheral configuration
The following figure shows a configuration with peripherals. 1
(1) (2) (3)
(4) (5)
(6)
(8)
(7)
(9)
1 OVERVIEW
1.2 C Controller System Configuration 11
• USB devices can be used for a firmware version of the C Controller module "03" or later.
• To install and connect a peripheral to the C Controller module, comply with the specifications of both the C
Controller module and the peripheral.
• For details on access via each network module and access using Ethernet communication, refer to the
following.
MELSEC iQ-R C Controller Module User's Manual (Application)
Applicable Software
The following table lists software that can be used for the MELSEC iQ-R C Controller module system. (Manual for each
software used)
Software package Version
CW Configurator SW1DND-RCCPU-J Version 1.00A or later
SW1DND-RCCPU-E
CW Workbench SW1DND-CWWR-E/EZ/EVZ Version 1.00A or later
CW-Sim SW1DND-CWWSIMR-EZ Version 1.00A or later
CW-Sim Standalone SW1DND-CWWSIMSAR-E Version 1.00A or later
Wind River Workbench Version 3.3
GX Works3 SW1DND-GXW3-J Version 1.007H or later
SW1DND-GXW3-E
GT Designer3 SW1DNC-GTWK3-J Version 1.126G or later
SW1DNC-GTWK3-E
MT Works2 SW1DNC-MTW2-J Version 1.110Q or later
SW1DNC-MTW2-E
SD Memory Card
One SD memory card can be inserted in the C Controller module.
For commercially available SD memory cards, refer to the Mitsubishi Electric FA global website. Before using a commercially
available SD memory card, check that the card does not affect the control of the target system.
TECHNICAL BULLETIN No.FA-A-0023
Precautions
• Execute formatting for the SD memory card using the formatting function of CW Configurator.
• If an SD memory card other than those listed above is used, a problem, such as damage to data in the SD memory card
and system operation stop, may occur.
• Data in the SD memory card may corrupt if any of the following operations is performed while the SD memory card is being
accessed: powering off the system, resetting the C Controller module, or removing the SD memory card. Always power off
or reset the C Controller module, or remove the SD memory card after access to the SD memory card stops.
1 OVERVIEW
12 1.2 C Controller System Configuration
1.3 External I/O Signals and I/O Numbers
1
Understand the rules for giving I/O numbers for the iQ-R series.
(Power
(CPU)
supply)
(RY)
Base unit
(RX)
Input number Output number
Y10
PB1 SV1
X0
CS1 Y11
X1 SV2
CS2
X2 I/O numbers are hexadecimal and start from 0.
Y12
SV3 The number for each input and output is common,
PB2
X3 and the inputs have "X" and the outputs have "Y"
PB3 Y13 RD before their numbers.
X4 The maximum number of the I/O numbers for a CPU
LS1 module is 4096 points.
X5 Y14 GN I/O numbers can be freely assigned beyond a boundary
LS2 between the MELSEC iQ-R series and the
X6 MELSEC-Q series, being free from the restriction of
Y15 MC1 assignment orders.
LS3
X7
LS4 Y16 MC2
X8
PB4
X9
Y17 MC3
PB5
XA
CS3 COM1
XB
XC
Y18
XD
Y1F
XE
XF COM2
COM
Output module
Input module
1 OVERVIEW
1.3 External I/O Signals and I/O Numbers 13
I/O numbers of the main base unit
The I/O numbers of the I/O module mounted on the main base unit are assigned as follows. The concept is the same for the I/
O module and the intelligent function module.
Main base (R35B, R38B, R312B)
0 1 2 3 4 5 6 7 8 9 10 11 Slot number
Power supply module
C 00 10 20 30 40 50 60 70 80 90 A0 B0 I/O number
P to to to to to to to to to to to to
U 0F 1F 2F 3F 4F 5F 6F 7F 8F 9F AF BF
• I/O numbers for one slot (1 module) are assigned in units of 16 points (0 to FH), starting from the lowest number.
In other words, basically a 16 point module is mounted on every slot.
For example, the following figure shows I/O numbers when a 32 point module is mounted on slot 5.
0 1 2 3 4 5 6 7 Slot number
When a module is
Power supply module
C 00 10 20 30 40 50 70 80
replaced with a 32 to
point module, the 5F
numbers for the next P to to to to to to to
module are changed. 60
to
(The numbers are U 0F 1F 2F 3F 4F 6F 7F 8F
advanced.)
• I/O numbers are assigned to an empty slot (where an I/O module is not mounted) as well.
For example, the following figure shows I/O numbers when slot 3 is empty. (Initial setting)
The number of points to be assigned can be changed by the setting.
Main base unit
0 1 2 3 4 5 6 7 Slot number
Power supply module
Empty (
C 00 10 20 40 50 60 70
P to to to 30 to to to to
to
U 0F 1F 2F 3F 4F 5F 6F 7F
)
1 OVERVIEW
14 1.3 External I/O Signals and I/O Numbers
2 STARTING UP THE DEMONSTRATION
MACHINE
2.1 Demonstration Machine System Configuration 2
The following describes the system configuration of the demonstration machine.
(1)
Ethernet
(192.168.3.100)
(2) (3)
Initial display device D0 Initial display device D1 Initial display device D10 (32 bits)
Initial input device D20 Initial input device D21 Initial input device D30 (32 bits)
Display 1 Display 2
1. Connect the C Controller module (CH1) and the personal computer using an Ethernet cable.
CH1
C Controller module
Ethernet cable
Personal computer
2. Connect the C Controller module (CH2) and the GOT using an Ethernet cable.
CH2
C Controller module
Ethernet cable
GOT2000
4. Creating a project
On the personal computer with CW Configurator installed, create a project for the C Controller module to be used.
( Page 37 Parameter Settings)
6. Setting parameters
Set system parameters, CPU parameters, and module parameters. ( Page 37 Parameter Settings)
Parameters other than the above need to be set to use the SD memory card function or to mount an intelligent function
module. ( User's Manual (Application) for the module used)
Executing initialization
Initialize the C Controller module in any of the following cases.
• The system operates for the first time.
• The C Controller module does not start up by executing the script file registered in the program memory.
• The user name/password set to the C Controller module is forgotten.
When initialization is executed, the program memory, device/label memory, and data memory data are
deleted. Backup necessary data before initialization.
Operating procedure
1. Hold the MODE/SELECT switch in the MODE position.
2. ON!
5. RUN!
6. Flashing!
7. ON!
■Default IP setting
• The execution of the registered script file is stopped.*1
• The initial value is set for the IP address of the C Controller module.
*1 The script file is renamed as "STARTUP.BAK" and its registration is cleared.
(1)
During hardware diagnostics, do not power off or reset the C Controller module. Otherwise, the C Controller
module cannot start up correctly. In such a case, perform initialization.
Diagnostics types
The following table shows the modes of hardware diagnostics.
Mode Dot matrix LED Item Description
0 M-00 Mode 1 to 6 diagnostics tests Execute a diagnostics test for each mode in the order of mode
numbers, starting from 1 to 6.
1 M-01 Program memory and data memory Read data from the program memory and data memory, and
diagnostics test perform error detection.
Device/label memory diagnostics test Check the device/label memory by reading/writing/verifying test
data.
2 M-02 Ethernet diagnostics test Diagnose the condition of the Ethernet ports (CH1 and CH2).
3 M-03 SD memory card interface Diagnose the condition of the SD memory card slot.
diagnostics test
4 M-04 RS-232 diagnostics test Execute a self-loopback test for the RS-232 connector. Prepare
wiring for self-loop back operation.
5 M-05 USB diagnostics test Diagnose the condition of the USB connector.
6 M-06 Bus diagnostics test Check the internal bus memory and registers by reading/writing/
verifying test data.
7 M-07 Dot matrix LED test Test the display condition of the dot matrix LED.
■Preparation
Execute the following before hardware diagnostics.
Hardware diagnostics can be executed even when the C Controller module is not mounted on the CPU slot.
To execute hardware diagnostics by mounting the C Controller module on a slot other than the CPU slot,
mount another CPU module on the CPU slot. An error may be detected in the mounted CPU module, but
hardware diagnostics can be executed.
(1) Connector
(2) Pin number
(3) Signal abbreviation
(4) Cable connection
5 Check that a cable is not connected to the USB connector.
6 Preparations for this mode are not required.
1. Set the RESET/STOP/RUN switch to the RESET position and hold it in that position until step 4. Check that all the LEDs
turn off.
2. Set the MODE/SELECT switch to the MODE position and hold it in that position until step 6.
4. The BUS RUN LED turns on and "M-00" is displayed on the dot matrix LED.
5. Release the MODE/SELECT switch and put it back to the center position.
6. Set the MODE/SELECT switch to the SELECT position and select a diagnostics mode.
Every time the switch is set to the SELECT position, the displayed value of diagnostics mode is changed.
Repeat the action until the value of the target diagnostics mode is displayed on the dot matrix LED.
When the RESET/STOP/RUN switch is in the RUN position before taking the procedure for mode execution,
set the switch back to the STOP position.
Step.1
2
Step.7
Step.2
Step.8
Step.3
Step.9
Step.4
Step.10
Step.5
Step.11
Step.6
Step.12
Step.7
Step.1
: On
: Off
*1 An error may occur if a cable for wiring is not connected correctly. Correctly connect the cable or do the wiring, and execute mode 4
diagnostics again.
If an abnormal end occurs, diagnostics or setting operation after that is not executed. Execute diagnostics and
setting operation again. If an error occurs again after an abnormal end, the possible cause is a hardware
failure of the C Controller module. Please consult your local Mitsubishi Electric System & Service Co., Ltd.
representative.
Operating procedure 2
1. From the Start menu of Windows, click
[Windows System] [Control Panel].
1. Click!
2. Click!
3. Click!
4. Click "Ethernet".
4. Click!
5. Click!
7. Click!
9. Click!
10. Click!
11. Click!
Write
Read
3 OPERATING CW CONFIGURATOR
3.1 Main functions of CW Configurator 31
Module operation check function
With a personal computer connected to the C Controller module, device contents of the C Controller module and intelligent
function modules can be monitored to check their actions.
Diagnostic function
This function provides diagnostics for the current error status and error history of the module and network. The diagnostic
function helps to shorten the recovery time.
Detailed information of intelligent function modules can also be checked via system monitoring. This feature further shortens
the recovery time when an error occurs.
Diagnose the
module status
3 OPERATING CW CONFIGURATOR
32 3.1 Main functions of CW Configurator
3.2 CW Configurator Screen Layout
This section describes the screen layout when starting CW Configurator.
Main frame
The following figure shows the entire main frame layout.
In this screen, a work window and each docking window are displayed.
Title bar
3
Menu bar
Toolbar
Work window
Status bar
Docked window
3 OPERATING CW CONFIGURATOR
3.2 CW Configurator Screen Layout 33
Window operation
■Displaying docking windows
[View] [Docking Window] [(target item)]
Window
[Window] [Window]
Fit the title bar into the guidance. The title bar is docked.
• Floating display: Drag the title bar of a docked window to any location to display that window separately from the main
frame.
For a window docked once, the docked display and the floating display can be switched by double-clicking its
title bar.
3 OPERATING CW CONFIGURATOR
34 3.2 CW Configurator Screen Layout
Customizing/resetting toolbars
Set the types of tool buttons to be displayed on each toolbar.
The selected items in the list are displayed as tool buttons.
Operating procedure
■Customizing
1. Click in the toolbar, and select [Show/Hide Buttons] [(toolbar name)].
Navigation window
The navigation window displays the contents of a project in tree form.
Data can be newly created and the edit window can be displayed via the tree.
Window
[View] [Docking Window] [Navigation] ( )
Toolbar
Status icons
Project view
Displayed items
Name Description Reference
Status display icon The icon representing the status of a project is displayed. Page 35 Status display icon
Simple display
Click on the toolbar to hide the folders that are not used.
3 OPERATING CW CONFIGURATOR
3.2 CW Configurator Screen Layout 35
Connection Destination window
The Connection Destination window displays the connection destinations set for the C Controller module in list form.
Window
[View] [Docking Window] [Connection Destination] ( )
Window
[View] [Docking Window] [Element Selection] ( )
Toolbar
Enter a search string (an element name or a keyword included in the description of an element) into the toolbar, and the focus
moves to the matched element.
From the display targets, only the elements included in the selected category can be displayed.
Pasting elements
■Pasting into the Module Configuration window
When the Module Configuration window is displayed, elements that can be pasted are displayed in the Element Selection
window.
Paste an element by dragging and dropping it into the Module Configuration window from the list.
3 OPERATING CW CONFIGURATOR
36 3.2 CW Configurator Screen Layout
3.3 Parameter Settings
This section describes the procedure for setting parameters with CW Configurator and writing them to the C Controller
module.
Starting up CW Configurator
To set parameters, start up CW Configurator.
Operating procedure
3
1. On the Windows Start screen click
[MELSOFT] [CW Configurator].
2. Click!
3. Click!
3 OPERATING CW CONFIGURATOR
3.3 Parameter Settings 37
Parameter setting procedure with CW Configurator
Operating procedure
1. Double-click "Module Configuration Diagram"
in the Navigation window.
When the dialog box about parameter
information appears, click the [OK] button.
1. Double-click!
3. Add!
3 OPERATING CW CONFIGURATOR
38 3.3 Parameter Settings
4. Select "R61P" from the "Power Supply"
section on the Element Selection window, and
drag and drop it to the power supply slot of the
R35B that was added to the Module
Configuration window.
While the R61P is being dragged and
dropped, locations where it can be placed are
4. Drag and drop! highlighted.
3
6. Add!
3 OPERATING CW CONFIGURATOR
3.3 Parameter Settings 39
7. Right-click the added R60AD4 click
[Parameter] [Input Detailed Configuration
Information Window] menu, and when the
input detailed configuration information
window appears, set as follows.
[Setting details]
start XY: 0000
7. Set!
8. Add!
9. Set!
10. Click!
3 OPERATING CW CONFIGURATOR
40 3.3 Parameter Settings
11. The data of the specified modules are added
to the Navigation window.
11. Add! 3
3 OPERATING CW CONFIGURATOR
3.3 Parameter Settings 41
Own node settings
The own node settings refer to the settings necessary for the C Controller module to communicate with an external device.
Window
Displayed items
: there is no setting
Item Description Setting range Default
IP address Use of Set whether to use the Ethernet Port (CH1). • Not Use Use
setting CH1 • Use
IP address Set the IP address so that the external device to be communicated • 0.0.0.1 to 192.168.3.3
with has an address of the same class and subnet. Set the IP 223.255.255.254
address so that it belongs to a network different from the network
for CH2.
Subnet mask When the IP address of the default gateway is set and when • 128.0.0.0 to 255.255.255.0
communicating with an external device in a different network via 255.255.255.252
routers, set the subnet mask pattern of the default gateway. All the
devices on the same subnetwork must have the common subnet
mask. This setting is not required when communications are
performed in a single network.
Default gateway Set the IP address of the device through which to access an • (empty)
external device in a different network (default gateway). Set a • 0.0.0.1 to
value for the default gateway IP address that satisfies the following 223.255.255.254
conditions.
• The IP address class must be Class A, B, or C.
• The subnet address of the default gateway is the same as the
subnet address of the C Controller module in the own station.
• The host address is neither all "0" nor all "1".
Use of Set whether to use the Ethernet Port (CH2). • Not Use Not Use
CH2 • Use
IP address Same as CH1 • 0.0.0.1 to
223.255.255.254
Subnet mask • 128.0.0.0 to
255.255.255.252
Default gateway • (empty)
• 0.0.0.1 to
223.255.255.254
When using both CH1 and CH2, set different values for the IP address and subnet mask.
3 OPERATING CW CONFIGURATOR
42 3.3 Parameter Settings
Operating procedure
1. Double-click "Module Parameter" of the
R12CCPU-V in the Navigation window.
1. Double-click!
3 OPERATING CW CONFIGURATOR
3.3 Parameter Settings 43
Specifying the connection destination
Specify the connection destination.
Operating procedure
1. Select [Online] [Current Connection
Destination] on the menu bar of the
engineering tool.
1. Click!
3. Click!
4. Click!
3 OPERATING CW CONFIGURATOR
44 3.3 Parameter Settings
5. Click the [Connection Test] button.
5. Click!
7. Click!
3 OPERATING CW CONFIGURATOR
3.3 Parameter Settings 45
Writing parameters to the C Controller module
Write the parameters set with CW Configurator to the C Controller module.
1. Select [Online] [Write to PLC] from the
menu of the engineering tool.
1. Click!
3. Click!
5. Click!
3 OPERATING CW CONFIGURATOR
46 3.3 Parameter Settings
4 DEVICE ACCESS
Device list
The following table lists the device names that can be used and the ranges of use.
Classification Type Device name Default value Number
of
Setting range
4
Number of Range of use
points points
setting
User device Bit device Input 4096 points X0 to FFF Hexadecimal Not
allowed
Output 4096 points Y0 to FFF Hexadecimal
Bit device Internal relay 61440 points M0 to 61439 Decimal Not
allowed
Link relay 655360 points B0 to 9FFFF Hexadecimal
Word device Data register 4184064 points D0 to 4184063 Decimal
Link register 1048576 points W0 to FFFFF Hexadecimal
System device Bit device Special relay 4096 points SM0 to 4095 Decimal Not
allowed
Word device Special register 4096 points SM0 to 4095 Decimal
Link direct device*1 Bit device Link input 16384 points Jn\X0 to 3FFF Hexadecimal
Link output 16384 points Jn\Y0 to 3FFF Hexadecimal
Link relay 32768 points Jn\B0 to 7FFF Hexadecimal
Link special relay 512 points Jn\SB0 to 1FF Hexadecimal
Word device Link register 131072 points Jn\W0 to 1FFFF Hexadecimal
Link special register 512 points Jn\SW0 to 1FF Hexadecimal
Module access Word device Module access device 268435456 Un\G0 to 268435455 Decimal Not
device points allowed
CPU buffer memory Word device CPU buffer memory 268435456 U3En\G0 to Decimal Not
access device access device points 268435455 allowed
Word device Fixed scan communication 0 points Decimal Allowed U3En\HG0 to
area access device 12287
File register Word device File register 1835008 points ZR0 to 1835007 Decimal Not
allowed
Pointer Interrupt pointer 1024 points I0 to I15, I50 to I1023 Decimal Not
allowed
*1 The number of points and range of use for a link direct device differ depending on the network module. For details on the number of
points and range of use for link direct devices, refer to the manual for the network module used.
4 DEVICE ACCESS
4.1 Device List 47
Device description
The following table shows an overview of devices that can be used.
For details on devices, refer to the following.
MELSEC iQ-R CPU Module User's Manual (Application)
Device name Description
User device Input X This device provides the CPU module with commands and/or data using an external device,
such as a pushbutton, transfer switch, limit switch, and device switch.
Output Y This device outputs the control results of the program to various devices, such as an
external signal light/digital HMI/electromagnetic switch (electromagnetic contactor)/
solenoid.
Internal relay M This device is used as an auxiliary relay within the CPU module.
Data register D This device can store numerical values.
Link relay B This device is used on the C Controller module side when data is refreshed between the
network module and the C Controller module.
Link register W
System device Special relay SM This is the internal relay or internal register for which the specification is defined in the C
Controller module, where the status of the C Controller module is stored.
Special register SD
Link direct device Link input Jn\X This device directly accesses link relays and/or link registers of the network module in the
CC-Link IE Controller Network and/or CC-Link IE Field Network.
Link output Jn\Y
Link relay Jn\B
Link special relay Jn\SB
Link register Jn\W
Link special register Jn\SW
Module access Module access device Un\G This device directly accesses from the CPU module to the buffer memory of the intelligent
device function module mounted on the main base unit and extension base unit.
CPU buffer memory CPU buffer memory access U3En\G This device accesses memory used by the built-in function of the CPU module, such as
access device device data writing/reading between CPU modules on the multiple CPU system and Ethernet
Fixed scan communication U3En\HG function.
area access device
File register File register ZR This device holds data while the power is turned off. It exists in the file storage area of the
device/label memory.
Pointer Interrupt pointer I When the interrupt function is used, this device executes the corresponding routine.
By using a peripheral (such as CW Configurator), data can be read from/written to the devices and buffer
memory of the C Controller module as well.
4 DEVICE ACCESS
48 4.1 Device List
4.2 C Controller module dedicated functions
C Controller module dedicated functions are one of the C Controller module "dedicated function libraries". When they are
used for user programs, each module in the MELSEC iQ-R series can be controlled easily.
Function list
This section introduces the most basic C Controller module dedicated functions.
Besides those listed below, C Controller module dedicated functions useful for controlling each module and MELSEC
communication functions also exist. For each function, refer to the following.
C Controller Module Programming Manual
■Device access 4
The following table lists the functions used for device access.
Function name Description Reference
CCPU_X_In_BitEx Reads the input signal (X) in units of bits (one point). Page 50 CCPU_X_In_BitEx
CCPU_X_In_WordEx Reads the input signal (X) in units of words (16 points). Page 51 CCPU_X_In_WordEx
CCPU_Y_Out_BitEx Outputs the output signal (Y) in units of bits (one point). Page 52 CCPU_Y_Out_BitEx
CCPU_Y_Out_WordEx Outputs the output signal (Y) in units of words (16 points). Page 53 CCPU_Y_Out_WordEx
CCPU_ReadDevice Reads data from the internal user device and internal system device of Page 54 CCPU_ReadDevice
the C Controller module.
CCPU_WriteDevice Writes data to the internal user device and internal system device of the Page 55 CCPU_WriteDevice
C Controller module.
4 DEVICE ACCESS
4.2 C Controller module dedicated functions 49
CCPU_X_In_BitEx
This function reads the input signal (X) in units of bits (one point).
■Format
short CCPU_X_In_BitEx (short sFlg, unsigned short usXNo, unsigned short* pusData)
■Argument
Argument Name Description IN/OUT
sFlg Access flag Specifies the access flag. IN
• 0: Normal access
• Others: Reserved
usXNo Input signal Specifies the input signal (X). IN
pusData Data storage location Specifies the storage location of read data. OUT
One of the following values is stored according to the value of the input signal (X).
• 0: OFF
• 1: ON
■Description
• This function reads the input signal (X) specified by the input signal (usXNo) in units of bits (one point).
• The value of the read input signal (X) is stored in the data storage location (pusData).
• The CCPU_X_In_BitEx function operates for the mounted module corresponding to the specification by the input signal
(usXNo) regardless of the type in the parameter settings (I/O assignment). When the specified area is "Empty", it ends
normally with non-processing (read data is 0). When it is "Output module", an I/O assign error occurs.
■Return value
Return value Description
0 (0000H) Normally finished
Other than 0 Failed
For details when the function fails, refer to the following.
MELSEC iQ-R C Controller Module Programming Manual
4 DEVICE ACCESS
50 4.2 C Controller module dedicated functions
CCPU_X_In_WordEx
This function reads the input signal (X) in units of words (16 points).
■Format
short CCPU_X_In_WordEx (short sFlg, unsigned short usXNo, unsigned short usSize, unsigned short* pusDataBuf,
unsigned short usBufSize)
■Argument
Argument Name Description IN/OUT
sFlg Access flag Specifies the access flag. IN
• 0: Normal access
• Others: Reserved
usXNo Start input signal Specifies the start input signal (X). IN 4
(Specify a multiple of 16.)
usSize Read size Specifies the read size in units of words. IN
pusData Data storage location Specifies the storage location of read data. OUT
usBufSize Data storage location size Specifies the data storage location size in units of words. IN
■Description
• This function reads input signals (X) amounting to the size specified by the read size (usSize), starting from the start input
signal (X) specified by the start input signal (usXNo), and stores them in the data storage location (pusDataBuf).
• For the data storage location size (usBufSize), specify the area size of the data storage location (pusDataBuf).
• The CCPU_X_In_WordEx function operates for the mounted module corresponding to the specification by the input signal
(usXNo) regardless of the type in the parameter settings (I/O assignment). When the specified area is "Empty", it ends
normally with non-processing (read data is 0). When it is "Output module", an I/O assign error occurs.
• As shown below, read data is stored in the data storage location (pusDataBuf) in the order from the earliest to the oldest,
starting from the lower bits.
pusDataBuf Description
pusDataBuf[0] Data in usXNo+FH to usXNo
pusDataBuf[1] Data in usXNo+1FH to usXNo+10H
pusDataBuf[usSize-1] Data in usXNo+(usSize–1)16+FH to usXNo+(usSize–1)16
Precautions
For the data storage location size (usBufSize), set a value larger than the value of the read size (usSize).
■Return value
Return value Description
0 (0000H) Normally finished
Other than 0 Failed
For details when the function fails, refer to the following.
MELSEC iQ-R C Controller Module Programming Manual
4 DEVICE ACCESS
4.2 C Controller module dedicated functions 51
CCPU_Y_Out_BitEx
This function outputs the output signal (Y) in units of bits (one point).
■Format
short CCPU_Y_Out_BitEx (short sFlg, unsigned short usYNo, unsigned short usData)
■Argument
Argument Name Description IN/OUT
sFlg Access flag Specifies the access flag. IN
• 0: Normal access
• Others: Reserved
usYNo Output signal Specifies the output signal (Y). IN
usData Data storage location Specifies the storage location of output data. IN
(Specify a value for bit 0.)
• 0: Off
• 1: On
■Description
• This function outputs (ON/OFF) the output signal (Y) specified by the output signal (usYNo) in units of bits (one point).
• It turns OFF/ON according to the specified value for bit 0 of the data storage location (usData). (The values of bits 1 to 7 are
ignored.)
• When the function is executed while the operating status of the CPU module is not RUN, an error in the STOP/PAUSE state
occurs.
• When the function is executed for "Input module", an I/O assign error occurs.
• Do not specify an output module managed by another CPU module for the output signal (usYNo).
Otherwise, operation for the output module is treated as non-processing.
■Return value
Return value Description
0 (0000H) Normally finished
Other than 0 Failed
For details when the function fails, refer to the following.
MELSEC iQ-R C Controller Module Programming Manual
4 DEVICE ACCESS
52 4.2 C Controller module dedicated functions
CCPU_Y_Out_WordEx
This function outputs the output signal (Y) in units of words (16 points).
■Format
short CCPU_Y_Out_WordEx (short sFlg, unsigned short usYNo, unsigned short usSize, unsigned short* pusDataBuf,
unsigned short usBufSize)
■Argument
Argument Name Description IN/OUT
sFlg Access flag Specifies the access flag. IN
• 0: Normal access
• Others: Reserved
usYNo Start output signal Specifies the start output signal (Y). IN 4
(Specify a multiple of 16.)
usSize Output size Specifies the output size in units of words. IN
pusDataBuf Data storage location Specifies the storage location of output data. IN
usBufSize Data storage location size Specifies 0. IN
■Description
• This function outputs (ON/OFF) data in the data storage location (pusDataBuf) to output signals (Y) amounting to the size
specified by the data size (usSize), starting from the start output signal (Y) specified by the start output signal (usYNo).
• When the function is executed while the operating status of the CPU module is not RUN, an error in the STOP/PAUSE state
occurs.
• When the function is executed for "Input module", an I/O assign error occurs.
• Do not specify an output module managed by another CPU module for the output signal (usYNo).
Otherwise, operation for the output module is treated as non-processing.
• As shown below, store output data in the data storage location (pusDataBuf) in the order from the earliest to the oldest,
starting from the lower bits.
pusDataBuf Description
pusDataBuf[0] Normally finished
pusDataBuf[1] Failed
pusDataBuf[usSize-1] Data in usYNo+(usSize–1)16+FH to usYNo+(usSize–1)16
■Return value
Return value Description
0 (0000H) Normally finished
Other than 0 Failed
For details when the function fails, refer to the following.
MELSEC iQ-R C Controller Module Programming Manual
4 DEVICE ACCESS
4.2 C Controller module dedicated functions 53
CCPU_ReadDevice
This function reads data from the internal user device and internal system device of the C Controller module.
■Format
short CCPU_ReadDevice (short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf,
unsigned long ulBufSize)
■Argument
Argument Name Description IN/OUT
sDevType Device type Specifies the device type. IN
Page 55 Device type
ulDevNo Start device No. Specifies the start device number. IN
(For bit devices, only a multiple of 16 can be specified.)
ulSize Data size Specifies the read data size in units of words. IN
pusDataBuf Data storage location Specifies the storage location of read data. OUT
ulBufSize Data storage location size Specifies the data storage location size in units of words. IN
■Description
This function reads data of devices amounting to the size specified by the data size (ulSize), starting from the device specified
by the device type (sDevType) and start device number (ulDevNo), and stores it in the data storage location (pusDataBuf).
Precautions
For the data storage location size (ulBufSize), set a value larger than the value of the data size (ulSize).
■Return value
Return value Description
0 (0000H) Normally finished
Other than 0 Failed
For details when the function fails, refer to the following.
MELSEC iQ-R C Controller Module Programming Manual
4 DEVICE ACCESS
54 4.2 C Controller module dedicated functions
CCPU_WriteDevice
This function writes data to the internal user device and internal system device of the C Controller module.
■Format
short CCPU_WriteDevice (short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf,
unsigned long ulBufSize)
■Argument
Argument Name Description IN/OUT
sDevType Device type Specifies the device type. IN
Page 55 Device type
ulDevNo Start device No. Specifies the start device number. IN
(For bit devices, only a multiple of 16 can be specified.) 4
ulSize Data size Specifies the write data size in units of words. IN
pusDataBuf Data storage location Specifies the storage location of write data. IN
ulBufSize Data storage location size Specifies 0. IN
■Description
This function writes data in the data storage location (pusDataBuf) amounting to the size specified by the data size (ulSize) to
devices starting from the device specified by the device type (sDevType) and start device number (ulDevNo).
■Return value
Return value Description
0 (0000H) Normally finished
Other than 0 Failed
For details when the function fails, refer to the following.
MELSEC iQ-R C Controller Module Programming Manual
Device type
Device type refers to the device type to be specified for C Controller module dedicated functions.
Devices are defined in the header file "CCPUFunc.h".
4 DEVICE ACCESS
4.2 C Controller module dedicated functions 55
CCPU_SetDotMatrixLED
This function sets a value to be displayed in the dot matrix LED control of the C Controller module.
■Format
short CCPU_SetDotMatrixLED(unsigned short usLedMode, char* pcData)
■Argument
Argument Name Description IN/OUT
usLedMode Output mode Specifies the output mode for the dot matrix LED. IN
(If reserved is specified, the function finishes normally with non-processing.)
• 0: Dot mode
• 1: ASCII mode
• Others: Reserved
pcData LED data Specifies the LED data. IN
Ex.
When the following bit patterns are output to the dot matrix LED
1st column
2nd column
5th column
4 DEVICE ACCESS
56 4.2 C Controller module dedicated functions
Mode 1: In ASCII mode
The specified string is displayed in pcData[0] to pcData[3].
The following table lists the characters that can be specified (ASCII code).
: Character specification not allowed
Bit Upper 4 bits
0 1 2 3 4 5 6 7 8 9 A B C D E F
Lower 4 bits 0 SP 0 P
1 1 A Q
2 2 B R
3 3 C S
4 4 D T
5
6
%
5
6
E
F
U
V
4
7 7 G W
8 8 H X
9 9 I Y
A J Z
B K
C L
D - M
E . N
F / O
■Description
In accordance with the method specified by the output mode (usLedMode), values specified for LED data (pcData) are
displayed on the dot matrix LED.
Precautions
• To display data on the dot matrix LED, "USER" must be selected for the operation selection mode.
(MELSEC iQ-R C Controller Module User's Manual (Startup))
• When the MODE/SELECT switch is operated, if the operation is being checked or the selected operation is being checked,
even with "USER" selected for the operation selection mode, an error occurs when the CCPU_SetDotMatrixLED function is
executed.
■Return value
Return value Description
0 (0000H) Normally finished
Other than 0 Failed
For details when the function fails, refer to the following.
MELSEC iQ-R C Controller Module Programming Manual
4 DEVICE ACCESS
4.2 C Controller module dedicated functions 57
4.3 Exercise 1 Device Control
Check the operation using a program that performs control for inputting and outputting device values of the C Controller
module.
The engineering tool CW Workbench is used for the exercise. For details on CW Workbench, refer to the following.
Page 137 CW Workbench
Creating a project
Make preparations in advance of the exercise.
In this manual, CW Workbench is assumed to have already been installed.
In addition, as a workspace, create "C:\CCPU_CWW_Prj\enshu" on a personal computer.
Starting up CW Workbench
Operating procedure
1. Select [Start] [All Apps] [Wind River] [CW
Workbench 3.3] [CW Workbench 3.3].
3. Click!
• The size of each window and the icon layout in the initialized state of CW Workbench differ depending on
the personal computer used. When the actual screen is different from the screen described in this manual,
adjust the size of each window.
• To enlarge, delete, or restore the initial state of each window, select [Window] on the menu [New
Window].
4 DEVICE ACCESS
58 4.3 Exercise 1 Device Control
Creating a new project
Operating procedure
1. Click [File] on the menu [New] [Wind River
Workbench Project].
1. Click!
4
2. Select "Wind River VxWorks6.9".
2. Select!
3. Click!
4. Select!
5. Click!
6. Click!
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 59
Setting properties for the project
Configure settings for converting (building) the created project into a module that can be executed by the C Controller module.
Build: Compile source code according to the processor and establish linkage with the include files.
Operating procedure
1. In the Project Explorer window, select the created
project and click [Project] on the menu [Properties].
1. Click!
2. Select!
3. Double-click!
4 DEVICE ACCESS
60 4.3 Exercise 1 Device Control
4. In "Available and enabled build specs", select only the
checkbox for "ARMARCH7gnu_SMP".
5. Check!
6. Enter!
7. Enter!
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 61
■Setting include files
Create in advance an include folder for storing include files in the following location.
C:\CCPU_CWW_Prj\Include
Operating procedure
1. Select the [Paths] tab and click the [Add] button.
1. Click!
2. Click!
3. Click!
4. Click!
4 DEVICE ACCESS
62 4.3 Exercise 1 Device Control
5. In the "Add include search path to selected build spec"
window, check that the selected folder is specified.
5. Check!
6. Click the [OK] button.
6. Click!
7. Check!
8. Click!
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 63
11. In the "Log on as" window, enter the following user
name and password.
[Setting details]
User name: target
Password: password
11. Enter!
12. Click!
13. Copy!
4 DEVICE ACCESS
64 4.3 Exercise 1 Device Control
Exercise 1.1 Switch input and lamp output
Acquire ON/OFF information of switches M0 to M15 of the demonstration machine, and among lamps Y170 to Y17F of the
demonstration machine, turn on the lamps with the same bit numbers as the bit numbers of switches turned on. In addition,
display the number of switch operations on the dot matrix LED, and when the number of operations exceeds 25, stop the
processing and reset the lamp output and dot matrix LED display.
For operation check, the following shows an overview of the procedure.
Operating procedure
1. Copy the program enshu1_1.c to the project folder C:\CCPU_CWW_Prj\enshu\enshu1 created this time to add it to the
project. ( Page 66 Procedure for adding a program)
4. Debug the created program to check if it operates correctly. ( Page 73 Debugging the user program)
5. Rebuild the program enshu1_1.c that underwent debugging by canceling the debug mode, and store the created user
program on the C Controller module. ( Page 80 Registering a module for execution)
6. Create a script and store it in the C Controller module. ( Page 82 Registering a module for execution)
7. Reset the C Controller module and set the switch on the front to the RUN position.
8. Turn on/off switches M0 to M15 of the demonstration machine, check the lamp outputs from Y170 to Y17F, and check
that the number of switch operations is displayed on the dot matrix LED of the C Controller module. ( Page 83
Checking the operation)
9. After the operation is checked completely, disconnect CW Workbench from the C Controller module ( Page 72
Connecting and disconnecting) once, delete the user program and script stored in the C Controller module, and reset the
C Controller module.
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 65
Procedure for adding a program
Operating procedure
1. Copy the already programmed enshu1_1.c to
C:\CCPU_CWW_Prj\enshu\enshu1.
2. Select!
In this exercise, a user program is assumed to have already been created. For details on how to create a new
user program, refer to the following.
Page 137 Creating a new user program
4 DEVICE ACCESS
66 4.3 Exercise 1 Device Control
Generating a module for execution
Convert (build) the created program into a module that can be executed by the C Controller module.
Operating procedure
1. In the "Project Explorer" window, select the created
project and right-click the mouse select [Rebuild
Project].
1. Select!
2. Click!
When the build process finishes normally, the folder in which a user program is generated is as follows.
• Debug mode
(Workspace folder)\(Project name folder)\ARMARCH7gnu_SMP\(Project name folder)\Debug
• Non Debug mode
(Workspace folder)\(Project name folder)\ARMARCH7gnu_SMP\(Project name folder)\NonDebug
When a user program is generated in an imported project, the above folders change depending on the
folder in which the imported project exists and the project structure.
For the folder in which a user program is generated, check with the imported project.
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 67
Precautions
■If the build result is an error
Error information (source file names, line numbers, error descriptions) is displayed in red in the "Build Console" window.
Double-click a line where the source file name and line number are displayed in red to jump to where an error occurred in the
source file.
Repeat source code correction & building until error information (red) disappears from the build result.
4 DEVICE ACCESS
68 4.3 Exercise 1 Device Control
Connecting the C Controller module and CW Workbench
Connect the Ethernet port (CH1) of the C Controller module and CW Workbench to perform debugging with CW Workbench.
Operating procedure
1. Using Explorer, connect to ftp://192.168.3.3/
SYSTEMROM/OS_IMAGEFILE/.
3. Click!
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 69
5. Click in the Remote Systems window.
5. Click!
6. Select!
7. Click!
4 DEVICE ACCESS
70 4.3 Exercise 1 Device Control
9. Select "File" for "Kernel image".
10. Click the [Browse] button.
9. Select!
10. Click!
4
11. Click!
12. Click!
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 71
13. When "connected - target server running" is displayed at
the bottom of the Remote Systems window, the
connection is completed.
4 DEVICE ACCESS
72 4.3 Exercise 1 Device Control
Debugging the user program
Check that the created program operates correctly.
Script file: A file in which information such as the load destination of the user program to be activated when the
C Controller module starts up and the order of startup is described
Operating procedure 4
1. In the Project Explorer window, select the created
module file "enshu1.out", and right-click the mouse
select [Download] [VxWorks Kernel Task].
2. Check!
2. Click!
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 73
When performing the operation in 2 for the second time or later, the "Launch Configuration Selection" window
is displayed.
Select "Launch the selected launch configuration" and click the [OK] button.
Select!
Click!
4 DEVICE ACCESS
74 4.3 Exercise 1 Device Control
■Debugging the user program
Check that the debug mode is applied to the project before operating the project.
Page 60 Setting properties for the project
Operating procedure
1. In the Project Explorer window, select the created
1. Click! project and click the [] button on the right of the
toolbar .
2. Click!
5. Click!
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 75
6. Select the debug start function "enshu1_1" and click the
[OK] button.
6. Click!
7. Check!
7. Click!
4 DEVICE ACCESS
76 4.3 Exercise 1 Device Control
9. Use the [1 step execution] button in the Debug window
to perform debugging one step at a time.
9. Click!
4
10. Click the Variables window tab at the lower right of the
window to check or change the value of each variable.
Here, check that the return value for the CCPU function
"sRet" is 0 (normal value).
Using step execution in step 9. , debug up to the line
"" points to.
In the [Variables] tab, check that the value of sRet is 0
(normal value).
10. Execute! 11. Repeat steps 9. and 10., and debug the created
program entirely.
10. Check!
If the return value for the C Controller module dedicated function is not 0, perform troubleshooting by referring
to the following.
C Controller Module Programming Manual
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 77
■Debug procedure using Breakpoint
Instead of debugging one step at a time, debugging can be performed by specifying Breakpoint at any point in the program.
Operating procedure
1. Double-click the left end of the source file to insert
Breakpoint.
1. Double-click!
2. Click .
The program is executed up to the point specified by
Breakpoint.
2. Click!
3. Click!
4 DEVICE ACCESS
78 4.3 Exercise 1 Device Control
To start debugging again, click the [] button on the right of the toolbar , and select the already generated
debug structure at the top of the popup window displayed.
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 79
Registering a module for execution
Build the created program into a program for operation, and store it in the C Controller module.
Operating procedure
1. In the Project Explorer window, select the created
project and click [Project] on the menu [Properties].
1. Click!
2. Click!
2. Clear!
4 DEVICE ACCESS
80 4.3 Exercise 1 Device Control
■Storing the user program
Operating procedure
1. Start up Explorer and enter the following for the address
field of the C Controller module.
ftp://192.168.3.3/0
1. Enter!
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 81
■Creating and storing a script file
Operating procedure
1. Open a text file and write the content of a script file for
loading a user program and generating a task as shown
in the window.
Load the file
"enshu1.out" from 2. Save the file with the file name "STARTUP.CMD".
program memory "0".
A user program and script file can be stored not only in the program memory, but also in the SD memory card.
If a script file is stored in both areas, the script file in the SD memory card starts up first.
4 DEVICE ACCESS
82 4.3 Exercise 1 Device Control
Checking the operation
Execute the program registered in the C Controller module to check its operation.
For operation, use the RESET/STOP/RUN switch on the front of the C Controller module.
The applications of the RUN/STOP/RESET switch are as follows.
• RUN: Output (Y) from the user program, allowed to be written to the buffer memory
• STOP: Output (Y) from the user program, not allowed to be written to the buffer memory
• RESET: Reset the module
• Program operation in the C Controller module is executed regardless of whether the status of the switch is
RUN or STOP.
• For details on the RUN/STOP/RESET switch, refer to the following. 4
(MELSEC iQ-R C Controller Module User's Manual (Startup))
Operating procedure
1. Reset the C Controller module and set the switch on the
front to the RUN position.
For details on the reset procedure, refer to the following.
Page 21 Reset operation procedure
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 83
Source code
The following shows the source code of the program enshu1_1.
4 DEVICE ACCESS
84 4.3 Exercise 1 Device Control
4
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 85
Exercise 1.2 Input device and display device
Add the input values of the input devices D20 and D21 of the demonstration machine, and display the result in the display
device D0.
Operating procedure
1. Copy the program enshu1_2.c to the project folder C:\CCPU_CWW_Prj\enshu\enshu1 to add it to the project. (
Page 66 Procedure for adding a program)
3. Connect the C Controller module and CW Workbench. ( Page 72 Connecting and disconnecting)
4. Debug the created program to check if it operates correctly. ( Page 73 Debugging the user program)
5. Rebuild the program enshu1_2.c that underwent debugging by canceling the debug mode, and store the created user
program on the C Controller module. ( Page 80 Registering a module for execution)
6. Create a script and store it in the C Controller module. ( Page 82 Registering a module for execution)
[Script details]
Load a program: ld (1, 0, "/0/enshu1.out")
Generate a task: sp (enshu1_2)
7. Reset the C Controller module and set the switch on the front to the RUN position.
8. Change the values of the input devices D20 and D21 of the demonstration machine, and check the change of the value
of the display device D0. ( Page 86 Checking the operation)
9. After the operation is checked completely, disconnect CW Workbench from the C Controller module ( Page 72
Connecting and disconnecting) once, and delete the user program and script stored in the C Controller module.
4 DEVICE ACCESS
86 4.3 Exercise 1 Device Control
Source code
The following shows the source code of the program enshu1_2.
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 87
4 DEVICE ACCESS
88 4.3 Exercise 1 Device Control
Exercise 1.3 Executing two programs
Start up a task for executing enshu1_1() and a task for executing enshu1_2() at the same time.
In exercise 1.3, check that two tasks can operate at the same time. Generate two tasks, tEnshu1_1 and tEnshu1_2, with the
API function of VxWorks taskSpawn(), so that tEnshu1_1 executes enshu1_1() and tEnshu1_2 executes enshu1_2().
Operating procedure
1. Copy the program enshu1_3.c to the project folder C:\CCPU_CWW_Prj\enshu\enshu1 to add it to the project. (
Page 66 Procedure for adding a program)
3. Connect the C Controller module and CW Workbench. ( Page 72 Connecting and disconnecting)
4
4. Debug the created program to check if it operates correctly. ( Page 73 Debugging the user program)
5. Rebuild the program enshu1_3.c that underwent debugging by canceling the debug mode, and store the created user
program on the C Controller module. ( Page 80 Registering a module for execution)
6. Create a script and store it in the C Controller module. ( Page 81 Storing the user program)
[Script details]
Load a program: ld (1, 0, "/0/enshu1.out")
Generate a task: sp (enshu1_3)
7. Reset the C Controller module and set the switch on the front to the RUN position.
8. Check that the operations in exercises 1.1 and 1.2 can be executed at the same time. ( Page 83 Checking the
operation)
9. After the operation is checked completely, disconnect CW Workbench from the C Controller module ( Page 72
Connecting and disconnecting) once, and delete the user program and script stored in the C Controller module.
4 DEVICE ACCESS
4.3 Exercise 1 Device Control 89
Source code
The following shows the source code of the program enshu1_3.
4 DEVICE ACCESS
90 4.3 Exercise 1 Device Control
5 OPERATING INTELLIGENT FUNCTION
MODULES
5.1 Intelligent Function Modules
R12CCPU-V
External I/F
X/Y
X/Y/M/D
Device memory such as
Function
Input X
CPU
Output Y (Bit data)
Program
Buffer memory
Read data
For example, input signals from an analog-digital converter module are as follows.
• Ready signal
This signal inputs the information that the intelligent function module operates normally and is ready to the CPU when the
power is turned on.
• A/D conversion completion flag
This signal is turned on when conversion is completed at all the conversion enabled channels. When reading a digital
output value, this signal is used as an interlock.
Output enable/ Y
disable
Y
User range write
Y
Channel change
Y
Synchronized output
• Data can be read from/written to the buffer memory by calling the C Controller module dedicated function
(CCPU_FromBuf() or CCPU_ToBuf()).
• The buffer memory has an address specific to each intelligent function module for each word (short type (16 bits)).
The addresses of the buffer memory start from 0, and data is read/written by specifying them. The minimum unit of
measurement is 1 word. 17 to 32-bit data is handled by using 2 words (32 bits).
The following figure shows an example of 16 bits for the digital-analog converter module; the digital quantity is written from
the CPU. In the contents, a digital value of -32000 to 32000 is set using 16-bit signed binary data.
B15 B14 B13 B12 B11 B10 B9 B8 B7 B6 B5 B4 B3 B2 B1 B0
0 0 0 0 1 0 0 0 1 0 1 0 0
Data section
Sign bit
1: Negative The case of +276 is shown.
0: Positive (A negative digital value is expressed in two's
complement.)
■Format
short CCPU_FromBuf (unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf,
unsigned long ulBufSize)
■Argument
Argument Name Description IN/OUT
usIoNo Module position Specify the module position. IN
Start I/O No. 16 (0H to FFH, 3E0H to 3E3H)
ulOffset Offset Specify the offset in units of words. IN
ulSize Data size Specify the read data size in units of words. IN
pusDataBuf Data storage location Specify the storage location of read data. OUT
ulBufSize Data storage size Specify the data storage location size in units of words. IN
■Description
• This communication method reads data amounting to the size specified by the data size (ulSize) from the CPU buffer
memory of the CPU module specified by the module position (usIoNo) and the buffer memory of the intelligent function
module specified by the module position (usIoNo), and stores that data in the data storage location (pusDataBuf).
• Read data by specifying the offset address from the start of the CPU buffer memory of the CPU module and the buffer
memory of the intelligent function module each for the offset (ulOffset).
• To access the CPU buffer memory of the multi-CPU (CPU No.1 to CPU No.4), specify 3E0H to 3E3H (CPU No.1 to CPU
No.4) for the module position (usloNo). However, the CPU buffer memory can be accessed only when the multiple CPU
settings are configured.
Precautions
For the data storage location size (ulBufSize), set a value larger than the value of the data size (ulSize).
■Return value
Return value Description
0 (0000H) Normally finished
Other than 0 Failed
For details on when the function fails, refer to the following.
MELSEC iQ-R C Controller Module Programming Manual
■Format
short CCPU_ToBuf (unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf,
unsigned long ulBufSize)
■Argument
Argument Name Description IN/OUT
usIoNo Module position Specify the module position as follows. IN
For the CPU buffer memory, access can be made to the host CPU module only.
Start I/O No. 16 (0H to FFH, 3E0H to 3E3H)
ulOffset Offset Specify the offset in units of words. IN
ulSize Data size Specify the write data size in units of words. IN
pusDataBuf Data storage location Specify the storage location of write data. IN 5
ulBufSize Data storage size Specify 0. IN
■Description
• This communication method writes data in the data storage location (pusDataBuf) amounting to the data size (ulSize) to the
CPU buffer memory of the CPU module (host CPU module) specified by the module position (usIoNo) and the buffer
memory of the intelligent function module specified by module position (usIoNo).
Write data by specifying the offset address from the start of the CPU buffer memory of the CPU module (host CPU module)
and the buffer memory of the intelligent function module each for the offset (ulOffset).
• To access the CPU buffer memory (host CPU module) of the multi-CPU (CPU No.1 to CPU No.4), specify 3E0H to 3E3H
(CPU No.1 to CPU No.4) for the module position (usloNo). However, the CPU buffer memory (host CPU module) can be
accessed only when the multiple CPU settings are configured.
• When the operating status of the CPU module is not RUN, an error in the STOP/PAUSE state (-28640) occurs if the
CCPU_ToBuf function is executed.
■Return value
Return value Description
0 (0000H) Normally finished
Other than 0 Failed
For details on when the function fails, refer to the following.
MELSEC iQ-R C Controller Module Programming Manual
R60 R60
R61P R12C AD4 DA4
CPU-V (16 (16
points) points)
X/Y00 X/Y10
to to
X/Y0F X/Y1F
CH1 CH1
V V
(4)
(5)
(6)
16003
Digital output value
16002
Digital output
0 16001
16000
312.5μV
5.0000000V
5.0003125V
-32000
-10V 0 10V
Analog input voltage
Input voltage
The analog-digital converter module converts analog inputs from outside into digital quantities to make arithmetic operation by
the CPU possible. For voltage input, when -10V is input, a digital quantity of -32000 is output, and when 10V is input, 32000 is
output. Therefore, an input of 312.5V is equivalent to a digital quantity of 1, and a value smaller than 312.5V, which cannot
be converted, is discarded.
16003
Digital output
16002
16001
0 16000
625nA
10.000000mA
10.000625mA
-32000
-20 mA 0 20mA Input current
Analog input current
For current input, when 0mA is input, 0 is output, and when 20mA is input, 32000 is output. 625nA is equivalent to a digital
quantity of 1, and a value smaller than 625nA, which cannot be converted, is discarded.
A voltage/current value equivalent to the digital value 1 in A/D conversion (maximum resolution) differs
depending on the input range setting.
• The I/O numbers (X/Y) below indicate numbers when the start I/O number of the A/D converter module is
set to 0.
• The use-prohibited signals below are used by the system, and cannot be used by the customer. If the
customer uses any of them (turns from off to on), the function as the A/D converter module cannot be
guaranteed.
■Input signal
Device No. Signal name
X0 Module READY
5
X1 to X7 Use prohibited
X8 Warning output signal
X9 Operating condition setting completion flag
XA Offset/gain setting mode status flag
XB Channel change completed flag
XC Input signal error detection signal
XD Maximum value/minimum value reset completed flag
XE A/D conversion completed flag
XF Error flag
■Output signal
Device No. Signal name
Y0 to Y8 Use prohibited
Y9 Operating condition setting request
YA User range write request
YB Channel change request
YC Use prohibited
YD Maximum value/minimum value reset request
YE Use prohibited
YF Error clear request
Of all the buffer memory areas, do not write data to system areas and areas whose data type is monitor. If
data is written to them, malfunction may occur.
■Un\G0~Un\G399
Address Address Name Default value Data type Auto Necessity of
(decimal) (hexadecimal) refresh Y9*1
0 0H Latest error code 0 Monitor
1 1H Latest address of error history 0 Monitor
2 2H Latest alarm code 0 Monitor
3 3H Latest address of alarm history 0 Monitor
4 to 19 4H to 13H Interrupt factor detection flag [n]*2 0 Monitor
20 to 35 14H to 23H System area
36 24H Warning output flag (process alarm upper 0000H Monitor
limit)
37 25H Warning output flag (process alarm lower 0000H Monitor
limit)
38 26H Warning output flag (rate alarm upper limit) 0000H Monitor
39 27H Warning output flag (rate alarm lower limit) 0000H Monitor
40 28H Input signal error detection flag 0000H Monitor
41 29H System area 0000H
42 2AH A/D conversion completed flag 0000H Monitor
43 to 89 2BH to 59H System area
90 5AH Level data 0 0 Control
91 5BH Level data 1 0 Control
92 5CH Level data 2 0 Control
93 5DH Level data 3 0 Control
94 5EH Level data 4 0 Control
95 5FH Level data 5 0 Control
96 60H Level data 6 0 Control
97 61H Level data 7 0 Control
98 62H Level data 8 0 Control
99 63H Level data 9 0 Control
100 to 123 64H to 7BH System area
124 to 139 7CH to 8BH Interrupt factor mask [n]*2 0 Control
140 to 155 8CH to 9BH System area
156 to 171 9CH to ABH Interrupt factor reset request [n]*2 0 Control
172 to 199 ACH to C7H System area
200 to 215 C8H to D7H Interrupt factor occurrence setting [n]*2 0 Setting
216 to 231 D8H to E7H System area
232 to 247 E8H to F7H Condition target setting [n]*2 0 Setting
248 to 263 F8H to 107H System area
264 to 279 108H to 117H Condition target channel setting [n]*2 0 Setting
280 to 295 118H to 127H System area
296, 297 128H, 129H Mode switching setting 0 Setting
298 to 399 12AH to 18FH System area
*1 Item enabled when 'Operating condition setting request' (Y9) turns on and off
*2 The default values are as follows.
CH1: 402, CH2: 602, CH3: 802, CH4: 1002, CH5: 1202, CH6: 1402, CH7: 1602, CH8: 1802
5
Operating procedure
1. [Parameter] in the Navigation window [Module
Information] double-click [0000: R60AD4].
1. Double-click!
4. Click!
5. Check!
6. Click!
(4)
(5)
(6)
5.0003125V
312.5μV
5.0000000V
-10V
5
16000
16001
16002
16003
16004
-32000 0 32000
Digital input value
Digital input
The digital-analog converter module converts digital quantities output from the CPU into analog values to output them
externally. When a digital quantity of -32000 is input, -10V is output, and when a digital quantity of 32000 is input, 10V is
output. Therefore, the digital input value 1 is equivalent to the analog amount 312.5V, and a digital input smaller than 1
cannot be converted.
0
10.000625mA
625nA
10.000000mA
16000
16001
16002
16003
-20mA
-32000 0 32000
Digital input value
Input
For current output, 0 is converted to 0mA, and 32000 is converted to 20mA. The digital input value 1 is equivalent to the
analog amount 625nA, and a digital input smaller than 1 cannot be converted.
A voltage/current value equivalent to the digital value 1 in D/A conversion (maximum resolution) differs
depending on the input range setting.
• The I/O signals (X/Y) below indicate signals when the start I/O number of the D/A converter module is set to
0.
• The use-prohibited signals below are used by the system, and cannot be used by the customer. If the
customer uses any of them (turns from off to on), the function as the D/A converter module cannot be
guaranteed.
■Input signal
Device No. Signal name
X0 Module READY
X1 to X6 Use prohibited
X7 External power supply READY flag
X8 Use prohibited
X9 Operating condition setting completion flag
XA Offset/gain setting mode status flag
XB Channel change completed flag
XC Set value change completed flag
XD Disconnection detection signal
XE Warning output signal
XF Error flag
■Output signal
Device No. Signal name
Y0 Use prohibited
Y1 CH1 Output enable/disable flag
Y2 CH2 Output enable/disable flag
Y3 CH3 Output enable/disable flag
Y4 CH4 Output enable/disable flag
Y5*1 CH5 Output enable/disable flag
Y6*1 CH6 Output enable/disable flag
Y7*1 CH7 Output enable/disable flag
Y8*1 CH8 Output enable/disable flag
Y9 Operating condition setting request
YA User range write request
YB Channel change request
YC Value change request
YD Use prohibited
YE Warning output clear request
YF Error clear request
Of all the buffer memory areas, do not write data to system areas and areas whose data type is monitor. If
data is written to them, malfunction may occur.
■Un\G0~Un\G399
Address Address Name Default value Data type Auto Necessity of
(decimal) (hexadecimal) refresh Y9*1 5
0 0H Latest error code 0 Monitor
1 1H Latest address of error history 0 Monitor
2 2H Latest alarm code 0 Monitor
3 3H Latest address of alarm history 0 Monitor
4 to 19 4H to 13H Interrupt factor detection flag [n]*2 0 Monitor
20 to 35 14H to 23H System area
36 24H Alert output upper limit flag 0000H Monitor
37 25H Alert output lower limit flag 0000H Monitor
38 26H Disconnection detection flag 0000H Monitor
39 to 59 27H to 3BH System area
60 3CH Output mode 0000H Monitor
61 to 123 3DH to 7BH System area
124 to 139 7CH to 8BH Interrupt factor mask [n]*2 0 Control
140 to 155 8CH to 9BH System area
156 to 171 9CH to ABH Interrupt factor reset request [n]*2 0 Control
172 to 187 ACH to BBH System area
188 BCH Step action wave output request 0 Control
189 to 199 BDH to C7H System area
*2
200 to 215 C8H to D7H Interrupt factor generation setting [n] 0 Setting
216 to 231 D8H to E7H System area
232 to 247 E8H to F7H Condition target setting [n]*2 0 Setting
248 to 263 F8H to 107H System area
264 to 279 108H to 117H Condition target channel setting [n]*2 0 Setting
280 to 295 118H to 127H System area
296, 297 128H, 129H Mode switching setting 0 Setting
298 to 399 12AH to 18FH System area
*1 Item enabled when 'Operating condition setting request' (Y9) turns on and off
*2 [n] in the table is an interrupt setting number. (n= 1 to 16)
*1 Item enabled when 'Operating condition setting request' (Y9) turns on and off
Operating procedure
1. [Parameter] in the Navigation window [Module
Information] double-click [0010: R60DA4].
1. Double-click!
4. Click!
5. Check!
6. Click!
Writing parameters
Operating procedure
1. Refer to Page 46 Writing parameters to the C
Controller module and write the parameters set in
"Setting intelligent function module data" to the C
Controller module.
1. Select!
3. Select!
Input voltmeter (GOT) 4. Check the current value by selecting the item "Buffer
Input volume Memory Monitor" "Digital output value" "CH1
Digital output value". The R60AD4 receives an analog
input value from the A/D INPUT of the demonstration
machine at CH1, converts it through A/D conversion,
and stores a digital output value to the address
U0\G400 of its own buffer memory. This item indicates
the current value of the above digital output value.
Operate the input volume tab for the A/D INPUT of the
demonstration machine to check that the digital output
value changes according to the A/D conversion
characteristics of the R60AD.
1. Select!
3. Click!
Operating procedure
1. Start up CW Workbench and newly create a project named "enshu2". ( Page 58 Creating a project)
A workspace does not need to be set again because the workspace is the same as the one set in exercise 1.
2. Copy the program enshu2_2.c to the project folder C:\CCPU_CWW_Prj\enshu\enshu2 to add it to the project. (
Page 66 Procedure for adding a program)
4. Connect the C Controller module and CW Workbench. ( Page 72 Connecting and disconnecting)
5. Debug the created program to check if it operates correctly. ( Page 73 Debugging the user program)
6. Rebuild the program enshu2_2.c that underwent debugging by canceling the debug mode, and store the created user
program on the C Controller module. ( Page 80 Registering a module for execution)
7. Create a script and store it in the C Controller module. ( Page 80 Registering a module for execution)
[Script details]
Load a program: ld (1, 0, "/0/enshu2.out")
Generate a task: sp (enshu2_2)
8. Reset the C Controller module and set the switch on the front to the RUN position.
9. Operate the switch M2 of the demonstration machine. A value obtained by converting an input voltage from the
demonstration machine into a digital value is displayed in the display device D1 of the HMI. Turn the input volume tab for
the A/D INPUT to check that the value on D1 changes when the input voltage is changed. ( Page 123 Checking the
operation)
10. After the operation is checked completely, disconnect CW Workbench from the C Controller module ( Page 72
Connecting and disconnecting) once, and delete the user program and script stored in the C Controller module.
3. Turn the input volume tab for A/D INPUT, and the meter
value for the A/D INPUT changes and a value obtained
by converting an input voltage into a digital value is
displayed in the display device D1.
5
Input volume
Operating procedure
1. Copy the program enshu2_3.c to the project folder C:\CCPU_CWW_Prj\enshu\enshu2 to add it to the project. (
Page 66 Procedure for adding a program)
3. Connect the C Controller module and CW Workbench. ( Page 72 Connecting and disconnecting)
4. Debug the created program to check if it operates correctly. ( Page 73 Debugging the user program)
5. Rebuild the program enshu2_3.c that underwent debugging by canceling the debug mode, and store the created user
program on the C Controller module. ( Page 80 Registering a module for execution)
6. Create a script and store it in the C Controller module. ( Page 80 Registering a module for execution)
[Script details]
Load a program: ld (1, 0, "/0/enshu2.out")
Generate a task: sp (enshu2_3)
7. Reset the C Controller module and set the switch on the front to the RUN position.
8. Operate the switch M3 of the demonstration machine. Check that the value set by the input device D21 of the HMI is
converted through D/A conversion and output to the D/A OUTPUT. When the value of the input device D21 is 32001 or
more, D/A conversion is not performed, and the lamp Y17F turns on. ( Page 126 Checking the operation)
9. After the operation is checked completely, disconnect CW Workbench from the C Controller module ( Page 72
Connecting and disconnecting) once, and delete the user program and script stored in the C Controller module.
Each security function is just one means of preventing unauthorized access (such as destruction of programs
or data) from external devices, but does not prevent it completely. To maintain the safety of the C Controller
system against unauthorized access from external devices, include measures in addition to the security
functions. Mitsubishi Electric Corporation cannot be held responsible for any problems involving system
trouble that may occur as a result of unauthorized access.
The following are examples of measures against unauthorized access.
• Install a firewall.
• Install a personal computer as a relay station to control the relaying of send/receive data using an
application program.
• Install an external device that can control access rights as a relay station. (For details on external devices
that can control access rights, contact the network service provider or equipment dealer.)
APPX
Appendix 1 Security Functions 131
File access restriction
A file attribute can be set to a file stored in the following types of memory. When a file attribute is set, access to the target file
can be restricted, and alteration and file leakage by an unauthorized user can be prevented.
• Program memory
• Data memory
• SD memory card
• USB Mass Storage Class compatible device
• When an SD memory card and USB Mass Storage Class compatible device are mounted on a device other
than the C Controller module (a peripheral such as a personal computer), an access restricted file can be
manipulated. When access restriction is set to a file in an SD memory card and USB Mass Storage Class
compatible device, take measures so that the SD memory card and USB Mass Storage Class compatible
device cannot be removed from the C Controller module freely.
• Access restriction cannot be applied to folders.
*1 Not covered by the file access restriction function. However, when this file attribute is set, deleting or writing to a file can be prohibited.
*2 A file can be manipulated when it is opened by specifying the file name. To prohibit manipulation of a file, the system file attribute must
be set.
APPX
132 Appendix 1 Security Functions
Checking the file access restriction status
The file access restriction status can be checked with the Shell command or the C Controller module dedicated function
(CCPU_GetFileSecurity).
The file access restriction status cannot be checked from the script file (STARTUP.CMD).
• To access a file with the system file attribute in the script file "STARTUP.CMD", clear the access restriction
inside the script file. In that case, to prevent password leakage, assign the system file attribute to the script
file.
• To prevent password leakage, do not use a file with the system file attribute in the script file
(STARTUP.CMD) in an SD memory card.
Precautions
■When safety must be maintained from unauthorized access from outside
To maintain the safety of the C Controller system from unauthorized access from outside, include measures taken by the user. A
To prevent security password leakage, set a password with the following in mind.
• Avoid setting a password using only simple one-byte alphanumeric characters.
• Set a complex password that also includes symbols.
APPX
Appendix 1 Security Functions 133
Setting a service
Set a service that operates in the C Controller module.
By restricting the operating service, unauthorized access from another user can be prevented.
Window
APPX
134 Appendix 1 Security Functions
Password setting
■Current password
Enter the current security password.
Precautions
■CW Configurator operation
When CW Configurator operation is disabled, parameters cannot be set. To enable the service, initialize the C Controller
module.
Lockout
Disables the password authentication for a certain duration of time after a certain number of failed authentication attempts.
Brute-force attacks by malicious users can be prevented.
Lockout time
The following table lists the durations of the lockout times.
Number of password input errors*1 Lockout time
1st time to 5th time 0 minutes
6th time 1 minute
7th time 5 minutes
8th time 15 minutes A
9th time or later 60 minutes
*1 When the correct password is entered, the number of password input errors is reset.
• While lockout is active, a password input error is not counted. For that reason, even if a 7th input error
occurs within one minute after the occurrence of the 6th error, the one minute lockout time is not extended.
• Lockout is not executed if security is set with the C Controller module dedicated function
(CCPU_ChangeFileSecurity).
APPX
Appendix 1 Security Functions 135
Appendix 2 Modules for Realizing Higher-Speed
Analog I/O Conversion
This section describes modules for realizing higher-speed analog I/O conversion.
APPX
136 Appendix 2 Modules for Realizing Higher-Speed Analog I/O Conversion
Appendix 3 CW Workbench
CW Workbench is a product for developing user programs that run on the C Controller module and C intelligent function
module.
It is an OEM product of Wind River Systems in the United States. As a subset product of Wind River Workbench 3.3, it
implements only the functions minimally required for user program development such as coding, building, and debugging.
Features
CW Workbench has the following features.
Operating procedure
1. In the "Project Explorer" window, select a project to
which a new file will be added, and select [File] [New]
[File].
1. Select!
APPX
Appendix 3 CW Workbench 137
2. Enter a file name for "File name" and click the [Finish]
button.
For the file name to be entered for "File name", enter up
to the file extension (.c, .h, .cpp, .hpp).
2. Enter!
2. Click!
• If a character that cannot be used on Windows is entered for "File name", the error text is displayed on the
header section of the window, and the [Finish] button is disabled.
• Do not use the characters below for "File name". If a file containing any of the following characters is
compiled, a compile error occurs.
#, $, &, ‘, (, ), :, =, `, two-byte character, one-byte katakana character
APPX
138 Appendix 3 CW Workbench SH(NA)-082520ENG-A
Programmable Controllers Training Manual
C Controller Basic Course
MODEL
CODE
SH(NA)-082520ENG-A(2203)MEE
HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN
NAGOYA WORKS : 1-14 , YADA-MINAMI 5-CHOME , HIGASHI-KU, NAGOYA , JAPAN
When exported from Japan, this manual does not require application to the
Ministry of Economy, Trade and Industry for service transaction permission.