# Software Integration ## EcSimulatorSilDemo The example application EcSimulatorSilDemo will handle the following tasks: - Stack initialization - Flash process data - Out of the box solution for different operating systems: - Windows - Linux - … - Example implementation for polled mode operation - Thread with periodic tasks and application thread already implemented - The output messages of the demo application will be printed on the console as well as in log files (\*.log). ### File reference The Demo application consists of the following files: | Filename | Description | |----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------| | [`EcDemoMain.cpp`](_downloads/fc875d17cbef52a4c4879f7ba411fe69/EcDemoMain.cpp) | Entry point for the different operating systems | | [`EcDemoPlatform.h`](_downloads/8a98bd88751f8738d3ec7f509d67f6e7/EcDemoPlatform.h) | Operating system specific settings (task priorities, timer settings) | | [`EcDemoApp.cpp`](_downloads/1b493580b5e382117af85dfa03e1a0fd/EcDemoApp.cpp) | Initialize, start and terminate the MainDevice and EC-Simulator stack | | [`EcDemoApp.h`](_downloads/08195a8ed05fd6fff530d112008cd7f3/EcDemoApp.h) | Application specific settings for EcSimulatorSilDemo | | [`EcDemoParms.cpp`](_downloads/cc5a320ac29f8e16f99cb4d2be8320fa/EcDemoParms.cpp) | Parsing of command line parameters and generic helper functions | | [`EcDemoParms.h`](_downloads/7da4d0b851574416d0292c150711af29/EcDemoParms.h) | Basic configuration parameters | | [`EcSelectLinkLayer.cpp`](_downloads/bf62c71a4a7e317930818b9da4a9815c/EcSelectLinkLayer.cpp) | Common functions which abstract the command line parsing into Real-time Ethernet Driver parameter | | [`EcNotification.cpp`](_downloads/a8230e7ca1c52aaedb62898da301f674/EcNotification.cpp) | SubDevice monitoring and error detection (function `NotifyWrapper()` ) | | [`EcSlaveInfo.cpp`](_downloads/1717ceec03b28a568975a261bbaff164/EcSlaveInfo.cpp) | SubDevice information services | | [`EcLogging.cpp`](_downloads/688adc0df0fa9d756770fefe6720978f/EcLogging.cpp) | Message logging functions | | [`EcTimer.cpp`](_downloads/f9c3bd98e3ff32524fc04ff3bde41b53/EcTimer.cpp) | Start and monitor timeouts | | [`EcDemoTimingTask.cpp`](_downloads/bec5300f8660116569772b28390fa6d1/EcDemoTimingTask.cpp) | Operating system independent default timing task implementation (base class) | | [`EcLogging.cpp`](_downloads/688adc0df0fa9d756770fefe6720978f/EcLogging.cpp) | Message logging functions | | `EcSdoServices.cpp` | CoE object dictionary example | | [`EcTimer.cpp`](_downloads/f9c3bd98e3ff32524fc04ff3bde41b53/EcTimer.cpp) | Start and monitor timeouts | ### Logging The example program demonstrates how messages can be processed by the application, see `Examples/Common/EcLogging.cpp`. The messages handled by `EcLogging.cpp` are of different type, e.g. MainDevice and EC-Simulator stack Log Messages and Application Messages are logged to console and/or to files. The verbosity of the demo given as console parameter “-v” is used to determine the log level of the application, see “set application log level” in `EcDemoMain.cpp`. Logging is configured on MainDevice stack initialization. The MainDevice and EC-Simulator stack automatically filters log messages according to the log level. Log messages which are less relevant according to their severity (see EC_LOG_LEVEL…) are filtered out. CAtEmLogging has various parameters beside the log level, like Roll Over setting, log task prio and affinity, log buffer size, etc. See InitLogging in `EcLogging.h`, `EcDemoMain.cpp` for reference. The application can override CAtEmLogging::PrintConsole / CAtEmLogging::PrintMsg if the default handler in `EcLogging.cpp` does not fulfill the application’s needs. #### IMPORTANT The callback is typically called from the Job Task’s context and should return as fast as possible. #### IMPORTANT Logging to files is disabled by default for some OS, because e.g. a file system must be added explicitly. Setting bLogFileEnb to 1 is needed for some operating systems to enable file logging. Identical messages are skipped automatically by default.