acontis technologies gmbhsoftware.acontis.com/documents/ec-win(rtos-32... · acontis technologies...

35
acontis technologies GmbH SOFTWARE Windows Realtime Extension & EtherCAT-Master Stack Getting Started Guide Version 6.0

Upload: others

Post on 17-Jan-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH

SOFTWARE

Windows Realtime Extension & EtherCAT-Master Stack

Getting Started Guide

Version 6.0

Page 2: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

Edition: 2015-06-10

© Copyright acontis technologies GmbH

Neither this document nor excerpts therefrom may be reproduced, transmitted, or conveyed to third parties by any means w hatever without the express permission of the publisher. At the time of publication, the functions described in this document and those implemented in the corresponding hardware and/or software were carefully verif ied; nonetheless, for technical reasons, it cannot be guaranteed that no discrepancies exist. This document w ill be regularly examined so that corrections can be made in subsequent editions. Note: Although a product may include undocumented features, such features are not considered to be part of the product, and their functionality is therefore not subject to any form of support or guarantee.

Page 3: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

Table of Contents

Inhalt 1. Introduction ............................................................................................................... 4

1.1. Documentation ....................................................................................................... 5

1.2. Architecture of EC-Win............................................................................................ 5 1.3. Directory structure of the EC-Win package ............................................................... 6

2. Getting Started with EC-Win ......................................................................................10

2.1. Prerequisites .........................................................................................................10 2.2. EC-Master demo application...................................................................................10 2.3. The EC-Win Demo application ................................................................................11

2.3.1. Purpose of the EcWinDemo.............................................................................11 2.3.2. Prerequisites ..................................................................................................11 2.3.3. Setup environment and get EcWinDemo running ..............................................11 2.3.4. Commands overview.......................................................................................12

2.4. The EC-Win Software Development Kit (SDK) .........................................................13 2.5. EC-SlaveTestApplication (EC-STA) ........................................................................13

2.6. System Manager ...................................................................................................14 3. Setup the Real-time Extension Runtime .....................................................................15 4. Network Controller Setup...........................................................................................18

4.1. EC-Win configuration .............................................................................................18 4.1.1. Identify your Network Controller .......................................................................18

5. EtherCAT Hardware Setup ........................................................................................20

6. Generating an EtherCAT configuration (ENI) ..............................................................21 6.1. Prerequisites .........................................................................................................21 6.2. Run the ECMaster Demo application ......................................................................21

6.3. Prerequisites .........................................................................................................26 6.4. Building the Demo using the System Manager .........................................................26 6.5. Debugging the Demo .............................................................................................31

7. Building the EC-Win Example Programs.....................................................................32 7.1. Build instructions for RTOS-32 (with System Manager) ............................................32 7.2. Build instructions for RTOS-32 (no System Manager)...............................................32

7.2.1. Preparations for EC-Master Example Programs ................................................32 7.2.2. Recommended generic build instructions for RTOS-32 ......................................32

7.3. Build instructions for Windows XP / Windows 7........................................................33

8. Appendix ..................................................................................................................35 8.1. Adding User settings in a System Manager configuration .........................................35 8.2. Relation between RTOS files and cmd line parameters ............................................35

Page 4: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 4 / 35

1. Introduction EC-Win is a bundle of the acontis EtherCAT-Master Stack (EC-Master) for RTOS-32 and the acontis Rtos32Win real-time extension for Windows XP 32-Bit / Windows 7 32-Bit / Windows 7 64-Bit.

The acontis Rtos32Win enables RTOS-32 to share a single computer with a Microsoft Windows

desktop operating system while maintaining RTOS-32 hard real-time determinism and performance. Both operating systems operate independent from each other, and, therefore, RTOS-32 operation is immune to desktop Windows exceptions and faults.

The acontis EC-Master for RTOS-32 is a full featured high performance EtherCAT Master Stack. EC-Master provides hardware drivers for several Ethernet Controllers (Intel / Realtek). By using the so called “Optimized Link Layer’s” EC-Master can access the Ethernet Controller’s directly and offers outstanding real-time performance.

This document gives you an overview about the EC-Win software bundle. In this document a step by step walkthrough is given how to setup the Rtos32Win real-time extension and get our EtherCAT example program (“EtherCAT demo”) running under RTOS-32. In the last chapter we give brief instructions how the shipped SDK examples can be built with Visual Studio.

The EC-Win package comes with the following components:

• Real-time extension runtime

o Kernel driver for virtual network adapter between Windows and RTOS-32

o Kernel driver to assign hardware resources to the real-time OS (RTOS-32)

o Virtual Machine Framework (Runtime shared by Windows and RTOS-32

o Ready to Run “RTOS-32” OS Image + SDK.

• SDK’s for the real-time extension and the EC-Master

o Integrated EVAL Version of RTOS-32

o Libraries and header files for developing your own C/C++ applications, using our RTOS framework. E.g. you can develop applications which can communicate between Windows and RTOS-32 through shared memory and signals.

o Libraries and Header files for developing your own C/C++ EtherCAT-Master application which can drive an EtherCAT bus.

o User mode drivers (EtherCAT Optimized Link Layer’s) for Intel and Realtek PCI or PCI-Express Ethernet Controllers.

o EC-Master Class-A Add-On Package (Provides the following EC-Master features: Distributed Clocks, Distributed Clock Master Synchronization, EoE, VoE and AoE)

o Extensible demo applications and examples (under SDK/examples)

• Tools and Utilities

o EC-SlaveTestApplication (EC-STA). This is a powerful test and monitoring tool which can be very helpful during development of EtherCAT applications and hardware (under Bin/Windows/x86/ECSlaveTestApp.exe).

o System Manager. This is the primary configuration tool for EC-Win.

Page 5: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 5 / 35

1.1. Documentation

For introductive information about the EtherCAT technology and EC-Master please read our EC-Master_QuickStart_Guide.pdf.

The EC-Master user’s manual (EC-Master_ClassB.pdf) provides detailed information about EC-Master in general and also describes the EC-Master API.

The EC-Master Class-A Add-on manual EC-Master_ClassA.pdf provides detailed information about advanced EC-Master features like Distributed Clocks, Distributed Clock Master Synchronization, EoE, VoE and AoE.

For detailed information about the real-time extension (Rtos32Win), please read the Rtos32Win.pdf manual.

The Rtos32Win API is described in the RtosVM-UserManual.pdf document.

1.2. Architecture of EC-Win

Figure 1-1 High level diagram of the EC-Win architecture

Description of the Components: Windows 7 (32/64 Bit): All applications are non-deterministic. We support Windows 7 (32-/64-Bit) and Windows XP (32-Bit).

Page 6: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 6 / 35

User Interface Application: An optional Windows application which uses the real time extension API to communicate with the real-time (RTOS-32) part.

EC-Engineer is the EtherCAT configuration and diagnosis tool from acontis (http://www.acontis.com/eng/products/downloads/index.php). It is an extensible alternative to the Beckhoff ET9000 tool. You will need a configuration tool for generating the EtherCAT Network Information File (ENI, according to ETG.2100) from the EtherCAT device description files (ESI). The ENI is the input configuration to the EC-Master.

Real-Time Environment: Real-time part running on separate real-time platform (RTOS-32). Our real-time extension can be setup so that RTOS-32 runs on an exclusive CPU in a SMP system or shares CPU/CPU‘s with Windows. EtherCAT Application: E.g. motion control application which drives the EtherCAT bus, using the EC-Master. In the next chapter we describe how our EtherCAT demo application can be used as a starting point / template for an own application. EC-Master: EtherCAT master stack for RTOS-32. Visual Studio is used for development/debugging of the Windows and real-time (RTOS-32) part.

1.3. Directory structure of the EC-Win package

SDK C/C++ SDK (Visual Studio) for the EC-Master and the real-time extension.

SDK/Examples Demonstration and examples applying to the real-time-extension API and the EC-Master API.

SDK/Examples/RTOS-32 Examples for RTOS-32 (real-time part). For building these examples you need to follow the instructions in the “HowToBuildTheExamples.txt” file within the example directories.

ECMasterDemo Drive EtherCAT bus to operational mode. If you connect Beckhoff digital output clamps (EL2002/EL2004 or EL2008) (AND/OR Beckhoff EL9800 evaluation board) then the slave LED’s are driven as a binary counter. This program doesn’t use interrupts (polling). This is a basic EtherCAT application framework. We recommend using this program as a starting point for your own application.

ECWinDemo This demo supplies several functions for some general use cases. These functions are activated/controlled by the Windows counterpart of this demo. Furthermore the current values of activated functions will be sent to the Windows counterpart. This is the counterpart to SDK/Examples/Windows/ECWinDemo. We recommend this as the starting point for your application, if a control/monitor application on the Windows side is needed and a real-time application, which do the dirty work.

ECMasterDemoSyncSm Like ECMasterDemo, but operates the network controller in interrupt mode (Interrupt on receiving Ethernet frames).

Page 7: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 7 / 35

ECMasterDemoDc Like ECMasterDemo, but demonstrates the usage of EtherCAT’s “Distributed Clocks (DC)” and DCM Bus-Shift synchronization. Please read the EC-Master Class-A Add-on Manual, chapter 2 for further information about this demo.

EventDemo Shows how to send and receive signals from/to Windows to RTOS-32 and vice versa. This is the counterpart to SDK/Examples/Windows/EventDemo.

InterlockDemo Wait free synchronization of shared data structures between RTOS-32 and Windows. This is the counterpart to SDK/Examples/Windows/InterlockDemo.

NotificationDemo How to gracefully handle system shutdown and “Blue Screen of Death” notification in RTOS-32.

RTOS-32Demo A basic RTOS-32 demo, which shows various aspects of RTOS-32. It’s the source code base of the delivered precompiled HelloVmf.bin.

RamDskDemo/RealtimeDemo/SharedModeDemo and TelnetSmbDemo Several demos which show several aspects of the possibilities of the real-time part. Please see Rtos32Win.pdf for further information.

ShmDemo Interchanging data between Windows and RTOS-32 using shared memory. This is the counterpart to SDK/Examples/Windows/ShmDemo.

SDK/Examples/Windows Examples for Windows XP / Windows 7

ECWinDemo This demo send commands to the real-time counterpart and controls several functions, which demonstrates some general use cases. Furthermore it receives current values of the activated functions. This is the counterpart to SDK/Examples/RTOS-32/ECWinDemo. This demo is recommended for these use cases, where a non-real-time application controls/monitor a real-time counterpart.

EventDemo Show how to send and receive signal from/to Windows to RTOS-32 and vice versa. This is the counterpart to SDK/Examples/RTOS-32/EventDemo.

InterlockDemo Wait free synchronization of shared data structures between RTOS-32 and Windows. This is the counterpart to SDK/Examples/RTOS-32/InterlockDemo.

ShmDemo Interchanging data between Windows and RTOS-32 using shared memory.This is the counterpart to SDK/Examples/RTOS-32/ShmDemo.

UploadDemo How to use the real-time extension loader API.

Page 8: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 8 / 35

SDK/On Time RTOS-32 5.0 Evaluation Kit This directory and its subdirectories contains the integrated RTOS-32 Eval Kit.

SDK/Inc Header files for the EC-Master- and real-time extension API. These headers apply to RTOS-32 and/or Windows.

SDK/Inc/Windows Header files which apply to Windows XP / Windows 7 only.

SDK/Inc/RTOS-32 Header files which apply to RTOS-32 only.

SDK/Lib Import libraries for the EC-Master and real-time extension API (DLL’s).

SDK/Lib/RTOS-32/x86 Libraries which apply to RTOS-32.

EcMaster.lib Import library for the EcMaster. If you build an EtherCAT application you always should link with this library.

AtemRasSrv.lib Import library for the AtemRasSrv. This is the import library for the “Remote Access Server” (RAS) interface of the EC-Master. You only need to link against this library if you use that feature.

emlli8254x.lib, emlli8255x.lib, emllRTL8139.lib, emllRTL8169.lib Import libraries for the optimized link layers.

SDK/Lib/Windows/x86 + x64 Libraries which apply to Windows XP (32-Bit) or Windows 7 (32-Bit / 64-Bit).

RtosLib32.lib / RtosLib64.lib Import library for the real-time extension API (basic features).

VmfInterfaceUserMode32.lib / VmfInterfaceUserMode64.lib Import library for the real-time extension API (advanced features).

Bin Runtime, compiled examples and tools for the EC-Master and the real-time extension.

Bin/RTOS-32/x86 RTOS-32 precompiled images

ECMasterDemoVmf.BIN RTOS-32 OS Image with EC-Master, Master Demo, etc. included, which automatically starts up the ECMasterDemo.

HelloVmf.BIN RTOS-32 demo image (default Rtos32Win demo image without EC-Master parts)

HelloVmf.txt Readme of the RTOS-32 demo image (default Rtos32Win demo image)

MonVmf.BIN RTOS-32 debug monitor

Bin/Windows/x86 EC-SlaveTestApp tool, real-time extension runtime and DLL.

EcMaster.dll, AtemRasSrv.dll, AtemRasClnt.dll, EcMasterDotNet.dll, emllPcap.dll, ECSlaveTestApp.exe Files needed by the EC-SlaveTestApplication tool.

RtosControl.exe, RtosService.exe, RtosUpload.exe Programs for controlling the real-time extension.

Page 9: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 9 / 35

RtosLib32.dll This DLL implements the real-time extension API. (See also SDK/Lib/Windows/x86 + x64)

Telnet Debug console for the RTOS-32 output + telnet client.

Bin/Windows/Drivers Windows XP / Windows 7 kernel drivers used by the real-time extension.

Bin/Windows/Config Configuration files used by the real-time extension. Contains also the config file for the EC-Master (MasterENI.xml)

Doc Documentation. See also chapter 1.1.

<Root-Directory> (where EC-Win was installed)

ECVersion.txt

File with version information of included EC-Master

Version.ini

File with product/version/etc. information of EC-Win

Page 10: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 10 / 35

2. Getting Started with EC-Win This manual will guide you through the following steps:

1. Hardware / Software setup including the Intel PRO/1000 network adapter, several EtherCAT slaves. (See chapter 3)

2. Generate the EtherCAT master ENI configuration file using the EC-Engineer. (See chapter 6) 3. Build and Debug the EtherCAT demo with Visual Studio (See chapter 6.4)

2.1. Prerequisites Please make sure that the following conditions are met:

• Installed .NET Framework Version 4.0 (Client Profile) (For running the EC-Engineer and/or EC-STA – Slave Test Application)

• Installed Microsoft Visual Studio 2005 with latest service pack.

• Installed On Time RTOS-32 Eval1 package, at least Version 5.26 (for compiling the demo application) Hint: Since version 5.1.0.23 of the real-time extension the On Time RTOS-32 Eval package is integrated.

• Installed EC-Win (requires at least .NET Framework Version 4.0 Client Profile).

• Installed WinPcap (For running EC-Engineer and the EC-STA – Slave Test Application)

• Installed EC-Engineer (Get latest (trial) version from http://www.acontis.com/eng/products/downloads/index.php)

• Intel PRO/1000 gigabit network controller hardware installed on the target device.

• For Windows 7 64-Bit edition only: At least two (logically) CPU cores.

• Miscellaneous EtherCAT Slave(s).

2.2. EC-Master demo application

The EC-Master EtherCAT demo application (located in \SDK\Examples\RTOS-32\ECMasterDemo below the EC-Win installation directory) is shipped in source code; it contains a quite useful application framework to interact with the EC-Master Stack. See also chapter 1.3 Directory structure of the EC-Win package for a description of the EC-Win directory structure.

In this document we show how the EtherCAT demo can be used with an Intel Gigabit Network Controller2 (Intel PRO/1000) communicating with several EtherCAT slaves supplied by Beckhoff.

It is possible to use alternative EtherCAT hardware with the EtherCAT demo, however, the user is required to generate a valid EtherCAT master XML configuration file. acontis technologies supplies a tool (EC-Engineer) to generate this file. An example on how to generate this file is given in section 6 Generating an EtherCAT configuration (ENI) of this document. Some adjustments to the demo I/O sequence in el9800.cpp, located in the EC-Master Demo source directory, may also be necessary. 1 Important: Using the FULL version of On Time RTOS-32 requires other steps for debugging. Thus please read chapter 5.2 of RTOS32Win.pdf, especially the section about Debug Monitor. 2 Our Intel PRO/1000 Link Layer has support for Intel 8254x, 8256x, 8257x, 8258x, 21x, 35x and controllers embedded into PCH / ICH. For a complete list of currently supported MAC’s please see the EC-Master user’s manual, chapter 3.6.3.

Page 11: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 11 / 35

The EtherCAT demo is a monolithic RTOS-32 OS image (ECMasterDemoVmf.BIN) and all hardware accessed by the demo is operated by RTOS-32. This allows the EtherCAT demo to run with the same real-time performance as it would if running on stand-alone hardware. All necessary RTOS-32 software and source files are included in the demo.

This document outlines the procedure necessary to configure both the hardware and software components of the demo in several general steps.

2.3. The EC-Win Demo application

2.3.1. Purpose of the EcWinDemo

The EcWinDemo consists of two parts: a real-time part and a Windows part.

Basically it shows how to send control commands from the non-real-time part (windows side) of the EcWinDemo to the real-time part. The control commands control some selected, general cases on the real-time part. Furthermore it shows how to start/stop, do logging, etc. of the real-time part.

The Windows part (EcWinDemo.exe) has mainly 3 jobs:

a) Start/stop the real-time part

b) Sending commands to the real-time part of the EcWinDemo

c) The current values are taken from the real-time part of EcWinDemo

The real-time part (EcWinDemo.bin) has mainly 2 jobs:

a) Waiting for new commands from the Windows part

