# Running EcMonitorDemo
To capture the EtherCAT® traffic insert a TAP device between the EtherCAT® adapter of the MainDevice and the first SubDevice.

Start the EcMonitorDemo from the command line to process the captured EtherCAT® frames. At least a Real-time Ethernet Driver and a ENI file must be specified.
```doscon
> EcMonitorDemo -ndis 192.168.157.2 1 -f eni.xml -t 0 -v 3
```
#### SEE ALSO
[Platform and Operating Systems (OS)](os.html.md#platform-and-operating-systems-os) for OS specific additional instructions to run the demo application
## Command line parameters
### EcMonitorDemo [-f ENI-FileName] [-t time] [-b cycle time] [-a affinity] [-v level] [-perf] [-log prefix [msg cnt]] [-lic key] [-sp [port]] [-rec [prefix]] [-play pcap-FileName] [-daqrec file name]
The parameters are as follows:
### -f
Path to ENI file
### -t
Running duration [ms]. When the time expires the demo application exits completely.
* **:**
Time [ms], 0 = forever (default = 120000)
### -b
Specifies the bus cycle time. Defaults to 1000 µs (1 ms).
* **:**
Bus cycle time in µsec
### -a
The CPU affinity specifies which CPU the demo application ought to use.
* **:**
0 = first CPU, 1 = second, …
### -v
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
### -perf []
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.
### -log []
Use given file name prefix for log files.
* **:**
* **:**
Messages count for log buffer allocation
### -lic
Set License key.
* **:**
License key string
### -oem
Use OEM key
* **:**
64 bit OEM key.
### -fingerprint
Read license fingerprint
* **:**
Fingerprint method
### -sp []
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.
* **:**
RAS server port
### -rec []
Packet capture file recording
* **:**
File name prefix
### -play
Packet capture file processing
* **:**
File name (\*.pcap|\*.pcapng)
### -genebi
Export ENI Builder config on demo stop
* **:**
File name (\*.xml)
### -mqtt
Publish process data to MQTT broker. EcMonitorDemoMqtt only
* **:**
MQTT broker address
### -mqttCycTime
Minimum time between cyclic messages for a variable. EcMonitorDemoMqtt only
* **:**
Time in milliseconds
### -mqttChgTime
Minimum time between change-detection based messages for a variable. EcMonitorDemoMqtt only
* **:**
Time in milliseconds
### -daqrec
* **:**
Configuration file
### Link Layer
Using one of the following demo application Link Layer options, the EC-Monitor will dynamically load the network driver for the specified network adapter card and use the appropriate network driver to access the Ethernet adapter for EtherCAT®.
`ShowSyntaxLinkLayer()` in [`Common/EcSelectLinkLayer.cpp`](_downloads/bf62c71a4a7e317930818b9da4a9815c/EcSelectLinkLayer.cpp) is called automatically if the Demo application is started without parameters and lists the possibilities.
#### NOTE
Not all link layers are available on all operating systems or architectures. A detailed view in the form of a matrix can be found in the [developer center](https://developer.acontis.com/).
### -intelgbe [--tts |--tmr] [--nophyctrlonconnect]
Hardware: Intel Pro/1000 network adapter card
: * **:**
Device instance 1 = first, 2 = second, …
* **:**
0 = Interrupt mode | 1 = Polling mode
Optional:
: * **--tts:**
Enable Real-time Ethernet Driver Time Triggered Send (TTS)
* **:**
TTS cyclic frame send offset from cycle start (usec)
* **or:**
* **--tmr:**
Enable Real-time Ethernet Driver Timer
Optional:
: * **--nophyctrlonconnect:**
Disable PHY control (e.g. PHY reset, PHY PM settings, Gbits Ctrl) on link connection detected
### -ndis [--name ] [--disablepromiscuousmode] [--disableforcebroadcast]
Hardware: Hardware independent, only available for Windows.
: * **:**
IP address of network adapter card, e.g. 192.168.157.2 or 0.0.0.0 if name given
* **:**
0 = Interrupt mode | 1 = Polling mode
Optional:
: * **--name:**
Select network adapter by name
* **:**
Service name from HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\NetworkCards
Optional:
: * **--disablepromiscuousmode:**
Disable promiscuous mode
Optional:
: * **--disableforcebroadcast:**
Disable force broadcast
### -remote [--mac ] [--rxbuffercnt ]
Hardware: Hardware independent. Tunnels EtherCAT frames through a TCP socket
> * **:**
> Device instance 1 = first, 2 = second, …
> * **:**
> 1 = Polling mode
> * **:**
> Source adapter IP address (listen)
> * **:**
> Source port number (listen)
> * **:**
> Destination adapter IP address (connect)
> * **:**
> Destination port number (connect)
Optional:
: * **--mac:**
MAC Address
* **:**
formatted as xx:xx:xx:xx:xx:xx or xx-xx-xx-xx-xx-xx
Optional:
: * **--rxbuffercnt:**
Frame buffer count for interrupt service thread (IST)
* **:**
Buffer count
### -snarf
Hardware: Hardware independent, only available for VxWorks
: * **:**
Adapter name, e.g. fei0
### -sockraw [] [--nommaprx] [--promiscuousmode]
Hardware: Hardware independent, only available for Linux.
: * **:**
Network adapter, e.g. eth1
Optional:
: * **:**
0 = Interrupt mode | 1 = Polling mode
Optional:
: * **--nommaprx:**
Disable PACKET_MMAP for receive
Optional:
: * **--promiscuousmode:**
Enable promiscuous mode
### -tap
OpenVPN’s Windows TAP
: * **:**
Device instance 1 = first, 2 = second, …
* **:**
0 = Interrupt mode | 1 = Polling mode
* **:**
Adapter name