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
Process Data acquisition with EC-DAQ
Periodic diagnosis task
Periodic Job Task in polling mode
Application framework and example application for detailed explanation
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 192.168.157.2 1 -f MasterENI.xml -t 0 -v 3
Operating Systems (OS) for OS specific additional instructions to run the demo application
- 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:
- -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.
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.
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
/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
The header files are located in the following directories:
<InstallPath>/SDK/INC/<OS>/<ARCH> <InstallPath>/SDK/INC <InstallPath>/Sources/Common
The libraries that need to be added are in the following directories:
The following preprocessor directives must be set in the build environment or project:
Exclude the EC-DAQ support in the demo: