Hitachi HF-W100E/IoT User Manual

HIOT-63-0002-03
INDUSTRIAL CONTROLLER FOR IoT APPLICATIONS
STARTUP GUIDE
HF-W100E/IoT
USER’S
MANUAL
HIOT-63-0002-03
INDUSTRIAL CONTROLLER FOR IoT APPLICATIONS
STARTUP GUIDE
HF-W100E/IoT
Read safety instructions carefully and understand
them before starting your operation.
Keep this manual at hand for reference.
USER’S
MANUAL
First Edition, September 2017, HIOT-63-0002-01 (out of print) Second Edition, November 2017, HIOT-63-0002-02 (out of print) Third Edition, April 2018, HIOT-63-0002-03
All Rights Reserved, Copyright © 2017, 2018, Hitachi, Ltd. The contents of this publication may be revised without prior notice. No part of this publication may be reproduced in any form or by any means without permission in
writing from the publisher. Printed in Japan.
TP (FL-MW2007)
S-1
SAFETY INSTRUCTIONS
Product Safety Precautions Carefully read and fully understand the safety precautions below before operating the equipment.
Operate the equipment by following the instructions and procedures described in this
manual.
Pay attention especially to safety precautions displayed on the equipment or in this
manual. Make sure you follow them. Otherwise, personal injury and property damage including damage to the equipment may result.
A safety precaution is indicated by a heading as shown below. A heading is either a
safety alert symbol; a word such as “DANGER”, “WARNING”, “CAUTION”, or “NOTICE”; or a combination of both.
This is a safety alert symbol. This symbol is used to signify potential hazards that may result in personal injury or death. Make sure you follow the safety message that follows this symbol in order to avoid possible injury or death.
DANGER: This symbol is used to indicate imminent hazards that
will highly likely result in serious personal injury or death.
WARNING: This symbol is used to indicate potential hazards that
may result in serious personal injury or death.
CAUTION: This symbol is used to indicate potential hazards that
may result in minor or moderate personal injury.
NOTICE: This symbol is used to indicate hazards that may result in
equipment or property damage but not personal injury.
The heading “NOTE” is used to indicate a cautionary note about handling and operation of the equipment.
Do not attempt to perform any operation that is not described in this manual. If there
is any problem with the equipment, call your maintenance personnel.
Read this manual carefully and fully understand the directions and precautions
written in this manual before operating the equipment.
Keep this manual nearby so that you can reference the manual anytime you need it.
Every effort has been made to specify the best precautions on the equipment and in
the manual. Nevertheless, unexpected incidents may occur. When you use the equipment, you are asked not only to follow the instructions but also to use your own judgment on safety.
S-2
SAFETY INSTRUCTIONS (Continued)
Common Safety Precautions Carefully read and fully understand the following safety precautions.
< WARNING>
This equipment is not designed and manufactured to be used for a life-critical
system that requires extreme safety. If there is a possibility that the equipment may be used for this purpose, contact relevant sales representatives.
In case of smoke, a burning smell, or the like, turn off the power to the equipment,
disconnect the power cord from the outlet, and contact your supplier or maintenance personnel. Using the faulty equipment without repair may result in a fire or an electric shock.
This equipment has built-in hard disk drives. Do not hit the equipment or give a
shock or vibration to the equipment because that may cause the equipment to fail. Should you drop the equipment or damage its chassis, disconnect the power cord from the outlet and contact your maintenance personnel. Using the faulty equipment without repair may result in a fire or an electric shock. Do not give a shock to the equipment when unpacking or carrying the equipment.
Never disassemble or modify this equipment. Failure to do so may result in death or
serious injury. In addition, note beforehand that Hitachi is not responsible for the results caused by modification.
S-3
SAFETY INSTRUCTIONS (Continued)
< CAUTION>
If the equipment drops or is tipped over, personal injury may result. Pay full
attention when transporting the equipment.
Make sure you do not catch or hit your fingers to cause personal injury when
unpacking or carrying the equipment.
There may be a danger of injury or damage to this equipment. Do not use this
equipment for purposes other than its original usage.
Do not touch this equipment directly during operation or immediately after shutting
off the power because the equipment may become hot. There is a fear of burn. Install the equipment where the user does not touch the equipment in operation directly by hand.
This equipment alone cannot guarantee the system safety. In order to ensure
sufficient safety of your system even when this equipment should fail, malfunction, or have program bugs, you must add systemic protections such as building external protective/safety circuits to facilitate safety measures to prevent personal injury and serious accidents.
An emergency stop circuit must be provided externally to this product.
Disregarding this rule may result in a damage to the equipment or a hazard to the user if this product fails.
Perform the operation such as the change pf the program, the forced output, and
stop during online (during system operation) after confirming the safety thoroughly. Otherwise, it may result in a damage to the equipment or an accident by wrong operation.
S-4
SAFETY INSTRUCTIONS (Continued)
<NOTICE>
When you work on installation or replacement of hardware, wear an antistatic wrist
strap to prevent the buildup of static electricity.
When you tighten or remove a screw, use a screwdriver that fits the size and type of
the head of the screw to avoid stripping the head. When you tighten a screw, drive a screw along the axis of a tapped hole without adding too much torque in order to avoid damaging the thread.
Do not use the equipment in the environment full of dust or with corrosive gas
because that may cause the equipment to fail.
Do not give a shock to the equipment when unpacking or carrying the equipment. If
you do, that may cause the equipment to fail.
Make sure sufficient clearance is provided for air intake and exhaust in front of and
behind the equipment. Otherwise, the temperature inside the equipment may rise and that may cause a failure or short life span of the equipment. In addition, you need to ensure sufficient clearance for maintenance work.
Use an operating system specified by the Manufacturer. The Manufacturer cannot
guarantee proper operation of the equipment if you use an operating system not specified by the Manufacturer.
Performing emergency shutdown (that is, unplugging the power cord from the
outlet or shutting off the breaker without proper shutdown of the OS) may cause the OS or applications not to work properly or may cause saved data to be corrupted. Do not perform emergency shutdown unless you must stop the system immediately due to some kind of error.
Stop this device (OS shutdown, power-off) after confirming a peripheral equipment
is in stop or not influenced.
When using this device which the equipment targeted for control is connected to,
read carefully the attached instruction manual of this equipment and inspect the movement thoroughly.
Keep in mind that if the power supply is cut, the system may not be able to recover
automatically.
i
PREFACE
This manual mainly describes how to use the software programmable logic controller (PLC) for the industrial controller HF-W100E/IoT (here inaf ter d eno ted as H F-W100E/IoT).
<Organization of this manual>
This manual is organized as follows. CHAPTER 1 INTRODUCTION TO HF-W100E/IoT CHAPTER 2 SETUP CHAPTER 3 CREATING A PLC PROGRAM CHAPTER 4 CONFIGURATION OF EtherCAT CONNECTION CHAPTER 5 CONFIGURATION FOR USING OPC CHAPTER 6 RAS FEATURES IN HF-W100E/IoT
For information about the instructions and cautionary notes related to using devices (hardware) and about how to use the basic RAS features already built into the Hitachi industrial computers, download the electronic manuals for the HF-W100E from the following home page.
http://www.hitachi.co.jp/hfw/
Titles of the electronic manuals
Manual number
HITACHI INDUSTRIAL COMPUTER HF-W100E INSTRUCTION MANUAL
WIN-62-0069
HITACHI INDUSTRIAL COMPUTER HF-W100E RAS FEATURES MANUAL
WIN-63-0095
<Trademarks>
• Microsoft® and Windows® are registered trademarks or trademarks of U.S. Microsoft Corporation in the United States and other countries.
• CODESYS® is a registered trademark of 3S-Smart Software Solutions GmbH, Germany.
• EtherCAT® is licensed and patented by and a registered trademark of Beckhoff Automation GmbH, Germany.
• PLCopen® is a registered trademark of PLCopen.
• All other product names (software and hardware) not from Hitachi described in this manual are registered trademarks, trademarks, or products of their respective owners.
ii
<Note for storage capacity calculations>
Memory capacities and requirements, file sizes and storage requirements, etc. must be
calculated according to the formula 2n. The following examples show the results of such calculations by 2n (to the right of the equals signs). 1 KB (kilobyte) = 1,024 bytes 1 MB (megabyte) = 1,048,576 bytes 1 GB (gigabyte) = 1,073,741,824 bytes 1 TB (terabyte) = 1,099,511,627,776 bytes
Disk capacities, however, must be calculated using the formula 10n. Listed below are the results
of calculating the above example capacities using 10n in place of 2n. 1 KB (kilobyte) = 1,000 bytes 1 MB (megabyte) = 1,0002 bytes 1 GB (gigabyte) = 1,0003 bytes 1 TB (terabyte) = 1,0004 bytes
iii
CONTENTS
SAFETY INSTRUCTIONS ......................................................................................... S-1
CHAPTER 1 INTRODUCTION TO HF-W100E/IoT ............................................... 1-1
1.1 Overview .............................................................................................................................. 1-1
1.2 Specifications ....................................................................................................................... 1-2
1.2.1 Software specifications .................................................................................................. 1-2
1.2.2 LAN interface specifications ......................................................................................... 1-3
1.2.3 BIOS settings ................................................................................................................. 1-4
1.3 Changes to the HF-W Instruction Manual ........................................................................... 1-5
1.3.1 Time required for restoring the factory condition with the recovery DVD ................... 1-5
1.3.2 Recovery DVD name ..................................................................................................... 1-5
CHAPTER 2 SETUP ........................................................................................................... 2-1
2.1 Setup Items ........................................................................................................................... 2-1
2.2 License Activation ............................................................................................................... 2-2
2.2.1 Confirmation of License activation Status .................................................................... 2-2
2.2.2 License activation method ............................................................................................. 2-3
2.2.3 License activation procedure ......................................................................................... 2-4
2.3 Updating the Network Driver ............................................................................................ 2-21
CHAPTER 3 CREATING A PLC PROGRAM ........................................................... 3-1
3.1 PLC Program Creation Procedure ........................................................................................ 3-1
3.1.1 Creating a project ........................................................................................................... 3-1
3.1.2 Creating a PLC program ................................................................................................ 3-3
3.1.3 Building a PLC program ................................................................................................ 3-7
3.1.4 Starting PLC .................................................................................................................. 3-7
3.1.5 Running a PLC program .............................................................................................. 3-12
3.1.6 Debugging a PLC program .......................................................................................... 3-14
3.2 Programming Languages ................................................................................................... 3-16
3.3 Visualization Objects ......................................................................................................... 3-17
3.4 Creating and Setting Up a G-Code .................................................................................... 3-19
3.5 Reset Action When an Error Occurs .................................................................................. 3-23
CHAPTER 4 CONFIGURATION OF EtherCAT CONNECTION ....................... 4-1
4.1 Configuration for Using I/O Modules .................................................................................. 4-2
4.1.1 Adding EtherCAT devices (I/O modules) ..................................................................... 4-2
4.1.2 EtherCAT NIC setting ................................................................................................... 4-8
4.1.3 Setting cycle time for the EtherCAT master and interval for the task ........................... 4-9
4.1.4 EtherCAT slave setting ................................................................................................ 4-11
4.1.5 Checking the EtherCAT connection ............................................................................ 4-13
4.2 Configuration for Using Servo Amplifiers and Servo Motors ........................................... 4-14
4.2.1 Adding EtherCAT devices (servo amplifiers and servo motors) ................................. 4-14
4.2.2 EtherCAT NIC setting ................................................................................................. 4-20
4.2.3 Setting cycle time for the EtherCAT master and interval for the task ......................... 4-21
4.2.4 EtherCAT slave setting ................................................................................................ 4-23
4.2.5 SoftMotion Axis setting ............................................................................................... 4-25
4.2.6 Checking the EtherCAT connection ............................................................................ 4-26
4.3 Troubleshooting for EtherCAT Slave Connection Errors .................................................. 4-26
iv
CHAPTER 5 CONFIGURATION FOR USING OPC ............................................... 5-1
5.1 Overview .............................................................................................................................. 5-1
5.2 Adding OPC Objects ............................................................................................................ 5-2
5.3 DCOM Settings .................................................................................................................... 5-4
5.3.1 DCOM security settings ................................................................................................ 5-4
5.3.2 Firewall settings ........................................................................................................... 5-11
CHAPTER 6 RAS FEATURES IN HF-W100E/IoT .................................................. 6-1
6.1 Overview .............................................................................................................................. 6-1
6.2 RAS Library for the CODESYS Runtime Environment ..................................................... 6-2
6.2.1 RAS library interface ..................................................................................................... 6-2
6.2.2 Adding the RAS library ................................................................................................. 6-7
6.2.3 Examples of using the RAS library ............................................................................. 6-12
6.3 Monitoring the CODESYS Runtime Environment ............................................................ 6-14
6.3.1 Overview ...................................................................................................................... 6-14
6.3.2 Enabling/Disabling the CODESYS runtime environment monitor ............................. 6-16
6.3.3 Event notification ......................................................................................................... 6-20
6.3.4 Recording the event log ............................................................................................... 6-21
6.3.5 HIoTRAS setting command ........................................................................................ 6-22
6.3.6 Changing the startup setting ........................................................................................ 6-26
v
FIGURES
Figure 6-1 Operation Example of the GendoControlN Function .............................................. 6-4
Figure 6-2 Operation Example of the External General Purpose Output1 ................................ 6-4
Figure 6-3 Example of External General Purpose I/O Control Program ................................. 6-13
Figure 6-4 Block Diagram of the Monitoring Functionality .................................................... 6-14
Figure 6-5 Editing the Config File (Disabling the Monitor) .................................................... 6-16
Figure 6-6 Editing the Config File (Enabling the Monitor) ..................................................... 6-18
TABLES
Table 6-1 RAS Features in HF-W100E/IoT .............................................................................. 6-1
Table 6-2 List of RAS Library Functions .................................................................................. 6-2
Table 6-3 Bit Allocation of usiOutput and usiMask for GendoContorlN .................................. 6-3
Table 6-4 Return Value from the GendoControlN Function (Error Cases) ............................... 6-3
Table 6-5 Bit Allocation of pusiInput for GetGendiN ............................................................... 6-5
Table 6-6 Return Value from the GetGendiN Function (Error Cases) ...................................... 6-5
Table 6-7 List of Enumeration Types in the RAS Library ........................................................ 6-6
Table 6-8 Variables Used in the External General Purpose I/O Functions ............................. 6-12
Table 6-9 External General Purpose I/O Functions ................................................................. 6-12
Table 6-10 Event Object .......................................................................................................... 6-20
Table 6-11 List of Events Recorded in the Event Log ............................................................. 6-21
Table 6-12 List of Items Set by the HIoTRAS Setting Command .......................................... 6-22
This Page Intentionally Left Blank
1. INTRODUCTION TO HF-W100E/IoT
1-1
CHAPTER 1 INTRODUCTION TO HF-W100E/IoT
1.1 Overview
The HF-W100E/IoT is a Hitachi industrial computer HF-W100E equipped with a software PLC. It has the features of both an industrial computer and a programmable logic controller (PLC). A software PLC is a development environment/runtime environment that executes PLC functions on a computer with a general-purpose OS. HF-W100E/IoT uses CODESYS®, a software PLC developed by 3S-Smart Software Solutions GmbH, Germany (hereinafter denoted as 3S).
About CODESYS
CODESYS is a software PLC developed by 3S. It consists of a development environment that supports programming languages defined in the international standard IEC 61131-3 and a realtime execution environment (runtime environment) that runs control applications developed by the development environment. In HF-W100E/IoT, the following CODESYS packages are pre-installed. (You can download the development environment from the Web site of 3S, but note that only the following version is verified to work with the HF-W100E/IoT.)
• Development environment: CODESYS Development System (V3.5 SP10 Patch 1)
• Runtime environment: CODESYS Control Softmotion RTE (V3.5 SP10 Patch 1)
Using CODESYS
For information about the instructions on how to use CODESYS not described in this manual, refer to the online help for the development environment. You can start the online help on the help menu in CODESYS. In addition to the online help, CODESYS original manuals (PDF format in English) from 3S are available and stored in the following locations. Refer to them when needed. Note that Adobe® Reader® from Adobe Systems Incorporated is required to read a PDF file.
No.
File name
Storage folder
Description
1
CODESYS Installation and
Start.pdf
C:\Program Files (x86)\3S CODESYS
\CODESYS\Documentation
Creating a project, executing a task,
and debugging in the CODESYS
development environment
2
CODESYSControlRTEV3_ Manual.pdf
C:\Program Files\3S CODESYS \CODESYS Control RTE3\Documentation
Mechanism and the settings of the CODESYS runtime environment
3
CoDeSys_OPC_Server_V3
_User_Guide.pdf
C:\Program Files (x86)\3S CODESYS
\CODESYS OPC Server 3
Instructions for using OPC Config,
which is a configuration tool fo r th e OPC server and for the communication interface between the CODESYS development
environment and the PLC.
4
AeConfigurator_UserGuide
.pdf
Instructions for using
AeConfigurator, which is a tool for adding and setting up alarm events
when you use OPC AE.
5
WebServerSSL_en.pdf
C:\Program Files (x86)\3S CODESYS
\GatewayPLC\Documentation
Procedure for deploying
WebServer with safe connections
when Web Visualization is used.
1. INTRODUCTION TO HF-W100E/IoT
1-2
1.2 Specifications
The instruction manual of the HF-W100E, base hardware of HF-W100E/IoT, (hereinafter denoted as HF-W instruction manual) describes the specifications of the industrial computer, and this section supplements them with HF-W100E/IoT-specific specifications.
1.2.1 Software specifications This manual describes the software specifications only. The hardware specifications are the same as those of the HF-W100E. For details about the hardware specifications, refer to “5.1 Equipment Specifications” in the HF-W instruction manual.
Item
Specifications
Motion model
CNC model
Model
HJ-100E-PAMM
HJ-100E-PGMM
HJ-100E-PBMM
HJ-100E-PHMM
Pre-installed OS
See “(1)Pre-installed OS”
Development environment
CODESYS® Development System (V3.5 SP10 Patch1)
Programming languages
IEC 61131-3 standard programming languages
• LD: Ladder diagram
• FBD: Function block diagram (including CFC)
• SFC: Sequential function chart
• ST: Structured text
Runtime environment
CODESYS® Control SoftMotion RTE (V3.5 SP10 Patch1)
I/O control
Software PLC
Motion control
SoftMotion
(PLCopen® compliant)
SoftMotion (PLCopen®
compliant)
CNC (G-code)
Field network
EtherCAT® master
Data exchange standard
OPC server
HMI features
Visualization features
(1) Pre-installed OS
HJ-100E-PAMM
Microsoft® Windows® 10 IoT Emterprise 2016 LTSB (64bit)
HJ-100E-PBMM
Microsoft® Windows® 10 IoT Emterprise 2016 LTSB (64bit)
HJ-100E-PGMM
Microsoft® Windows® Embedded Standard 7 SP1 (64bit)
HJ-100E-PHMM
Microsoft® Windows® Embedded Standard 7 SP1 (64bit)
1. INTRODUCTION TO HF-W100E/IoT
1-3
1.2.2 LAN interface specifications (1) EtherCAT connection
Built-in LAN port are handled as follows.
Item
Default factory
setting
EtherCAT
capable
Remarks
Built-in LAN
port
LAN A
Ethernet
Yes LAN B
EtherCAT
Yes
(*)
LAN C
EtherCAT
Yes
(*)
(*) CODESYS EtherExpress driver for EtherCAT is installed at the factory.
To use different interfaces than the ones set up at the factory, update the network driver. For information about how to update the driver, see “2.3 Updating the Network Driver”. For information about the location of the LAN port connectors, refer to “1.5 Name and Function of Each Part” in the HF-W instruction manual.
(2) LAN cables
In “5.8 Interface Specifications” in the HF-W instruction manual, UTP cables are recommended for use in connection to LAN ports. In spite of that, we recommend using cables with the following specifications if the cables are used for EtherCAT connection on HF-W100E/IoT.
Cable specification: STP cable (shielded twisted-pair cable) category 5e or better
[Caution]
When an STP cable is used, the grounds of the devices at both ends must be at the same voltage level.
1. INTRODUCTION TO HF-W100E/IoT
1-4
1.2.3 BIOS settings The factory default BIOS settings for HF-W100E/IoT are as follows. Do not change these settings. If you do, it may affect the processing of realtime control. BIOS settings other than those below are the same as the default settings for the HF-W100E. For details about the setup menu, refer to “5.3 BIOS Setup” in the HF-W instruction manual.
Top
menu
Setting item Value Caution
Chipset
South Bridge
USB Configuration
Legacy USB Support
Disabled
Do not change these settings.
[Caution]
If you use Restore Defaults for Windows 7 (in the case of Windows® Embedded Standard 7) or Restore Defaults for Windows 10 (in the case of Windows® 10) in the setup menu, the BIOS settings go back to the initial settings of the HF-W100E. After you use this menu, restore the BIOS settings to the factory default settings of HF-W/IoT (as in the above table).
1. INTRODUCTION TO HF-W100E/IoT
1-5
1.3 Changes to the HF-W Instruction Manual
This section explains the changes you must make to the HF-W instruction manual.
1.3.1 Time required for restoring the factory condition with the recovery DVD In “7.1 Overview of Restoration Procedure” in the HF-W instruction manual, the time required for restoring the factory condition is approximately 30 minutes for HF-W100E/IoT.
1.3.2 Recovery DVD name The name of the recovery DVD described in “7.2 Preparation” and “7.3 Restoring the System Drive Back to the Factory-Shipped Condition” in the HF-W instruction manual must be replaced as follows.
<Name to replace>
Before
HITACHI HJ-100E-**** Product Recovery DVD
(The underlined part is the model number of the device you
purchased.)
After
HITACHI HF-W/IoT HJ-100E-**** Product Recovery DVD
(The underlined part is the model number of the device you
purchased.)
This Page Intentionally Left Blank
2. SETUP
2-1
CHAPTER 2 SETUP
This chapter describes how to set up the HF-W100E/IoT.
• After setting up the OS, activate the license of the CODESYS runtime environment.
However, since devices shipped after September 2018 will be automatically licensed, it is not necessary to perform the activation process. Please check to "2.2.1 Confirmation of Activation Status" to see if license activation is being done.
• The CODESYS development environment and the runtime environment are pre-installed. You do
not have to install or set them up.
2.1 Setup Items
Refer to “CHAPTER 3 SETUP” in the HF-W100E INSTRUCTION
MANUAL (manual number WIN-62-
006
9).
Activate the license of the CODESYS
runtime
environment as described in
“2.2 License Activation”.
OS setup
License activation
2. SETUP
2-2
2.2 License Activation
Product activation is required for the CODESYS runtime environment (CODESYS SoftMotion RTE) installed on this device. You must go through license authentication (product activation) against 3S, the manufacturer.
2.2.1 Confirmation of Activation Status
You can check if license activation is done by the following procedure.
1. Click the CODESYS Control RTE V3 icon in notification area on the taskbar. (The icon
is hidden by default, and you must click “^” to find it. (Note)) Then click Start PLC to start the CODESYS Softmotion RTE.
(Note)You can set it to display an icon in the notification area by the following
procedure.
· Right-click "" in the notification area and click Properties from the
displayed menu.
· Click Customize on the displayed screen.
· Click Select which icons appear on the taskbar.
· Set the icon of [CODESYS "Control RTE V3" RTE SysTray] to ON.
2. After the icon turns yellow, point the CODESYS Control RTE V3 icon again and check the display contents(last string of ”Address:” line in lower row).
Display contents
Meaning and Action
(licensed) License activation has already been done.
License activation procedure is unnecessary.
(DEMO) License activation has not been done yet.
Please perform license activation by the method
described in "2.2.2 License activation method"
NOTE
Make sure you activate the license. If the license is not activated, the runtime environment stops after running two hours.
2. SETUP
2-3
2.2.2 License activation method
(1) Online activation
Activate the license on this device. In this case, you must connect to the Internet.
• Using the CODESYS development environment
• Using a Web browser
(2) Offline activation
Activate the license on the environment (PC with Internet access) outside this device. You can activate the license without connecting this device to the Internet.
For the procedure, refer to "2.2.3 License activation procedure" in the next section.
2. SETUP
2-4
2.2.3 License activation procedure (1) Online activation
(a) Using the CODESYS development environment
1. Start the CODESYS development environment in the following steps. Wait until the startup process is complete. Be aware that it may take dozens of seconds.
• If the OS is Windows® Embedded Standard 7, click Start, and click All Programs > 3S CODESYS > CODESYS > CODESYS V3.5 SP10 Patch1.
• If the OS is Windows® 10, click Start, and click 3S CODESYS > CODESYS > CODESYS V3.5 SP10 Patch1 from the list of applications.
(Alternatively, double-click the CODESYS V3.5 SP10 Patch1 icon on the desktop.)
2. The CODESYS development environment starts. Click New Project. Create a new
project as follows.
• Categories: Projects
• Templates: Standard project
• Name: Any
• Location: Any
• Device: Different depending on the model you purchased. Select as follows.
Model name
Device name
Motion model
HJ-100E RTE SoftMotion 64bit (Hitachi Industry & Control Solutions, Ltd.)
CNC model
HJ-100E RTE CNC 64bit (Hitachi Industry & Control Solutions, Ltd.)
• PLC_PRG in: Any
2. SETUP
2-5
3. Click the CODESYS Control RTE V3 icon in notification area on the taskbar.
(The icon is hidden by default, and you must click “^” to find it.) Then click Start PLC to start the CODESYS Softmotion RTE. Before the activation, the CODESYS Softmotion RTE runs in DEMO mode.
4. Double-click Device (*****) in the Devices window. ((*****) shows the selected device name.) Then click Scan network.
2. SETUP
2-6
5. The Select Device window opens. Select the device you want to select, and click OK.
Note: If no devices are shown under Select the network path to the controller,
repeat clicking Scan network. If you still cannot find any devices, the CODESYS Softmotion RTE may not have started yet. Do the following.
• Check that the settings in Step 2 are all correct.
• Stop and then restart the CODESYS Softmotion RTE. To stop the
CODESYS Softmotion RTE, click Stop PLC in Step 3.
6. Click PLC Settings in the Device tab. Then click Edit License.
2. SETUP
2-7
7. The Edit Licenses window is displayed. Click Install licenses.
8. The Select Operation window is displayed. Select Activate license, and then click Next.
2. SETUP
2-8
9. The Active License window is displayed. Enter the ticket ID shown on the license certificate (included with the product) in the Ticket ID box. Then click Next.
10. The Select Licenses window is displayed. Select the checkbox for CODESYS
Control SoftMotion RTE SL, and then click Next. When the authentication process is finished, click Finish.
2. SETUP
2-9
11. If the activation is successful, the following window appears. Click Finish.
<Confirming the license activation status>
In the Edit Licenses window, you can check that the license for CODESYS Control SoftMotion RTE has been activated.
You can also check the display status of the CODESYS Control RTE V3 icon in notification area on the taskbar to see whether the mode has been changed from DEMO to licensed.
2. SETUP
2-10
(b) Using the Web browser
1. Click the CODESYS Control RTE V3 icon in notification area on the taskbar. (The icon is hidden by default, and you must click “^” to find it.) Then click Start PLC to start the CODESYS Softmotion RTE. Before the activation, the CODESYS Softmotion RTE runs in DEMO mode.
2. Visit the CODESYS license activation site (http://license.codesys.com). Enter the ticket ID shown on the license certificate (included with the product) in the License key box. Then click Next.
3. The activation status of the license is displayed. Click Activate licens es.
2. SETUP
2-11
4. Click CODESYS Software Key (Softcontainer) as the binding for the license.
Note: Do not select CODESYS Runtime Key (Dongle) (not supported by this
device).
2. SETUP
2-12
5. Select the license container, and click Activate selected licenses now.
License being activated
License activated
A window is displayed to indicate that license activation was successful. Click OK.
2. SETUP
2-13
<Confirming the license activation status>
In the window in Step 2, enter the ticket ID in the License key box again, and click Next. Then you can confirm that the license status has changed to “Activated”. (You cannot reactivate using the same ticket ID.)
You can also check the display status of the CODESYS Control RTE V3 icon in notification area on the taskbar to see whether the mode has been changed from DEMO to licensed.
2. SETUP
2-14
(2) Offline activation
1. Execute Steps 1 to 7 in “(1) Online activation (a) Using the CODESYS development environment”.
2. The Select Operation window is displayed. Select Request license, and then click Next.
3. The Request License window is displayed. Create a request file (WibuCmRaC) to be used in license activation. Specify the Software vendor and the file save location, and click Finish.
2. SETUP
2-15
4. Use a PC with Internet access to visit the CODESYS license activation site (http://license.codesys.com). Enter the ticket ID shown on the license certificate (included with the product) in the License key box. Then click Next.
5. The activation status of the license is displayed. Click Activate licens es.
2. SETUP
2-16
6. Click CODESYS Software Key (Softcontainer) as the binding for the license.
Note: Do not select CODESYS Runtime Key (Dongle) (not supported by this
device).
7. To jump to the window for online activation, click the Offline license transfer link near the lower right corner. In the following examples, CODESYS is not installed, and therefore, an error message is shown to indicate that the license activation system (CodeMeter) is not supported. If you are prompted to install a CodeMeter add-on, you do not have to install the add­on because offline activation is still possible.
2. SETUP
2-17
8. In Select license request file, specify the path of the request file created in Step 3. Click Upload request and continue now to upload the request file.
9. Click Download license update file now to obtain the license update (WibuCmRaU) file.
2. SETUP
2-18
10. The following window is displayed for uploading the result of the license activation,
but first execute the following Steps 11 to 13.
11. In the Select Operation window of HF-W100E/IoT, select Install license, and then
click Next.
2. SETUP
2-19
12. The Install License window is displayed. Specify the path of the license update file
you obtained in Step 9, and then click Finish.
13. If the activation is successful, the following message is displayed. Click OK.
14. In order to report the successful license activation to the license activation site,
follow Steps 1 to 3 again and create a new request file (WibuCmRaC).
15. Go back to the PC with Internet access. In Select license receipt file in the window
in Step 10, specify the path of the request file created in Step 14. Click Upload receipt now to upload the result of the license activation.
16. A message is displayed to indicate that the result of the license activation has been
reported. Click OK.
2. SETUP
2-20
<Confirming the license activation status>
In the window in Step 4, enter the ticket ID in the License key box again, and click Next. Then you can confirm that the license status has changed to “Activated”. (You cannot reactivate using the same ticket ID.)
You can also check the display status of the CODESYS Control RTE V3 icon in notification area on the taskbar to see whether the mode has been changed from DEMO to licensed.
2. SETUP
2-21
2.3 Updating the Network Driver
In the factory settings of HF-W100E/IoT, the Intel® Network driver is used for the built-in LAN (LAN A), and the CODESYS EtherExpress driver is used for the built-in LAN (LAN B and LAN C) to support EtherCAT. To use the built-in LAN (LAN A) as EtherCAT, or to use the built-in LAN (LAN B and LAN C) as Ethernet (TCP/IP), update network drivers. To update a network driver, follow the procedure below:
NOTE
This product may record the following events in the event log during update the
CODESYS EtherExpress driver to the Intel® Network driver. These events do not affect the operation of the system.
Event ID
Source
Type
Description
10317
NDIS
Error
Miniport (*1), {(*2)}, had event Fatal error: The miniport has detected an internal error
(*1) shows the network adapter name.
(*2) shows the GUID.
1. Log on to the computer as an administrator account.
2. Open Control Panel.
• If the OS is Windows® Embedded Standard 7, click Start, and click Control Panel.
• If the OS is Windows® 10, right-click Start, and click Control Panel from the menu.
3. Click Start > Control Panel > System and Security. Click the System icon, and then Device Manager.
4. The Device Manager window appears. Click the View menu, and select Devices by connection.
5. If the OS is Windows® Embedded Standard 7, expand ACPI x64-based PC > Microsoft ACPI-Compliant System > PCI bus.
If the OS is Windows® 10, expand ACPI x64-based PC > Microsoft ACPI-Compliant System > PCI Root Complex.
2. SETUP
2-22
6. As in the following example, right-click on the network adapter where you want to update the driver. Then a menu appears. Click Update Driver Software. The following screenshot is just an example. Be aware that network adapter names are displayed differently for the HF-W100E/IoT.
<To update the driver for built-in LAN (LAN A)>
Click Intel(R) Atom(TM)/Celeron(R)/Pentium(R) Processor PCI Express – Root Port1 – 0F48. Then, right-click on the network adapter displayed below (in the example above, Intel(R) I210 Gigabit Network Connection (*)).
<To update the driver for built-in LAN (LAN B)>
Click Intel(R) Atom(TM)/Celeron(R)/Pentium(R) Processor PCI Express – Root Port2 – 0F4A. Then, right-click on the network adapter displayed below (in the example above, CoDeSys EtherExpress GBit PCI Ethernet Adapter #3 (*)).
<To update the driver for built-in LAN (LAN C)>
Click Intel(R) Atom(TM)/Celeron(R)/Pentium(R) Processor PCI Express – Root Port3 – 0F4C. Then, right-click on the network adapter displayed below (in the example above, CoDeSys EtherExpress GBit PCI Ethernet Adapter #2 (*)).
(*) Network adapter names are displayed differently for the HF-W100E/IoT.
2. SETUP
2-23
7. The Update Driver Software window appears. Click Browse my computer for driver software.
8. Click Let me pick from a list of device drivers on my computer.
9. Select a new driver you want to update, and then click Next.
<To use a port as Ethernet (TCP/IP)>
Select Intel(R) 210 Gigabit Network Connection, and then click Next.
Note: If the OS is Windows® 10, two [Intel (R) 210 Gigabit Network Connection] are
displayed, select the upper side.
<To use a port as EtherCAT>
Select CoDeSys EtherExpress GBit PCI Ethernet Adapter, and then click Next.
10. A message is displayed to indicate that the driver has been successfully updated. Confirm the message, and then click Close.
This completes the installation of the driver. Restart the HF-W100E/IoT.
This Page Intentionally Left Blank
3. CREATING A PLC PROGRAM
3-1
CHAPTER 3 CREATING A PLC PROGRAM
3.1 PLC Program Creation Procedure
3.1.1 Creating a project The following shows how to create a new project.
1. Start the CODESYS development environment in the following steps. Wait until the
startup process is complete. Be aware that it may take dozens of seconds.
• If the OS is Windows® Embedded Standard 7, click Start, and click All Programs > 3S CODESYS > CODESYS > CODESYS V3.5 SP10 Patch1.
• If the OS is Windows® 10, click Start, and click 3S CODESYS > CODESYS > CODESYS V3.5 SP10 Patch1 from the list of applications.
(Alternatively, double-click the CODESYS V3.5 SP10 Patch1 icon on the desktop.)
2. Click the File menu, and on the menu, click New Project.
3. The New Project window is displayed. Select Standard project under Templates. Specify a project name for Name and a save location for Location, and then click OK.
3. CREATING A PLC PROGRAM
3-2
4. Select a device to run and a programming language (language for PLC_PRG) to use, and then click OK.
• The device differs depending on the model you purchased. Select one of the following.
A device not described in the following table can be selected but it will not be supported in HF-W100E/IoT.
Model
Device
Motion model
HJ-100E RTE SoftMotion 64bit (Hitachi Industry & Control Solutions, Ltd.)
CNC model
HJ-100E RTE CNC 64bit (Hitachi Industry & Control Solutions, Ltd.)
• For PLC_PRG in, specify a language to use.
In the figure below, Structured Text (ST) is selected as an example.
3. CREATING A PLC PROGRAM
3-3
3.1.2 Creating a PLC program (1) Task configuration
1. Double-click MainTask in the Devices window to display a window for setting up the
task configuration. In the MainTask tab, you can set task priority, type, and interval.
Adding a task
1. If you want to add a task, in the right-click menu on Task Configuration in the Devices window, click Add Object > Task.
3. CREATING A PLC PROGRAM
3-4
2. The Add Task window is displayed. Enter the task name, and then click Add.
(2) Creating a program
1. Double-click PLC_PRG (PRG) in the Devices window to display a window for creating a program. You can create a program in the PLC_PRG tab. In the declaration part in the upper pane, define variables. In the body in the lower pane, describe an algorithm.
(*) POU is a program unit. Each POU is made of a declaration part and a body.
Only one programming language can be used in one POU. If you want to use multiple programming languages, you must add a POU for each language.
Declaration part
Body
POU (*)
Task
3. CREATING A PLC PROGRAM
3-5
Adding a POU
To add a POU, follow the procedure below.
1. In the right-click menu on Application in the Devices window, click Add Object >
POU.
2. The Add POU window is displayed. Enter the POU name, configure the type and
the implementation language, and then click Add.
3. CREATING A PLC PROGRAM
3-6
Creating global variables
To add global variables, follow the procedure below.
1. In the right-click menu on Application in the Devices window, click Add Object >
Global Variable List.
2. The Add Global Variable List window is displayed. Enter a name, and then click
Add.
3. You can add global variables in the new Global Variable List.
3. CREATING A PLC PROGRAM
3-7
3.1.3 Building a PLC program
1. After you finish creating a program, click the Build menu, and on the menu, click Build.
(Alternatively, click the build icon on the toolbar.)
3.1.4 Starting PLC Start PLC to run a PLC program. For information about how to start PLC automatically when the device starts, see “(2) Starting PLC automatically”.
(1) Starting PLC manually
1. Click the CODESYS Control RTE V3 icon in notification area on the taskbar. (The
icon is hidden by default, and you must click “^” to find it.) Then click Start PLC.
Notes 1: Wait until the startup process is complete. Be aware that it may take dozens of
seconds.
2: To stop PLC, click Stop PLC.
NOTE
When you start PLC by clicking Start PLC or stop PLC by clicking Stop PLC, the
process may take dozens of seconds to complete. Because of that, after you start (or stop) PLC, wait at least one minute before you stop
(or start) PLC.
3. CREATING A PLC PROGRAM
3-8
(2) Starting PLC automatically
If you enable the following settings, PLC will automatically start when the device starts.
1. Click the CODESYS Control RTE V3 icon in notification area on the taskbar. (The
icon is hidden by default, and you must click “^” to find it.) Then click PLC Configuration.
2. If a window is displayed to indicate that admin rights are required, click OK to obtain the admin rights. If the User Account Control window is displayed, click Yes. When the admin rights are granted, click the icon again, and then click PLC Configuration.
3. The System Configuration dialog box is displayed. Click the Startup tab, select the
Start the PLC with the basic system service checkbox and the Start the RTE basic systemservice when booting checkbox, and then click OK.
Setting item
Meaning
Start the RTE basic systemservice when bo oting
The RTE system service is started when Windows starts.
Start the PLC with the basic system service
PLC is started when the RTE system service starts.
Note: To cancel the PLC auto start, clear Start the PLC with the basic system
service checkbox, and then click OK.
Then, PLC will start automatically when the device starts next time.
3. CREATING A PLC PROGRAM
3-9
NOTE
In Windows® Embedded Standard 7, if the version of the CODESYS scheduler (file
name: CmpDrvSchedulerAMP.sys) is "3.5.10.10" and you enable these settings in an attempt to start PLC automatically when Windows starts, a blue screen or a reset might occur in rare cases. This symptom occurs less frequently if the start timing of PLC is delayed. This is why “RTE system service auto start task” (delay: 3 minutes) is
registered to Windows Task Scheduler to delay the start timing of PLC.
The procedure for checking the CODESYS scheduler version is as follows.
1. Start Windows Explorer and open C:\Windows\System32\drivers.
2. Right-click the CmpDrvSchedulerAMP.sys file, and then click Properties.
3. Click Details tab.
If you want to start the PLC automatically when the CODESYS scheduler version is "3.5.10.10", perform the following settings (a) and (b).
(a) Enabling the CODESYS RTE system service auto start task
1. Open Control Panel. Click Start, click Control Panel.
2. Click System and Security, click Administrative Tools.
3. Double-click Task Scheduler.
4. In the console tree, click Microsoft > Windows > CODESYS Control RTE.
3. CREATING A PLC PROGRAM
3-10
5. In the console window, right-click the Auto Start task, and on the menu, click Enable.
Note: To cancel the PLC auto start, right-click the Auto Start task, and on the
menu, click Disable.
(b) Changing the PLC configuration
1. Click the CODESYS Control RTE V3 icon in notification area on the taskbar. (The icon is hidden by default, and you must click “^” to find it.) Then click PLC Configuration.
3. CREATING A PLC PROGRAM
3-11
2. If a window is displayed to indicate that admin rights are required, click OK to obtain the admin rights. If the User Account Control window is displayed, click
Yes. When the admin rights are granted, click the icon again, and then click PLC Configuration.
3. The System Configuration dialog box is displayed. Click the Startup tab, select only the Start the PLC with the basic system service checkbox, and then click
OK. Make sure that you clear the Start the RTE basic systemservice when booting checkbox.
Note: To cancel the PLC auto start, clear Start the PLC with the basic system
service checkbox, and then click OK.
Then, PLC will start automatically when the device starts next time.
3. CREATING A PLC PROGRAM
3-12
3.1.5 Running a PLC program
1. Double-click Device (*****) in the Devices window to display a window for setting up
device configuration. ((*****) shows the selected device name.)
2. Click Scan network to display the Select Device window. In the Select Device window, select the device you want to connect to, and click OK.
3. After the device is connected, click the Online menu, and on the menu, click Login. (Alternatively, click the login icon on the toolbar.)
3. CREATING A PLC PROGRAM
3-13
Selecting another device as a device to run
To connect another device and select the device as a device to run, follow the procedure below. Note that, in order to connect to another device, PLC must be running on the device.
1. Double-click Device (*****) in the Devices window to display a window for setting up
device configuration. ((*****) shows the selected device name.)
2. In the Communication Settings window, click Gateway. On the menu, click Add
new gateway to open a window for adding a new gateway.
3. In the Select Device window, select the device you want to connect to, and click OK.
Enter IP-Address and Port for the new device, and click OK. Note that, if you specify “localhost” for IP-Address, you can connect to a device connected as “localhost”.
4. In the Communication Settings window, click Scan network to display the Select
Device window. Select the new device, and click OK.
3. CREATING A PLC PROGRAM
3-14
3.1.6 Debugging a PLC program (1) Setting a breakpoint
You can set a breakpoint to stop a program at any location.
1. To set a breakpoint, right-click on a line where you want to set a breakpoint, and on
the menu, click New Breakpoint.
2. The Breakpoint Properties window is displayed. Under Hit Count, select a break condition. Select Enable breakpoint immediately, and click OK.
3. Click the Debug menu, and on the menu, click Start. (Alternatively, click the start icon on the toolbar.)
4. The program stops at the line with the breakpoint.
3. CREATING A PLC PROGRAM
3-15
(2) Writing a value
You can write a value to a variable while the program is running.
1. Enter a value (example: FALSE) in Prepared value while the program is running. In the body, the value is shown as “TRUE <FALSE>”.
2. Click the Debug menu, and on the menu, click Write values. (Alternatively, press Ctrl + F7.)
3. At the next cycle, the “Value” is changed to the value shown as “Prepared value” (example: FALSE).
3. CREATING A PLC PROGRAM
3-16
3.2 Programming Languages
In CODESYS, you can program using the programming languages defined in IEC 61131-3 (Structured Text (ST), Ladder Diagram (LD), Function block diagram (FBD), and Sequential Function Chart (SFC)) as well as the CODESYS proprietary language Continuous Function Chart (CFC).
Programming languages
Description
Structured Text
Language suitable for numerical calculation and logical expression
Ladder Diagram
Language that describes logic circuits
Function Block Diagram
Graphical language that combines multiple functions into one
Sequential Function Chart
Language that describes the chronological order of the control
Continuous Function Chart
Graphical programming language based on FBD
For details about each programming language, refer to the following topic in the online help.
• CODESYS Development System > Reference, Programming > Programming Languages and their Editors
3. CREATING A PLC PROGRAM
3-17
3.3 Visualization Objects
CODESYS offers visualization features for creating a graphical user interface. This section shows how to add and run a typical visualization object, Lamp. For details about visualization features, refer to the following topic in the online help.
• CODESYS Visualization
(1) Creating a visualization object
1. To add a visualization object, right-click Application in the Devices window, and on the menu, click Add Object > Visualization.
2. The Add Visualization window is displayed. Select the Active checkbox for VisuSymbols (System), and then click Add. After the visualization is added, the ToolBox window appears.
3. In the ToolBox window, click Lamps/Switches/Bitmaps, and drag and drop the Lamp1 icon onto the visualization editor.
3. CREATING A PLC PROGRAM
3-18
4. Select the created Lamp. The Properties window is displayed. In the Properties window, you can change the settings of the Lamp. For example, by clicking Position > Variable, you can specify a variable output to the Lamp.
<Running an object>
1. Build, login, and then run the object. Whenever the variable is switched between FALSE and TRUE, the created Lamp turns on or off accordingly.
3. CREATING A PLC PROGRAM
3-19
3.4 Creating and Setting Up a G-Code
(1) Adding an object
1. In the right-click menu on Application in the Devices window, click Add Object > CNC program. (In the following, the project created in “4.2 Configuration for Using Servo Amplifiers and Servo Motors” is used.)
2. The Add CNC program window is displayed. Select Din66025 for Implementation and SMC_CNC_REF for Compile mode. Then click Add.
3. CREATING A PLC PROGRAM
3-20
(2) Creating a G-code
1. Double-click CNC in the Devices window to display a window for creating a G-code.
2. If you click a meshed icon ((A) in the following figure) on the menu near the upper left corner of the window, an auxiliary line is shown. Moreover, if you click an icon with a line and dots ((B) in the following figure), the acceleration, deceleration, and constant velocity sections of the track created by the G-code are shown color-coded. Note that if you make changes in either the G-code or the Graphic Editor, the other is automatically updated.
(B) (A)
Deceleration
Constant velocity
Acceleration
3. CREATING A PLC PROGRAM
3-21
(3) CNC settings
1. Double-click CNC settings in the Devices window to display a window for CNC settings.
2. Click the Path preprocessors tab to display a list of Available function blocks. Select the function block you want to use, and then click >. The function block is registered under Active function block instances.
3. CREATING A PLC PROGRAM
3-22
3. Select the registered function block, and click Parameters. The Parameter editor window for the function block is displayed. Set up the parameters as required.
For details about G-codes, CNC, and SoftMotion, refer to the following topic in the online help.
• Add-ons > SoftMotion
3. CREATING A PLC PROGRAM
3-23
3.5 Reset Action When an Error Occurs
The CODESYS runtime environment stops executing a program when exceptions such as a watchdog timer timeout error are detected. You can reset these exceptions with a reset action. Reset actions include three types of resets: warm up reset, cold reset, and reset (PLC initialization). For details about each reset action, refer to the following topic in the online help.
• CODESYS Development System > Reference, User Interface > Commands > ‘Online’
For information about the behavior of remanent variables at each reset action, refer to the following topic in the online help.
• CODESYS Development System > Reference, Programming > Variable Types and special Variables > Remanent Variables - RETAIN, PERSISTENT “Overview table for the behavior with RETAIN and PERSISTENT declared variables”
This Page Intentionally Left Blank
4. CONFIGURATION OF EtherCAT CONNECTION
4-1
CHAPTER 4 CONFIGURATION OF EtherCAT CONNECTION
This chapter explains how to configure EtherCAT. Use the procedure that fits your needs.
• When I/O modules are used
• When servo amplifiers and servo motors are used
4. CONFIGURATION OF EtherCAT CONNECTION
4-2
4.1 Configuration for Using I/O Modules
4.1.1 Adding EtherCAT devices (I/O modules) The following procedure shows how to add EtherCAT devices. This procedure uses I/O modules (EH-IOCA) from Hitachi Industrial Equipment Systems Co.,Ltd. as an example.
(1) Adding EtherCAT masters
1. Right-click on Device (*****) in the Devices window. ((*****) shows the selected device name.) On the menu, click Add Device.
2. The Add Device window is displayed. Select EtherCAT > Master > EtherCAT Master. Click Add Device, and then click Close.
4. CONFIGURATION OF EtherCAT CONNECTION
4-3
(2) Adding EtherCAT slaves
1. Click the Tools menu, and on the menu, click Device Repository.
2. The Device Repository window is displayed. Install the configuration file for the device you want to connect. In this example, click Install.
3. The Install Device Description window is displayed. Select the ESI file (EtherCAT Slave Information File) you obtained beforehand, and click Open.
4. CONFIGURATION OF EtherCAT CONNECTION
4-4
4. When installation is complete, EH-IOCA is added to the list of installed devices. Confirm that the device has been added to the list, and click Close.
5. Right-click on EtherCAT_Master (EtherCAT Master) in the Devices window. On the menu, click Add Device.
4. CONFIGURATION OF EtherCAT CONNECTION
4-5
6. The Add Device window is displayed. Select EH-IOCA, and then click Add Device. EH_IOCA (EH-IOCA) is added under EtherCAT_Master (EtherCAT Master) in
the Devices window.
• Repeat this step for all the EtherCAT slaves you want to add.
• Click Close after you confirm that the EtherCAT slaves were successfully added.
4. CONFIGURATION OF EtherCAT CONNECTION
4-6
(3) Adding devices (I/O modules) to connect
1. Add devices to connect. In this example, an I/O module is added to an EtherCAT slave. Right-click on <Empty1> (<Empty>) under EH_IOCA (EH-IOCA). On the menu, click Plug Device. Repeat this action for each EtherCAT slave according to your needs.
2. In the Plug Device window, select the I/O module you want to plug in. Y16 is selected as an example. Click Plug Device.
4. CONFIGURATION OF EtherCAT CONNECTION
4-7
3. Y16 is added under EH_IOCA (EH-IOCA).
Add a plugged device to <Empty2> (<Empty>) and subsequent slaves according to your needs.
4. CONFIGURATION OF EtherCAT CONNECTION
4-8
4.1.2 EtherCAT NIC setting The following procedure shows how to configure the EtherCAT NIC setting. The PLC must be started and connected before starting the following procedure.
• If the PLC has not been started
See “3.1.4 Starting PLC”, and start the PLC.
• If the PLC is not connected
See Steps 1 and 2 in “3.1.5 Running a PLC program”, and connect the PLC.
1. Double-click EtherCAT_Master (EtherCAT Master) in the Devices window to display
a window for the EtherCAT_Master configuration.
2. In Source Address (MAC) under EtherCAT NIC Setting in the General tab, enter the
MAC address of the LAN port used for EtherCAT. Alternatively, you can click Browse and select the MAC address.
4. CONFIGURATION OF EtherCAT CONNECTION
4-9
4.1.3 Setting cycle time for the EtherCAT master and interval for the task The following procedure shows how to set up the cycle time for the EtherCAT master and the interval for the task.
(1) Cycle time setting for the EtherCAT master
1. Double-click EtherCAT_Master (EtherCAT Master) in the Devices window to
display a window for EtherCAT_Master configuration.
2. For Cycle Time under Distributed Clock in the General tab, specify 4000 (µs)
(default setting).
Note: The interval of the task (MainTask) might be automatically changed when the
value of Cycle Time is changed. For information about how to configure the cycle time of the task, see “(2) Interval setting for the task”.
4. CONFIGURATION OF EtherCAT CONNECTION
4-10
(2) Interval setting for the task
1. Double-click MainTask in the Devices window to display a window for task
configuration. In the MainTask tab, you can set task priority, type, and interval.
2. In the task configuration window, select Cyclic for Type, and then specify 4000 (µs) (default setting) for Interval. If EtherCAT_Master.EtherCAT_Task is inserted under the task, you must specify the same value as Cycle Time in the aforementioned EtherCAT_Master configuration window.
Note: The interval of the task might be automatically changed when the value of Cycle
Time is changed in “(1) Cycle time setting for the EtherCAT master”. If you change the cycle time setting of the EtherCAT master, check the interval setting of the task, and reconfigure the setting if necessary.
If you want an I/O module to be controlled using a different cycle time than the EtherCAT master, create a control task for the I/O module as an independent task from the task where EtherCAT_Master.EtherCAT_Task is inserted. For information about how to create a task, see “ Adding a task” in “(1) Task configuration” in “3.1.2 Creating a PLC program”.
4. CONFIGURATION OF EtherCAT CONNECTION
4-11
4.1.4 EtherCAT slave setting
(1) I/O mapping setting
The following procedure shows how to allocate variables to the module I/Os you configured.
1. Double-click EH_IOCA (EH-IOCA) under EtherCAT_Master (EtherCAT Master) in the Devices window. Then, click EtherCAT I/O Mapping. As an example, a UINT variable is allocated to Output. (Alternatively, you can click ... and specify a variable you have already created.)
You can also allocate a BOOL variable to each Bit of the module you configured. If you do so, however, you cannot use the UNIT variable allocated above.
4. CONFIGURATION OF EtherCAT CONNECTION
4-12
2. As VAR (variable), declare the Output variable and the address you configured in EtherCAT I/O Mapping.
3. After you declare a variable for a device, confirm that the variable you declared for the device has been successfully allocated. If a strikethrough value is shown under Address, the variable has not been allocated. In such cases, double-click the icon under Mapping to allocate the variable.
4. CONFIGURATION OF EtherCAT CONNECTION
4-13
4.1.5 Checking the EtherCAT connection The following procedure shows how to check the status of the EtherCAT connection.
1. Click the Online menu, and on the menu, click Login to log in to the PLC.
2. After you log in, click at the top of the toolbar to run the PLC.
3. If EtherCAT connects successfully, the icons beside the devices become green.
In the Devices window, icons can be shown beside devices and modules. These icons are shown when the configuration is not consistent with the connected modules. Moreover, icons are sometimes shown even after you confirm that the connection of the devices and modules is OK. If this happens, log in to the PLC, click Online > Cold reset, and run the PLC again. Then the icons should disappear. If icons are still displayed, check the wire connections and power cycle the main power to the EtherCAT slaves.
4. CONFIGURATION OF EtherCAT CONNECTION
4-14
4.2 Configuration for Using Servo Amplifiers and Servo Motors
4.2.1 Adding EtherCAT devices (servo amplifiers and servo motors) The following procedure shows how to add EtherCAT devices. This procedure uses servo amplifiers (ADVA-R5MSEC) and servo motors (ADMA­R5MF111) from Hitachi Industrial Equipment Systems Co.,Ltd. as an example.
(1) Adding EtherCAT masters
1. Right-click on Device (*****) in the Devices window. ((*****) shows the selected device name.) On the menu, click Add Device.
2. The Add Device window is displayed. Select EtherCAT > Master > EtherCAT Master. Click Add Device, and then click Close.
4. CONFIGURATION OF EtherCAT CONNECTION
4-15
(2) Adding EtherCAT slaves
1. Click the Tools menu, and on the menu, click Device Repository.
2. The Device Repository window is displayed. Install the configuration file for the device you want to connect. In this example, click Install.
3. The Install Device Description window is displayed. Select the ESI file (EtherCAT Slave Information File) you obtained beforehand, and click Open.
4. CONFIGURATION OF EtherCAT CONNECTION
4-16
4. When installation is complete, HITACHI AC SERVO DRIVES ADV Series is added to the list of installed devices. Confirm that the device has been added to the list, and click Close.
4. CONFIGURATION OF EtherCAT CONNECTION
4-17
5. Right-click on EtherCAT_Master (EtherCAT Master) in the Devices window. On the menu, click Add Device.
6. The Add Device window is displayed. Select HITACHI AC SERVO DRIVES ADV
Series, and then click Add Device. Then, ADVA_EC (HITACHI AC SERVO DRIVES ADV Series) is added under EtherCAT_Master (EtherCAT Master) in
the Devices window.
• Repeat this step for all the EtherCAT slaves you want to add.
In the following figure, Add Device was clicked twice to add two devices.
• Click Close after you confirm that the EtherCAT slaves were successfully added.
4. CONFIGURATION OF EtherCAT CONNECTION
4-18
(3) Adding devices (Axis) to connect
1. Add devices to connect. In this example, an Axis is added to an EtherCAT slave. Right-click on ADVA_EC (HITACHI AC SERVO DRIVES ADV Series). On the menu, click Add SoftMotion CiA402 Axis. Repeat this action for each EtherCAT slave according to your needs.
2. If the following message dialog box appears, click OK.
4. CONFIGURATION OF EtherCAT CONNECTION
4-19
3. The SM_Drive_GenericDSP402 you selected is added under ADVA_EC (HITACHI AC SERVO DRIVES ADV Series). In the following figure, two devices
were added.
4. CONFIGURATION OF EtherCAT CONNECTION
4-20
4.2.2 EtherCAT NIC setting The following procedure shows how to configure the EtherCAT NIC setting. The PLC must be started and connected before starting the following procedure.
• If the PLC has not been started
See “3.1.4 Starting PLC”, and start the PLC.
• If the PLC is not connected
See Steps 1 and 2 in “3.1.5 Running a PLC program”, and connect the PLC.
1. Double-click EtherCAT_Master (EtherCAT Master) in the Devices window to display
a window for the EtherCAT_Master configuration.
2. In Source Address (MAC) under EtherCAT NIC Setting in the General tab, enter the
MAC address of the LAN port used for EtherCAT. Alternatively, you can click Browse and select the MAC address.
4. CONFIGURATION OF EtherCAT CONNECTION
4-21
4.2.3 Setting cycle time for the EtherCAT master and interval for the task The following procedure shows how to set up the cycle time for the EtherCAT master and the interval for the task.
(1) Cycle time setting for the EtherCAT master
1. Double-click EtherCAT_Master (EtherCAT Master) in the Devices window to
display a window for EtherCAT_Master configuration.
2. For Cycle Time under Distributed Clock in the General tab, specify 4000 (µs)
(default setting).
Note: The interval of the task (MainTask) might be automatically changed when the
value of Cycle Time is changed. For information about how to configure the interval of the task, see “(2) Interval setting for the task”.
4. CONFIGURATION OF EtherCAT CONNECTION
4-22
(2) Interval setting for the task
1. Double-click MainTask in the Devices window to display a window for task
configuration. In the MainTask tab, you can set task priority, type, and interval.
2. In the task configuration window, select Cyclic for Type, and then specify 4000 (µs) (default setting) for Interval. If EtherCAT_Master.EtherCAT_Task is inserted under the task, you must specify the same value as Cycle Time in the aforementioned EtherCAT_Master configuration window.
Note: The interval of the task might be automatically changed when the value of Cycle
Time is changed in “(1) Cycle time setting for the EtherCAT master”. If you change the cycle time setting of the EtherCAT master, check the interval setting of the task, and reconfigure the setting if necessary.
4. CONFIGURATION OF EtherCAT CONNECTION
4-23
4.2.4 EtherCAT slave setting
(1) Process data setting
In this example, a process data object (PDO) is selected.
• Repeat this action for each EtherCAT slave according to your needs.
• Select an appropriate PDO for your needs. PDOs are defined on a per EtherCAT slave
basis. For details about the PDOs, refer to the user’s manual of the EtherCAT slave you use.
1. Double-click ADVA_EC (HITACHI AC SERVO DRIVES ADV Series) in the Devices window to display a window for EtherCAT slave configuration.
2. Click Process Data, clear the checkboxes selected under Select the Outputs and Select the Inputs, and select the checkboxes for the PDO you want to use.
4. CONFIGURATION OF EtherCAT CONNECTION
4-24
(2) Setting startup parameters
As startup parameters, you can specify parameter values that cannot be mapped to the PDO. You can use this feature to set up parameters that have to be set only once. For example, you can adjust the response frequency of the PID control and gain parameters.
• Repeat this action for each EtherCAT slave according to your needs.
• Parameters are defined on a per EtherCAT slave basis. For details about the
parameters, refer to the user’s manual of the EtherCAT slave you want to use.
1. Double-click ADVA_EC (HITACHI AC SERVO DRIVES ADV Series) in the Devices window to display a window for the EtherCAT slave configuration.
2. Click Startup Parameters. Click Add to show a list of parameters.
4. CONFIGURATION OF EtherCAT CONNECTION
4-25
4.2.5 SoftMotion Axis setting In this example, an Axis setting is configured.
• Repeat this action for each Axis according to your needs.
1. Double-click SM_Drive_GenericDSP402 (SM_Drive_GenericDSP402) in the Devices
window to display a window for Axis configuration.
2. Click General, and configure Axis type and Limits and Velocity ramp type.
In this example, default values are used.
If CNC is used
If CNC is used in your program, the function block that starts with “SMC_ControlAxisBy” must be used for the axis control. To use this function, you must define the upper limits of the velocity, acceleration, and deceleration under Limits for CNC (SMC_ControlAxisBy*) in the above screen.
3. Click Scaling/Mapping to configure Scaling.
In the following setting example, 360 counts in the CODESYS program correspond to one rotation of the motor. (This setting is for using a 17-bit encoder (16#0~16#1FFFF).)
4. CONFIGURATION OF EtherCAT CONNECTION
4-26
4.2.6 Checking the EtherCAT connection For information about how to check the EtherCAT connection, see “4.1.5 Checking the EtherCAT connection”. If EtherCAT is connected successfully, the icons beside the devices are shown in green in the same way as for I/O modules.
4.3 Troubleshooting for EtherCAT Slave Connection Errors
When an error occurs, for example, an EtherCAT slave does not function, follow the procedure below to investigate and identify the cause.
1. Read the user’s manual of the slave device, and check whether the symptom is listed in the manual. If yes, troubleshoot according to the description in the manual.
2. Start the CODESYS development environment, and check the PLC log. For information about the PLC log, refer to the following topic in the online help.
• CODESYS Development System > Reference, User Interface > Object > Object ‘Device’
and Generic Device Editor > Tab ‘Log’
If you have any questions about the PLC log, contact the sales representatives.
3. Check the Windows event log to see if any errors from CODESYS are recorded.
If you have any questions after you go through all the steps above, contact the sales representatives.
5. CONFIGURATION FOR USING OPC
5-1
CHAPTER 5 CONFIGURATION FOR USING OPC
5.1 Overview
CODESYS supports the OPC server and allows you to use OPC Classic (OPC DA/AE) and OPC UA. For information about an overview of the OPC server and how to use OPC server tools, refer to the CODESYS original manuals in the following locations.
Folder location
C:\Program Files (x86)\3S CODESYS \CODESYS OPC Server 3
List of manuals
File name
Description
CoDeSys_OPC_Server_V3_User_Guide.pdf
Instructions for using OPC Config, which is a
configuration tool for the OPC server and for the communication interface between the CODESYS
development environment and the PLC.
AeConfigurator_UserGuide.pdf
Instructions for using AeConfigurator, which is a
tool for adding and setting up alarm events when
you use OPC AE.
This chapter describes the setup procedure necessary for using OPC.
(1) Using OPC Classic (OPC DA/AE)
In addition to adding OPC objects, you must configure DCOM. See “5.2 Adding OPC Objects” and “5.3 DCOM Settings”. Moreover, configure the following items according to your needs.
OPC server setting
CODESYS offers OPC Config, a tool for setting up the OPC server and the communication interface between the CODESYS development environment and the PLC. (Note that you can use OPC with the default settings.) For details about OPC Config, refer to CoDeSys_OPC_Server_V3_User_Guide.pdf.
Alarm event setting
To use OPC AE, you must use AE Configurator to configure alarm events notified from CODESYS to OPC AE. For details about AE Configurator, refer to AeConfigurator_UserGuide.pdf.
(2) Using OPC UA
You can use OPC UA simply by adding OPC objects. For information about how to add OPC objects, see “5.2 Adding OPC Objects”.
5. CONFIGURATION FOR USING OPC
5-2
5.2 Adding OPC Objects
You must add a Symbol configuration object to disclose variables to the OPC client.
1. In the right-click menu on Application in the Devices window, click Add Object > Symbol configuration.
2. The Add Symbol Configuration window is displayed. Click Add.
• If you want to use OPC UA, select Support OPC UA Features.
5. CONFIGURATION FOR USING OPC
5-3
3. Select the variables you want to disclose to the OPC client.
• You can select variables after you build the PLC program.
• If you want to use OPC UA, also select Constants.
5. CONFIGURATION FOR USING OPC
5-4
5.3 DCOM Settings
DCOM is a technology used for communication between PC software components distributed in the network. If you want to use a remote connection to link an OPC client to the local device where the CODESYS OPC server is running, you must configure DCOM settings. To enable DCOM connection, a user of the OPC client PC must be authenticated on the local device. If workgroups are used in the system, you can authenticate a client user by creating the same user account with the same password on both the local device and the OPC client PC. When you start using the CODESYS OPC server, follow the procedure below to set up the DCOM configuration. Notes 1: Follow the setup procedure only when you use OPC Classic. If you use OPC UA
instead, it is not necessary to do so.
2: Follow the setup procedure on both the local device and the OPC client PC.
5.3.1 DCOM security settings
1. Sign in to the computer using an administrator account (Administrator ).
2. Start the Component Services in the following steps.
• If the OS is Windows® Embedded Standard 7, click Start, type the following in the Search programs and files box at the lower left corner on the Start menu, and then press Enter.
mmc comexp.msc /32
• If the OS is Windows® 10, click search icon at the right on the Start button, type the following in the Search Windows box, and then press Enter.
mmc comexp.msc /32
3. The Component Services window appears. Select Console Root > Component Services > Computers > My Computer to expand trees, and then right-click on My Computer. On the menu, click Properties.
5. CONFIGURATION FOR USING OPC
5-5
4. The My Computer Properties window is displayed. Select the Default Properties tab to configure as follows.
• Select Enable Distributed COM on this computer.
• Specify Connect for Default Authentication Level.
Note: On the OPC client PC, specify None for Default Authentication Level.
• Specify Identify for Default Impersonation Level.
This completes the DCOM configuration on the OPC client PC. Click OK and proceed to “5.3.2 Firewall settings”.
5. CONFIGURATION FOR USING OPC
5-6
5. In the My Computer Properties window, select the COM Security tab. Under Access Permissions, click Edit Limits.
• For Permissions for ANONYMOUS LOGON, select all Allow checkboxes, and then
click OK.
6. The Launch and Activation Permission window is displayed. Click Edit Limits.
• For Permission for Everyone, select all Allow checkboxes, and then click OK.
7. In the My Computer Properties window, click Apply, and then click OK. If the DCOM configuration on the whole computer dialog box is displayed, click Yes.
5. CONFIGURATION FOR USING OPC
5-7
8. Select My Computer > DCOM Config to expand trees, and right-click on CoDeSysOPCDA. On the menu, click Properties.
9. The CoDeSysOPCDA Properties window is displayed. Select the General tab, and specify Connect for Authentication Level.
Loading...