3. Getting Started

To enable a quick and easy start, every EC-Monitor package comes with a pre-compiled EcMonitorDemo executable. This example application handles the following tasks:

  • Showing basic EtherCAT communication

  • EC-Monitor initialization

  • Process Data acquisition with EC-DAQ

  • Periodic diagnosis task

  • Periodic Job Task in polling mode

  • Logging

See also

3.1. Running EcMonitorDemo

To capture the EtherCAT traffic insert a TAP device after the Master Controller.

Start the EcMonitorDemo from the command line to process the captured EtherCAT frames. At least a Link Layer and a ENI file must be specified.

EcMonitorDemo -winpcap 1 -f MasterENI.xml -t 0 -v 3

See also

Operating Systems (OS) for OS specific additional instructions to run the demo application

3.1.1. Command line parameters

EcMonitorDemo <Link Layer> [-f configFileName] [-t time] [-b time] [-v level] [-a affinity] [-perf [level]] [-auxclk period] [-sp [port] [-log prefix]

The parameters are as follows:

-f <configFileName>

Path to ENI file.

-t <time>

Running duration in msec. When the time expires the demo application exits completely.


Time in msec, 0 = forever (default = 120000)

-b <cycle time>

Specifies the bus cycle time. Defaults to 1000µs (1ms).

<cycle time>

Bus cycle time in µsec

-v <level>

The verbosity level specifies how much console output messages will be generated by the demo application. A high verbosity level leads to more messages.


Verbosity level: 0=off (default), 1..n=more messages

-a <affinity>

The CPU affinity specifies which CPU the demo application ought to use.


0 = first CPU, 1 = second, …

-perf [level]

Enable max. and average time measurement in µs for all EtherCAT jobs (e.g. ProcessAllRxFrames). Depending on ‘level’ the performance histogram can be activated as well.

-sp [port]

If platform has support for IP Sockets, this command line option enables the Remote API Server to be started with the EcMonitorDemo. The Remote API Server is going to listen on TCP Port 6000 (or port parameter if given) and is available for connecting Remote API Clients. This option is included for attaching the EC-Inspector Application to the running monitor.

-log prefix

Use given file name prefix for log files.

3.2. Compiling the EcMonitorDemo

The following main rules can be used to generate the example applications for all operating systems.

  • <OS> is a placeholder for the operating system used.

  • <ARCH> for the architecture. If different architectures are supported.

3.2.1. Software Development Kit (SDK)

The EC-Monitor development kit is needed to write applications based on the EC-Monitor core. The EC-Monitor core is shipped as a library which is linked together with the application.

The following components are supplied together with an SDK:

  • /Bin: Executables containing the EC-Monitor core

  • /Doc: Documentation

  • /Examples: Example applications as source code

  • /SDK: EtherCAT Software Development Kit containing libraries and header files to build C/C++-applications

  • /SDK/INC: Header files to be included with the application

  • /SDK/LIB: Libraries to be linked with the application

  • /SDK/FILES: Additional files for platform integration

  • /Sources/Common: Shared source code

3.2.2. Include search path

The header files are located in the following directories:


3.2.3. Libraries

The libraries that need to be added are in the following directories:


3.2.4. Preprocessor definitions

The following preprocessor directives must be set in the build environment or project:


Exclude the EC-DAQ support in the demo: