Skip to content

Commit ed32774

Browse files
committed
readme update, PNS auto-IO length
1 parent cbefed4 commit ed32774

File tree

3 files changed

+30
-12
lines changed

3 files changed

+30
-12
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ RUN [ "cross-build-start" ]
66

77
#labeling
88
LABEL maintainer="[email protected]" \
9-
version="V0.9.2" \
9+
version="V0.9.3" \
1010
description="Debian(jessie) with netX real-time ethernet programming examples"
1111

1212
#version
13-
ENV HILSCHERNETPI_NETX_PROGRAMMING_EXAMPLES_VERSION 0.9.2
13+
ENV HILSCHERNETPI_NETX_PROGRAMMING_EXAMPLES_VERSION 0.9.3
1414

1515
#install ssh, gcc, create user "pi" and make him sudo
1616
RUN apt-get update \

README.md

+26-8
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Base of this image builds a tagged version of [debian:jessie](https://hub.docker
88

99
Additionally the image provides netX programming examples in source code (and as precompiled executables) for
1010

11-
* PROFINET IO device
11+
* PROFINET IO-device
1212
* EtherNet/IP adapter
1313
* EtherCAT slave
1414

@@ -89,9 +89,9 @@ To install a firmware package move to the folder `firmwares` and call
8989

9090
Any firmware package extracts its firmware into the folder `/opt/cifx/deviceconfig/FW/channel0`.
9191

92-
The firmware will be loaded by the driver into netX the first time the driver is accessed with `cifXDriverInit()` command.
92+
The firmware will be loaded by the driver into netX network controller the first time the driver is accessed using the `cifXDriverInit()` command.
9393

94-
There can be only one installed firmware package at a time. An existing package will be automatically uninstalled during installation.
94+
There can be only one installed netX firmware package at a time. An existing package will be automatically uninstalled during the installation procedure.
9595

9696
##### Compiling the programming examples
9797

@@ -109,6 +109,14 @@ You may be faced with the following warning during compilation process
109109

110110
There is a discrepancy between netPI's system clock and the time the executeables/object files have been generated. Call `make clean` and remove the executeable. Then start the compilation process again. Make also sure you have set netPI's system clock correctly.
111111

112+
##### Changing the default IO size of 10 bytes input and 4 bytes output
113+
114+
All three examples configure a process data input length of 10 bytes and an output length 4 bytes. The provided electronic data sheets for the master/controller engineering software match exactly to this example size.
115+
116+
If a different IO length is required you have to adjust the length in the file `/includes/App.h` in the structures APP_INPUT_DATA_T and APP_OUTPUT_DATA_T accordingly. Please take into account that there is a limit of maximum allowed IO length. This limit can be found in each of the three programming manuals provided in the folder ./manuals.
117+
118+
Afterwards recompile and start the new examples to become effective. Make sure you also modify the device description files and reload them into the master/contoller engineering software to sychronize the project with the new physical setup.
119+
112120
##### Starting the executables
113121

114122
To start the compiled examples call the following executeables in the pi home directory
@@ -117,25 +125,35 @@ To start the compiled examples call the following executeables in the pi home di
117125
* `sudo ./EIS_simpleConfig` for the EtherNet/IP adapter example
118126
* `sudo ./ECS_simpleConfig` for the EtherCAT slave example
119127

120-
The examples check if the corresponding firmware package has been installed properly, if not they install it automatically.
128+
Each example checks if its corresponding firmware package has been installed properly and loaded into netX, else it will install and load it automatically.
129+
130+
##### Electronic Data Sheets
131+
132+
Any master/controller engineering software needs device descriptions, socalled electronic data sheets, of all IO devices it shall communicate to. They inform about device parameters such as vendor-ID, product-ID, name, IO length etc. For all three examples the devices description files can be found in the github project under `/electronic-data-sheets`.
133+
134+
By default the provided files are preconfigured to an IO length of 10 bytes input and 4 bytes output. In case you modified an example to configure a different IO length you have to modify the electronic data sheet accordingly and reconfigure your master/controller with it.
135+
136+
##### Protocol specifics
137+
138+
In case of PROFINET please keep in mind that a virgin netX needs a PROFINET device name setup over the network as described [here](https://profinetuniversity.com/profinet-basics/dcp/profinet-dcp/). Use your master engineering software to assign a corresponding name ("netx51repns" which is default in the electronic data sheet).
121139

122140
##### Linking the cifX library to applications
123141

124142
To link the cifX driver library to own applications just add the option `-lcifx` to your GCC compilation command.
125143

126-
##### The cifX API reference (netX driver API)
144+
##### The cifX API funtions reference (netX driver API)
127145

128-
The cifX driver function API is described in the manual
146+
The cifX driver's function application interfaace (API) is described in the manual
129147

130148
`cifX_API_PR_04_EN.pdf`
131149

132-
located in the `manuals` folder.
150+
located in the `manuals` folder. These call functions provide you a simple interface between your application and netX network controller.
133151

134152
##### The protocol specific APIs (PROFINET, EtherNet/IP ... APIs)
135153

136154
A netX firmware has a common part that is behaving the same for all firmwares and a protocol dependent specific part. Particularly the configuration varies from protocol to protocol and shows different characteristics.
137155

138-
The protocol specific dependencies are described in these manuals
156+
The protocol specific dependencies are described in the manuals
139157

140158
* `PROFINET_IO-Device_V3.12_Protocol_API_17_EN.pdf` for PROFINET IO device
141159
* `EtherNetIP_Adapter_Protocol_API_19_EN.pdf` for EtherNet/IP adapter

examples/sources/PacketHandlerPNS.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ long SetConfigParams( void* pvPck, uint16_t usDeviceClass )
8282
ptSetConfig->ulWdgTime = 1000; /* Watchdog time (in milliseconds) */
8383
ptSetConfig->ulVendorId = 0x011E; /* Vendor ID */
8484
ptSetConfig->ulMaxAr = 0; /* Currently not used */
85-
ptSetConfig->ulCompleteInputSize = 10; /* Maximum amount of allowed input data */
86-
ptSetConfig->ulCompleteOutputSize = 10; /* Maximum amount of allowed output data */
85+
ptSetConfig->ulCompleteInputSize = sizeof(APP_INPUT_DATA_T); /* Maximum amount of allowed input data */
86+
ptSetConfig->ulCompleteOutputSize = sizeof(APP_OUTPUT_DATA_T); /* Maximum amount of allowed output data */
8787

8888

8989
if (usDeviceClass == RCX_HW_DEV_CLASS_CHIP_NETX_51)

0 commit comments

Comments
 (0)