Versions Compared

Key

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

...

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

Image Added

5. Indication/PacketHandler

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

Image Added

Example for PNS_IF_PARAM_END_IND:

Image Added

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 no allways sizeof (data). Chack carfully the profinet documentation an sometime 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.

Image Added

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.

Image Added


6. Examples for indications