b) Sending of selected current values to the Windows part

2.3.2. Prerequisites

To get the EcWinDemo running, the following prerequisites are needed:

• EcWin 6.0.0.20 or newer

• A valid ENI file which reflects the topology of the used EtherCAT devices.

• For Func 1 (Link input bit to output bit): 1 input device (ex. EL100X) and 1 output device (ex. EL200X) IMPORTANT: THE INPUT DEVICE MUST BE TRIGGERED SOMEHOW (EXTERNAL OR BY AN OTHER DEVICE)!

• For Func 2 (Toggle output bit): 1 output device (ex. EL200X)

2.3.3. Setup environment and get EcWinDemo running

The following steps are required to get the EcWinDemo running:

CAUTION: THE ORDER IS IMPORTANT! SECTION A) MUST BE DONE FIRST AND AFTER THAT SECTION B)

a) SystemManager:

o Add Rtos

o Assign desired network card to the real-time part. Push the button "Assign To RTOS (Interrupt Disabled)" The EtherCAT slaves are connected on this network card.

o Push button "Open Existing Application"

Page 12: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 12 / 35

o Select EcWinDemo.bin from the drop-down box at appearing dialog "Add New Realtime Application".

o Push "OK" button.

o Now a new dialog appears "Customize ECWinDemo.bin"

o HINT: No changes should be required at this stage.

o Push "OK" button.

The EcWinDemo.bin node is now selected and the settings will be shown on the right pane.

o Go to section "Configuration" and check the EtherCAT Network Information File (ENI) check-box.

o Browse for the valid ENI file.

o !!! IMPORTANT: SAVE THE CONFIGURATION IN SYSTEMMANAGER !!!

HINT: All configuration settings for the real-time part are now finished!

o Start EcWinDemo.exe either from the SystemManager (6th icon on the left side or menu item "Run|Start ECWinDemo") or directly from %RTE_ROOT%\Bin\Windows\x86\EcWinDemo.exe

b) EcWinDemo.exe:

o On "Start Page" tab:

Select "Local" mode

Push "Start" button

After successful start of the real-time part push "Connect" button.

o On "Demo App" tab:

Push "Start" button at section "Application Control"

Func 1:

• Select input slave from drop-down box

• Enter desired bit offset of input slave

• Select output slave from drop-down box

• Enter desired bit offset of output slave

• Push button "Enable/Disable"

Func 2:

• Select output slave from drop-down box

• Enter desired bit offset of output slave

• Push button "Enable/Disable"

2.3.4. Commands overview

- With Func 1 (link input bit to output bit) an arbitrary, by user selected input bit of 1 input device will be mapped onto an arbitrary, by user selected input bit of 1 output device. External changing of the input bit value will be forwarded to the output bit. The current values of both bits will be detected and shown by the Windows part of the demo.

