2.4. Operating system configuration

The main task is to setup the operating system to support the appropriate network adapter for EtherCAT® usage and for some systems real-time configuration may be needed.

The operating system-specific settings and configurations are described in Platform and Operating Systems (OS).

2.4.1. Running EcSimulatorHilDemoGuiDotNet

EC-Simulator HiL for Windows contains a .NET example application, the EcSimulatorHilDemoGuiDotNet.

Selecting the appropriate network adapter and providing an EtherCAT® Network Configuration file (ENI / EXI) is mandatory before clicking “Start” to run the EC-Simulator:

EcSimulatorHilDemoGuiDotNet start parameters

2.4.2. Running EcSimulatorHilDemo

The EcSimulatorHilDemo is an EC-Simulator example application that handles the following tasks:

  • Showing basic EtherCAT® communication

  • Stack initialization

  • Process Data operations (e.g., flashing INPUTs)

  • Periodic diagnosis task

  • Periodic Job Task

  • Logging to ecsimulator0.log, error0.log

The EcSimulatorHilDemo is available “out of the box” for different operating systems. The operating system must be prepared for running EtherCAT® applications.

2.4.2.1. Setting up and running EcSimulatorHilDemo

2.4.2.1.1. Linux (EcSimulatorHilDemo)

  1. Operating system configuration: See the section Operating system configuration for how to prepare the operating system.

  2. Starting EcSimulatorHilDemo

$ cd /opt/EC-Simulator/Bin/Linux/x64
$ ./EcSimulatorHilDemo -intelgbe 2 1 -f exi.xml -perf -sp

2.4.2.1.2. Microsoft Windows (EcSimulatorHilDemo)

  1. Windows configuration: See the section Operating system configuration for how to prepare the operating system.

  2. Determine the network interface: Using the command line option the network interface card used by the example application can be determined. For example the option -ndis 192.168.157.2 0 will be using the network adapter card with the IP address 192.168.157.2 .

  3. Simulating EtherCAT® modules: The simulator has to be connected with the target system using an Ethernet switch or a patch cable. Local IT infrastructure should not be mixed with EtherCAT® modules at the same switch as the MainDevice will send many broadcast packets! EtherCAT® requires a 100Mbit/s connection. Gigabit-Ethernet connections between simulator and MainDevice can be typically used, too.

  4. Copy all of the example application files into one directory: The application EcSimulatorHilDemo.exe together with the stack DLLs and the EXI file have to be copied into one directory.

  5. Run the example application: EcSimulatorHilDemo.exe has to be executed. The file name of the EXI file has to be given as a command line parameter as well as the appropriate Real-time Ethernet Driver parameters.

$ EcSimulatorHilDemo.exe -ndis 192.168.157.2 0 -f exi.xml -t 0 -v 3 -sp

2.4.2.2. Command line parameters

EcSimulatorHilDemo <LinkLayer> [-f ENI-FileName] [-t cycle time] [-b time] [-a affinity] [-v level] [-perf [level]] [-log prefix [msg cnt]] [-lic key] [-oem key] [-fingerprint method] [-flash address] [-sp [port]] [-rec [prefix [frame cnt]]]

The parameters are as follows:

-f <ENI-FileName>

Path to ENI file

-t <time>

Running duration [ms]. When the time expires the demo application exits completely.

<time>:

Time [ms], 0 = forever (default = 120000)

-b <cycle time>

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

<cycle time>:

Bus cycle time in µsec

-a <affinity>

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

<affinity>:

0 = first CPU, 1 = second, …

-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.

<level>:

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

-perf [<level>]

Enable max. and average time measurement in µs for all EtherCAT® jobs (e.g. ProcessAllRxFrames).

<level>:

Depending on level the performance histogram can be activated as well.

-log <prefix> [<msg cnt>]

Use given file name prefix for log files.

<prefix>:

<msg cnt>:

Messages count for log buffer allocation

-lic <key>

Set License key.

<key>:

License key string

-oem <key>

Use OEM key

<key>:

64 bit OEM key.

-fingerprint <method>

Read license fingerprint

<method>:

Fingerprint method

-flash <address>

Flash outputs

<address>:

0=all, >0 = SubDevice station address

-sp [<port>]

If platform has support for IP Sockets, this command-line option enables the Remote API Server to be started. 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.

<port>:

RAS server port

-rec [<prefix> [<frame cnt>]]

Packet capture file recording

<prefix>:

File name prefix

<frame cnt>:

Frame count for log buffer allocation