This guide is an introduction to the programming of Hilscher netX based device
It should help to choose the level where to start with developments and describes where to find the necessary information.
Fundamentals - DPM Layout and Content
The fundamental of the netX hardware is the so call dual-ported memory (DPM) of netX based hardware. Hilscher has defined a memory structure (netX DPM Interface structure) and corresponding definitions suitable for the handling of communication devices, offering all information needed by applications to manage the hardware and the underlying Hilscher communication firmware.
It covers also system state information, the functionalities to exchange data with netX based hardware and to synchronize data access between a host and the asynchronous working netX firmware.
All Hilscher netX based devices processing a Hilscher standard firmware, performing in the same way.
The DPM Layout
The DPM structure is a representation of the hardware functions and places the functions and corresponding information into separate, independent, areas.
- Maximum DPM size = 64Kbyte
- COMX modules can have a different size (e.g. 8 KByte)
Choose a Programming Level
Hilscher offers support to different programming levels.
Programming levels are starting at the plain dual-ported memory until up to the device driver level for the most common operating systems.
Hardware Level
The hardware level is the direct access to the physical DPM of a netX device.
Programming is supported by offering C header files describing the DPM structures, content, states, flags, bit masks etc.
Usage: One or more netX Chip(s) or COMX modules connected to microcontrollers
- Very limited system resources
- Highly optimized hardware access
- Dedicated function to access the hardware
- None C based development environment
Manuals: netX Dual-Port Memory Interface DPM xx EN.pdf
(Dual Port Memory layout, structures and functionalities)
CD / DVD: NXDRV-TKIT or Communication Solution DVD
Header Files: rcX_User.h Dual Port Memory structures
rcX_Public.h Asynchronous packet definitions
Low Level
Access to the DPM via pre-created hardware functions which are part of the "cifX netX Toolkit" (see "Toolkit Low-Level Hardware Access Functions").
Usage: One or more netX Chip(s), COMX modules or CIFX cards connected to microcontrollers
- DPM or ISA connection to the netX hardware
- with or without an operating system
- limited system resources (RAM/FLASH)
Programming Resources:
Manuals: netX Dual-Port Memory Interface DPM xx EN.pdf
(Dual Port Memory layout, structures and functionalities)
CIFX netX Toolkit DPM TK xx EN.pdf
CD /DVD NXDRV-TKIT or Communication Solution DVD
Source Files: Toolkit .\Examples\cifXTKitHWFunctions directory
cifXUser.h
cifXErrors.h
netX_RegDefs.h
cifXHWFunctions.h.c / cifXHWFunctions.h
cifXEndianess.c / cifXEndianess.h
cifXInterrupt.c / cifXInterrupt.h
Intermediate Level
Using the "cifX netX Toolkit" and CIFX API functions offered by the toolkit. Porting the toolkit to own hardware platforms or write own device drivers.
Usage: One or more netX chip(s), COMX modules, CIFX cards connected to a host PC system
- Support for standard Hilscher devices (complete function support)
- C / C++ development environment
- With or without an operating system
- Writing own drivers
Programming Resources:
Manuals: CIFX netX Toolkit DPM TK xx EN.pdf
CIFX API PR xx EN.pdf
CD /DVD NXDRV-TKIT or Communication Solution DVD
Source Files: Toolkit .\cifXToolkit directory
Driver Level
Using the CIFX API offered by a operating system drivers created by Hilscher to write own user applications on top of a Hilscher netX based communication device.
Usage: Host PC system with an operating system or real time extension supported by Hilscher
- COMX modules, CIFX cards connected to a host PC
- ISA / PC104 / PCI or PCIexpress bus system
- Support for standard Hilscher devices (complete function support)
- Creation own high level user applications
Programming Resources:
Manuals: CIFX API PR xx EN.pdf
CD /DVD NXDRV-xxx or Communication Solution DVD
Source Files: Comming with the driver
cifXUser.h
cifXErrors.h
Development Environment
The following picture gives an overview of the possible development environments and the migration to embedded systems.
This should help to choose a programming level fit best to the application needs.
Additional Resources
Programming Interface - CIFX-API
The CIFX API is the general application programming interface (API) which offers all necessary function to handle a netX device.
The API offers general handling functions and functions corresponding to the DPM components described above.
Example API functions:
Asynchronous Services (Packets) | |
---|---|
API Function | Description |
xChannelGetMBXState | Retrieve the channels mailbox state |
xChannelGetPacket | Read a packet from the channel receive mailbox |
xChannelPutPacket | Send a packet via the channel send mailbox |
........... |
Cyclic Data Services (I/O's) | |
---|---|
API Function | Description |
xChannelIORead | Instructs the device to place the latest data into the DPM input data area and passes them to the user |
xChannelIOWrite | Copies the data to the DPM send data area and waits for the firmware to retrieve them |
.......... |
The complete API is described can be found in the "cifX API PR xx EN.pdf" manual.
Protocol Stack handling via CIFX API
An overview of the minimal necessary API functions and the order how they should be called can be found in the CIFX-API manual Chapter 5 and 6.
Protocol API Manuals
Each fieldbus protocol stack has it own documentation, describing the protocol specific functions and commands.
Protocol API manuals can be found on the "Communication Solution DVD" in the .\Documentation\Programming Manuals\ directory and
the manual file names are containing the protocol stack name, e.g. "PROFIBUS Master Protocol API....pdf"