Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1. Example project

In this example, the application shall handle Devicename Device name and IP on the application side. For that, it is necessary to change the configuration packet, to implement the "save station name indication,the save ip adress inddication and the reset to factory indication. For that the application need a posibilty to "Save Station Name indication", "Save IP Address indication" and "Reset to Factory indication". For this, the application needs a possibility to save information remanent in a falshflash.


Example Sourccode The extendedConfig example can be found is the Extended Config Example: netX 90 - PROFINET IO Device - extendedConfig V2.2in the Knowledge Base on the following website:

netX 90: https://hilscher.atlassian.net/wiki/display/NXLFWHST/netX+90+-+PROFINET+IO+Device+-+Examples (from V3.0.0.0)


Image Modified


This can alternatively be found under:

kb.hilscher.com → Software → LFW Host Examples → Profinet IO-Device → netX 90 APP / netX 51 → PROFINET IO Device - extendedConfig Vx.x.x.x

The extendedConfig project can be opened by double-clicking the ".solproject" file. This requires the latest version of netXStudio (https://hilscher.atlassian.net/wiki/display/NDT/).


2. PROFINET Sources

A GSDML file is required for this example. The GSDML file can be found in the netXStudio project in Project Explorer at:

netXxx_PNSVx_extendedConfig → Components → cifXApplicationDemoPNS → DeviceDescription → GSDML-V2.3x-HILSCHER-NETX xx-RE PNS-20xxxxxx.xml


The PacketHandler describes the acyclic packages and can be found in the Project Explorer under:

netXxx_PNSVx_extendedConfig → Components → cifXApplicationDemoPNS → Sources → AppPNS_DemoApplicationFunctions.c


The IO Data Handler describes the IO data that is exchanged between the application and the stack and can be found in the Project Explorer under:

    long SetModulConfig( void* pvPck)


The terminal handler uses the interface used by UART to display debug messages and is located in Project Explorer under:

netXxx_PNSVx_extendedConfig → Components → cifXApplicationDemo → Sources → App_TerminalHandler.c


The event handler shows the diagnoses and alarms, which can be found in the Project Explorer under:

netXxx_PNSVx_extendedConfig → Components → cifXApplicationDemo → Sources → App_EventHandler.c


3. Configuration Packet

In the configuration packet, it is necessary to change the ptSetConfig→ulSystemFlags ptSetConfig → ulSystemFlags.

First step ist is to disable the flag PNS_IF_SYSTEM_NAME_IP_HANDLING_BY_STACK_ENABLED.


Image Modified


The next step is the use of devicename device name and ip IP address parameter in the configuration packet.

The application reads the last remanent saved data from the (application) flash the last remanent safed data.ptSetConfig→abNameOfStation

ptSetConfig → abNameOfStation = value from

...

flash (240 signs)

ptSetConfig

...

→ ulIpAddr                = value from

...

flash  

ptSetConfig

...

→ ulGateway            = value from

...

flash 

...

ptSetConfig → ulNetMask            = value from

...

flash  

...


4. Indications

Implement in the packet handler the Indications for

  • PNS_IF_SAVE_STATION_NAME_IND
  • PNS_IF_SAVE_IP_ADDR_IND
  • PNS_IF_RESET_FACTORY_SETTINGS_IND


Use for example the Ethernet Device Configuration Tool to change the device name or IP address over the network with the DCP protocol.

Image Added

This requires the latest version of the Ethernet Device Configuration Tool (https://hilscher.atlassian.net/wiki/display/ETHDEVCFG/).


The stack forwards this change to the application as an indication. The application now needs to handle the indication.

Check in the indication, if the value shall be saved remanent in the application flash.

      if(ptSaveStationNameInd -

...

> tData.bRemanent == 1)

...

      if(ptSaveIpInd          -> tData.bRemanent == 1)

If the bRemanent value is 1, the application shoud shall check if the value in the appliaction application flash is still the same like as in the indication. If it is not the same value, write the new value in into the application flash.

If the bRemanent value is 0, than you your application need needs to save the value temporary. That meens, means the saved value in the application flash need needs to be deleted.