- With Func 2 (toggle output bit) will an arbitrary, by user selected output bit of 1 output device be toggled every 1 sec. The current value of the bit will be detected and shown by the Windows part of the demo.

Page 13: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 13 / 35

2.4. The EC-Win Software Development Kit (SDK)

The EC-Win software development kit, located in SDK (below the EC-Win installation directory), contains libraries and header files to develop software on top of the EC-Master Stack or the real-time extension (Rtos32Win based).

Furthermore it contains the integrated On Time RTOS-32 Eval package. Please see also chapter 1.3 (Directory structure of the EC-Win package) for a description of the EC-Win directory structure.

2.5. EC-SlaveTestApplication (EC-STA)

The EC-STA (EtherCAT SlaveTestApplication) is useful for manufacturers of EtherCAT slave devices to perform comprehensive tests based on the EC-Master stack.

Typically, the EC-STA will be used while creating and testing EtherCAT slave software as well as for slave production tests. The EC-STA offers a comfortable and clear user interface with many features and allows testing any existing EtherCAT slave devices.

Figure 2-1 (EC-SlaveTestApplication)

Page 14: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 14 / 35

2.6. System Manager

The System Manager is used for configuration of the real-time part of EC-Win as well as for managing the whole development process. It provides functionality to manage the memory configuration, the CPU assignment to the RTOS and the assignment of PCI devices. Furthermore it provides functionality to deploy applications to the real-time part and create the Visual Studio projects for the example programs.

Figure 2-2 (System Manager)

Page 15: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 15 / 35

3. Setup the Real-time Extension Runtime This chapter describes how to setup the basic parameters of the real-time extension via the supplied System Manager tool. First step is to choose a place for your workspace. Selecting the default place is recommended.

Figure 3-1 (Add Workspace)

Next step is to “Add RTOS”. In this example it’s “On Time RTOS-32”After adding RTOS it’s time to go to the “CPU Assignment”

If started first and Windows 7 32BIT is used all available CPUs are assigned to Windows 7 and the first CPU is additionally assigned to Windows CE. (Figure 3-3) This CPU Assignment may be valid, however it isn’t recommended. To achieve a recommended “CPU Assignment” assign all CPU’s to Windows, except the last one. The last CPU has to be assigned to “On Time RTOS-32”.(Figure 3-4)

Page 16: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 16 / 35

Figure 3-3 (CPU Assignment)

Figure 3-4 (CPU Assignment)

If Windows 7 64Bit is used, the real-time part must use at least one CPU exclusively. To achieve this use the “number of processor slider” above the CPU table in such a way that the real-time part has at least one CPU exclusively. After doing that the CPU assignment should be valid.

Page 17: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 17 / 35

It’s important that the message beyond the CPU table is green and the CPU assignment is valid!

