Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Panel | ||||
---|---|---|---|---|
| ||||
How to understand the structure of Hilschers host application examples? |
Panel | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OverviewHilscher offers a number of example applications, published in the Knowledge Base → LFW Host Examples The examples are implemented in ANSI C. Each example represents the implementation of a network (slave) device which produces and consumes IO-data. All examples are very similar and represent the same device from the application point of view. In order to support and demonstrate different protocols and different host architectures, the example applications are structured in a modular way. There The projects are separated into 3 parts
Each part is modular and independent of any other areapart. E.g.the same application source code can be combined with any protocol specifc code and with any hardware specific code.
In the table above, 4 differnet example applications are listed. All applications use the same application source code (Application Module 1) and the same hardware specific source code (netX 90 APP). Only the protocol specific parts are different in each example. In order to support an additional host architecture, like STM32 MCUs or a Windows PC, only the
Once you are familiar with the project structure of one single example, it is easy to migrate to a different protocol or to a different hardware platform, since most software components are the same. Block DiagramMapping to Project ComponentsImage Added Application Part -
The application part, more concrete the function The application part is based on the cifX API (by using the cifX Toolkit or a driver from Hilscher, like the cifX Windows or Linux Driver) and a simple hardware abstraction layer, thus independent of any hardware. I.e. the same application parts can be used with any hardware platform like netX 90 APP, STM32 MCU, Windows PC, Linux, etc.. The effort for migration to a custom hardware platform, not supported by Hilscher yet, is not high. Only the
Furthermore it contains only generic application parts without any protocol specific code. I.e. the same application parts can be used for any protocol example like PROFINET, EtherCAT, EthernetIP, PROFIBUS, etc. The application example projects, provided by Hilscher, do not use an operating system. Though it is feasible to port the application example to a system including an RTOS using several OS tasks. The
The component provides basic, generic mailbox packet service routines to send and receive mailbox packets. The body of the application has two main parts: 1) The main loop (while 1 loop) for "slow" less prior tasks like DPM mailbox packet handling, and 2) a cyclic timer interrupt service routine for "fast", higher prior IO data handling → Before entering the main loop and cyclic handling of the timer ISR, several configuration steps are executed: Opening the DPM channels ( The modeled IO device features 2 sensors (producing output data) and 2 actuators (consuming input data). Beside the actual sensor/actuator data, the IO data image contains state and mode information as well as a counter. The example applications do not fully implement the device functionality. I.e. the actual sensor/actuator data is not important and usually just dummy data. Depending on the available resources of the hardware platform, the data (or parts of it) might be output to LEDs, inputs might be DIP-switches or the netX 90 build in tempertaure sensor, etc. The data is provided/consumed by the hardware abstarction layer functions (HOSTAL - host abstraction layer) List of C-filesGeneric Application (cifX API based)
IO-Data
Protocol Part -
The protocol part is based on the cifX API (by using the cifX Toolkit or a driver from Hilscher, like the cifX Windows or Linux Driver) and a simple hardware abstraction layer, thus independent of any hardware. I.e. the same protocol component can be used with any hardware platform like netX 90 APP, STM32 MCU, Windows PC, Linux, etc.. The effort for migration to a custom hardware platform, not supported by Hilscher yet, is not high. Only the
In contrast to the generic
The
The component provides 3 main functions, which are called from the
1) is called only once during the initialization phase, 2) is called cyclically from the main loop in order to check and handle incoming mailbox packets. 3) may be used to demonstrate the implementation of protocol specific asyclic communication, like diagnosis or alarms, etc.. 3) is not implemented and just an empty function in most examples Hilscher LFWs might feature several DPM communication channels with different functionality (refer to article Firmware Variants). Each channel might be handled by an independent
List of C-filesProtocol dependent part of the application (cifX API based)
XXX= PNS, EIS, ECS, PLS, etc. Hardware Dependent Part -
The hardware dependent parts might differ significantly between each host hardware platform. An embedded Cortex-M based host controller must be setup differently than a Linux or Windows based PC Host device. The
During execution of 1, startup code (typically assembler code in embedded systems) for interrupt setup etc. is executed, the cifX Driver or cifX Toolkit is initialized, communication interfaces (like UART or SPI) are initialized and the application demo is started by call of function 2), the cifX API is base for the
Note: The example projects, provided by Hilscher, do not contain full cifXToolkit adaptions (adaption of OS_Custom.c ) which meet requirements for all use cases. It is always necessary and in the responsibility of the user, to adapt and test the cifXToolkit customization, according to the requirements. Particularly when an RTOS is used, the cifX Toolkit must be adapted respectively. Also usage of interrupt mode requires adaption to cifXToolkit customization functions.3) The host hardware abstraction layer mainly provides functions for data consumption and production, depending on the available hardware. In general the actual generated data is not relevant, dummy data is sufficient. Furthermore the HOSTAL is responsible to provide a service for cyclic function calls (e.g. by using a timer interrupt) for call of List of C-filesHardware (target) dependent components of the application
Overview HOSTAL functions:
|
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
The offered example applications are provided "as is" for demonstration purposes only. In particular the code is not fully tested, as required for mass production purposes. It is the responsibility of the user to adapt the code to the custom requirements and test it thoroughly! Please note the disclaimer below and the disclaimer delivered with each software example. |
Panel | ||
---|---|---|
| ||
IMPORTANT! Please read this carefully before you install the software! Copyright (c) Hilscher Gesellschaft fuer Systemautomation mbH. All Rights Reserved. Exclusion of Liability for this demo software The following software is intended for and must only be used for reference and in an evaluation laboratory environment. It is provided without charge and is subject to alterations. Hilscher cannot guarantee uninterrupted use thereof, or that the Software is free of errors and defects. The Software was produced and tested by Hilscher with only evaluation laboratory environment. Hilscher cannot make any warranty that the Software is functional or free of errors when the Software is used by the user. It is the user's obligation to fully test the software in its environment and to ensure proper functionality, qualification and compliance with component specifications. 1. Disclaimer of Warranty There is no warranty for the software, to the extent permitted by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide the software "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the software is with you. Should the software prove defective, you assume the cost of all necessary servicing, repair or correction. 2. Limitation of Liability In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who modifies and/or conveys the software as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the software (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the software to operate with any other softwares), even if such holder or other party has been advised of the possibility of such damages. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Software. By installing or otherwise using the software, you accept the terms of this Agreement. If you do not agree to the terms of this Agreement, then do not install or use the Software! |