Skip to end of banner
Go to start of banner

PNS ExtendedConfig 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 9 Next »

1. Example project

In this example the application activate the Profinet indications. For that the application need to call the request "Register Application".

An Example Sourcecode can be found in the Extended Config Example: netX 90 - PROFINET IO Device - extendedConfig V2.2.0.0

2. Configuration Packet

Nothing needs to be done in the configuration packet.

3. Register Application Request

If this Register Application Request activates all Profinet indications. Indications are messages from the stack and the application needs to create a response to the stack.

The application has often only 3 second to create the response. If the application does not response, the stack will send an error indication.

4. Start Sequenz

The Register Application Request shall be called before Set Configuration Request. The application will get the first indication after channel init.

This is the Link changed indication (HIL_LINK_STATUS_CHANGE_IND).

5. Indication/PacketHandler

The PacketHanlder needs to read the mailbox and check it for new packets (for example indications). If a new packet is available the application shall check the command in the header of the pcket and implement a switch case. ALL profinet indication like here the PNS_IF_PARAM_END_IND shall be implemented in the switch case:

Example for PNS_IF_PARAM_END_IND:

Very important is here, that the application use the indication packet to create the response packet. The only change is done in the values

Command, Length, State and Data. The rest of the values coming from the indication packet.

Take care, that the length value for the response is not allways sizeof(data). Check carefully the profinet documentation an sometimes the length value is

X + sizeof(data).

5. Indication/PacketHandler Profinet default

Often a application does not want to handle all Profinet indications. Only a set of a few indications want to be used by the application, But the application needs to implement all

Profinet indications. In this case the application can return ERR_HIL_NO_APPLICATION_REGISTERED = 0xC0000202

That means, that the stack will handle the indication like if the application is not registered for this indication.

5. Indication/PacketHandler switch case default

The default of the switch case is very important. If not all indications are implemented in the application, the default will create a default response to the sack.

For profinet indications this default answer can we wrong, but it is better as no response.

6. When does the application need to implemet an indication

There is no general answer, because this need to be checked for every application. Many indications can be seen as informations for the application and only a response is necessary.

But some indications need deeper implentation. For example if the application change the stack behavior with  ptSetConfig→ulSystemFlags, than it make is necessay to implement indications.

One example for that is the PNS DeviceName/IP Example.

A other example is the PNS Signal LED Example. If the device developer forgets to bring the signal LED on the case of the device or he want to use an other LED as Signal LED, is possible

to use the signal indication.




  • No labels