The System Manager will show a reboot message box, if some changes require a reboot after save settings has been pushed.

Page 18: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 18 / 35

4. Network Controller Setup It is necessary to assign the Intel PRO/1000 network device to RTOS-32 before attempting to run the EtherCAT demo.

With some configuration it is possible to also use a Realtek network controller with the supplied EtherCAT demo.

Reassignment of hardware in EC-Win is a two-step process: Isolate the device interrupts (usually not needed for EtherCAT) and install the EC-Win RtosPnp device driver. See also the RTOS VM User Manual for more information about real-time device management. Most of the work will be done by the System Manager.

Please see the EC-Master user’s manual for a description of the two EtherCAT operation modes (Polling vs. Interrupt)

As the usual operation mode in EtherCAT systems is polling (no interrupts) mode, usually interrupt configuration can be skipped. The interrupt mode is described in the appendix.3

4.1. EC-Win configuration

4.1.1. Identify your Network Controller

Please see chapter 3.6.3 “Supported network controllers”, row “Intel Pro 1000” in the EC-Master user’s manual for a list of supported Intel Gigabit Network Controllers (including PCI device ID).The System Manager lists an overview over all available/possible network controller with available LinkLayers in the current system.

Please apply the following to identify a suitable/compatible network controller:

1. Open the System Manager. 2. Expand the Global Settings. 3. Expand the EtherCat Compatible Devices. 4. Select the desired network adapter (if a compatible network adapter was found!) 5. Right click of the desired network adapter and select Assign to RTOS (Interrupt disabled). 6. Please see Figure 4-1.

With toggling of the world icon only devices which are supported by the EC-Master are shown. The default is to show only EC-Master compatible devices of this PC (no graphics adapter card, HDD, etc.)

3 If you want to use our ECMasterDemoSyncSm demo, which operates in interrupt mode, then you should assign it with a interrupt.

Page 19: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 19 / 35

Assign with Interrupts Disabled:

Figure 4-1 (System Manager)

Successfully assigned EC-Win RtosPnp Device Driver will be listed under the Realtime OS Devices tree node under the node “Device Configuration”.

WARNING: DURING THE INSTALLATION OF THE RTOS DRIVER OF THE SELECTED NETWORK CARD, WINDOWS COULD THROW SEVERAL POP-UP WINDOWS. ON WINDOWS XP THE USER MUST IGNORE THESE POP-UP WINDOWS! THEY WILL DISAPPEAR AUTOMATICALLY!

WARNING: DURING INSTALLATION OF THE RTOS DRIVER OF THE SELECTED NETWORK CARD A REBOOT COULD BE NEEDED. IN THAT CASE START THE SYSTEM MANAGER AFTER THE REBOOT AGAIN AND CHECK IF THE DESIRED NETWORK CARD IS ASSIGNED CORRECTLY TO THE RTOS.

Page 20: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 20 / 35

5. EtherCAT Hardware Setup The following diagram shows a typical hardware setup to run the EtherCAT sample application.

• PC running EC-Win • Intel PRO/1000 network adapter • CAT 5 cable to connect to the EtherCAT slaves

Figure 5-1 (EC-Win EtherCAT Setup)

Page 21: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 21 / 35

6. Generating an EtherCAT configuration (ENI)

The EtherCAT Configurator tool EC-Engineer is a piece of software available from the acontis technologies GmbH which can automatically generate EtherCAT configuration files based on the EtherCAT hardware being used. It can scan an Ethernet interface and automatically determine connected EtherCAT devices.

The general process is to:

1. Add the ECMasterDemo application to the RTOS using the System Manager 2. Run the ECMasterDemo application using the System Manager without providing an ENI file 3. Start the EC-Engineer via SystemManager 4. EtherCAT slaves connected to the network controller card assigned to RTOS-32 will automatically

be scanned. 5. The file will automatically be saved.

6.1. Prerequisites

Several preparations have to be made prior to running the ECMasterDemo application.

• The correct hard and software environment (see chapter 0 and 5) has to be installed.

• A network controller, assigned to the real-time OS (see chapter 0)

• EtherCAT slaves connected to the network adapter and powered on

6.2. Run the ECMaster Demo application

First of all you have to start the Demo. To do this start the System Manager

Then go to “RTOS #1”->”Applications” and open a new Target Console Window.

Page 22: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 22 / 35

Figure 6-1 (System Manager)

Then open an Existing Application and choose the ECMasterDemo.bin and click OK.

Figure 6-2 (Realtime Application)

Now it’s time to select the Network Adapter for EtherCAT. In this case it’s the “RTOS Intel® Pro/1000 GT Desktop Adapter”

Figure 6-3 (Selecting Network Adapter)

Page 23: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 23 / 35

The final step is to select the ECMasterDemo.exe and click on Start RTOS.

Figure 6-4 (Starting RTOS)

Now the demo application is running and connected to the EtherCAT devices. The demo is prepared to be remotely connected with the EC-Engineer for scanning the EtherCAT network.

Figure 6-5 (Running Demo Application)

Page 24: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 24 / 35

Go back to the SystemManager and start the EC-Engineer with clicking on “EtherCAT Network Configuration”

Figure 6-6 (EC-Engineer)

Page 25: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 25 / 35

The EC-Engineer will start and automatically scan for devices. After this close the Engineer and click on yes -> the ENI file will be saved.

Page 26: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 26 / 35

6.3. Prerequisites

Several preparations have to be made prior to running the demo.

• The correct hard and software environment (see chapter 0 and 5) has to be installed.

• An EtherCAT network configuration file (chapter 6) (ENI) has been generated that fits to your EtherCAT bus.

• A network controller, assigned to the real-time OS (see chapter 0)

• EtherCAT slaves connected to the network adapter and powered on

• The ECMasterDemo application was added to the RTOS

6.4. Building the Demo using the System Manager

5.1. The first step for running the demo is to start the SystemManager.

5.2. Then go to “RTOS #1”->”Applications” and open a new Target Console Window.

5.3. Go to the Application “ECMasterDemo.exe” you created in chapter 6.

5.4. The final step is to select the ECMasterDemo.exe and click on Start RTOS.

Figure 7-2 (System Manager)

After clicking OK you have to select your Network Adapter.

Page 27: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 27 / 35

Figure 7-3 (System Manager)

Page 28: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 28 / 35

Start the Target Console Window, it will show messages generated by the Debug Monitor and the demo application.

Figure 7-4 (Target Console Window)

Next step is to provide the ENI file.

If you followed the corresponding chapter within this guide you will find it under bin/windows/config.

Figure 7-5 (Providing the ENI file)

Page 29: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 29 / 35

Now please click on the button “Open Project with Visual Studio”

Hint: Never start Visual Studio directly to open a real-time (On Time RTOS-32) project, for more background information see the corresponding manuals!

When Visual Studio opens the first time, the Project will automatically be created within the workspace.

Every Time Visual Studio is started, the DebugMonitor will be implicitly launched.

You should see the following message on the Debug Console. (Figure 7-6)

Figure 7-6 (Debug Console)

Page 30: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 30 / 35

Right Click on “ECMasterDemo” and rebuild the Demo.

Figure 7-7 (Building the Demo)

Page 31: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 31 / 35

6.5. Debugging the Demo

After Building the Demo via SystemManager, you only have to press F5.

Page 32: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 32 / 35

7. Building the EC-Win Example Programs

7.1. Build instructions for RTOS-32 (with System Manager)

See chapter 6.4

7.2. Build instructions for RTOS-32 (no System Manager)

The example programs are located in separate directories. In chapter 1.3 (Directory structure of the EC-Win package) there is a brief description for each of the example programs.

All instructions apply also to newer Visual Studio Versions (2008, 2010, 2012 and 2013).

7.2.1. Preparations for EC-Master Example Programs

Several preparations have to be made prior to building the EcMasterDemo, EcMasterDemoDc or EcMasterDemoSyncSm example programs:

• The correct hard and software environment (see chapter 4 and 5) has to be installed.

• Generate a new EtherCAT configuration file (chapter 6) that matches the hardware setup.

• Copy the generated EtherCAT configuration file to Bin\Windows\Config\EcMasterENI.xml (below the EC-Win installation directory).

• Setup your network controller (see chapter 4.1.1)

Further information about needed settings, etc. for specific examples could be found either at the HowToBuildTheEcMasterExamples.txt or at the HowToBuildTheExamples.txt in \SDK\examples\RTOS-32 directory!

7.2.2. Recommended generic build instructions for RTOS-32

THE RECOMMENDED WAY OF BUILDING THE EXAMPLES IS USING THE SUPPLIED VISUAL STUDIO ADD-IN! ALL OTHER WAYS ARE ONLY SUPPLIED FOR COMPLETENESS!

