Skip to end of banner
Go to start of banner

PNS DeviceName/IP Example

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

1. Example project

In this example the application shall handle Devicename and IP on 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 information remanent in a falsh.

Example Sourccode can be found is the Extended Config Example: netX 90 - PROFINET IO Device - extendedConfig V2.2.0.0

2. Configuration Packet

In the configuration packet it is necessary to change the ptSetConfig→ulSystemFlags. First step ist to disable the flag PNS_IF_SYSTEM_NAME_IP_HANDLING_BY_STACK_ENABLED.

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

The application reads from (application) flash the last remanent safed data.

ptSetConfig→abNameOfStation = value from Flash  (240 signs)

ptSetConfig->ulIpAddr = value from Flash  

ptSetConfig->ulGateway = value from Flash 

ptSetConfig→ulNetMask = value from Flash  

3. 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

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 check if the value in the appliaction flash is still the same like in the indication. If it is not the same value, write the new value in the application flash.

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




  • No labels