3. Running EcMasterDemoDc

The EcMasterDemoDc is available “out of the box” for different operating systems. It is an EC-Master example application that handles the following tasks:

  • Showing basic EtherCAT communication

  • Master stack initialization into OPERATIONAL state

  • DC and DCM configuration

  • Process Data operations for e.g. Beckhoff EL2004, EL1004 and EL4132

  • Periodic diagnosis task

  • Periodic Job Task in polling mode

  • Logging

Start the EcMasterDemoDc from the command line to put the EtherCAT network into operation. At least a Link Layer must be specified.

EcMasterDemoDc -winpcap 192.168.157.2 1 -f eni.xml -t 0 -v 3 -dcmmode busshift

3.1. Command line parameters

EcMasterDemoDc <LinkLayer> [-f ENI-FileName] [-t time] [-b cycle time] [-a affinity] [-v level] [-perf [level]] [-log prefix [msg cnt]] [-lic key] [-oem key] [-maxbusslaves cnt] [-flash address] [-sp [port]] [-auxclk period] [-dcmmode mode] [-ctloff] [-rec [prefix [frame cnt]]]

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>

Time in msec, 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>

Use License key.

<key>

26 characters long license key.

-oem <key>

Use OEM key

<key>

64 bit OEM key.

-maxbusslaves <cnt>

Set max number of slaves

-flash <address>

Flash outputs

<address>

0=all, >0 = slave 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

-auxclk <period>

Use auxiliary clock

<period>

Clock period in µs (if supported by Operating System).

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

Packet capture file recording

<prefix>

File name prefix

<frame cnt>

Frame count for log buffer allocation

-dcmmode <mode>

Set DCM mode

<mode>

off | busshift | mastershift | masterrefclock | linklayerrefclock

-ctloff

Disable DCM control loop for diagnosis