1. Open Visual Studio 2005 with VsProjRTOS32Open.bat! (via provided Desktop Link Desktop -> Visual Studio XXXX for RTOS-32 OR Start Menu Link Start -> All Programs -> acontis technologies -> EC-Win(RTOS-32) -> Visual Studio XXXX for RTOS-32 OR via supplied batch file \SDK\Tools\VS-AddIn\VsProjRTOS32Open.bat" <path_and executable_of_visualstudio> <solution.sln> if no solution is supplied, an empty Visual Studio will be started! This is important, because On Time RTOS-32 needs a special build environment!

2. Create new project and solution. Main menu: File->New->Project... New Project dialog appears.

Page 33: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 33 / 35

3. Select sub section acontis from C++ section in New Project dialog

4. Select EC-Win(RTOS-32) Real-time Application wizard4

5. Set name of new project: <Demo-Name> HINT: The name of the project should match the demo name!

6. Press OK button new project will be created

7. Add all *.cpp files located in SDK\Examples\RTOS-32\<Demo-Name> below the EC-Win installation directory to the project. Either with Add existing item or by drag'n'drop. See HowToBuildTheExamples.txt in SDK\Examples\RTOS-32\<Demo-Name> for list of all needed source files, additional settings, etc!

8. Build the Example.

9. Now the Example is built and ready to run. Trial Version of RTOS-32: Start the executable through the Debugger. See chapter 6.5 Full Version of RTOS-32 (provided for completeness): Copy the resulting binary (*.bin) to Bin\RTOS-32\x86 (below the EC-Win installation directory). Copy existing (Start -> All Programs -> acontis technologies -> EC-Win -> Start ECMasterDemo) shortcut and adjust the target of the shortcut to the copied executable (edit only the ECMasterDemoVmf.bin - part). Please see further details in RTOS32Win.pdf chapter 5.2.x.

10. The Example application can be debugged within Visual Studio 2005. Please see chapter 5 of the Rtos32Win user’s guide how to do this or see chapter 6.5 in this document.

11. Before running the demo a Debug Console window should be started where the output messages will be printed out. Open the “Debug Console” (Start -> All Programs -> acontis technologies -> EC-Win(RTOS-32) -> Debug Console)

7.3. Build instructions for Windows XP / Windows 7

This section offers building instructions for the shipped example programs in SDK\Examples\Windows (below the EC-Win installation directory).

Each directory is an own example program. In chapter 1.3 (Directory structure of the EC-Win package) there is a brief description for each of the example programs.

• Open Visual Studio 2005

• Create a new "Win32 Console Application”, select “Console application”, “Empty project”

• Add all *.cpp files located in SDK\Examples\Windows\<Demo-Name> below the EC-Win installation directory to the project.

• Go to Project "Properties" -> "C/C++" -> "General" -> "Additional Include Directories" Add SDK\inc and SDK\inc\Windows (below the EC-Win installation directory) as additional include directories.

• Go to Project "Properties" -> "Linker" -> "General" -> "Additional Library Directories" Add SDK\LIB\Windows\X86 (below the EC-Win installation directory)

4 For each supported Visual Studio version a Visual Studio add-in (code wizard) is provided on user behalf. On failure an empty console project should be used!

Page 34: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 34 / 35

• Go to Project "Properties" -> "Linker" -> "Input" -> "Additional Dependencies" -> "..." Add "RtosLib32.lib"

• Go to Project "Properties" -> "C/C++" -> "Language" -> "Treat wchar_t as Built-in Type" select "No"

• Go to Project "Properties" -> "C/C++" -> "Preprocessor" Add RTOS32WIN and _CRT_SECURE_NO_DEPRECATE to section "Preprocessor Definitions".

• Build the Example.

• Run the Example. Note that for EventDemo, InterlockDemo and ShmDemo a counterpart executable on the RTOS-32 side must be started (identically named; see source code below SDK\Examples\RTOS-32) for proper operation!

Page 35: acontis technologies GmbHsoftware.acontis.com/Documents/EC-Win(RTOS-32... · acontis technologies GmbH Page 4 / 35 1. Introduction EC-Win is a bundle of the acontis EtherCAT -Master

acontis technologies GmbH Page 35 / 35

8. Appendix

8.1. Adding User settings in a System Manager configuration

In a System Manager controlled environment, all user settings shall be stored in the file systemmgr_user.config which is located below the workspace’s config sub directory.

8.2. Relation between RTOS files and cmd line parameters

The EtherCAT examples use several files for configuring and/or logging, etc. These files will be given by the command line to the examples. In EC-Win this is realized by shared memory mapped files. A real file will be loaded into shared memory and the name of the shared memory will be given through the cmd parameters to the demo. Config files are given through read-only memory, logging files through read/write memory. Logging files could be dumped every time from the shared memory into the real file.

In the default case the system manager will take care about needed files and corresponding shared memories.