This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM2432: Profinet SubstituteValue

Part Number: AM2432

Tool/software:

Hi,

I am using AM2432 with Profinet from the Industrial SDK 09.02.00.24.

I saw that there is the callback type PN_API_IOD_outSubmodSubstValReadCbf that should be used when an acyclic read request with index 0x8029 is made.

However, in the demo I saw that the replacement mode is written hard coded (so the choice of whether to use PN_API_IOD_SUBST_ZERO or PN_API_IOD_SUBST_REPLACEMENT).

Is there any way to have the choice specified during the first Profinet connection by the master? I don't understand how I should choose one or the other mode and if I have to find another way to have the end user specify the choice.

Thank you,

Kind Regads,

Andrea

  • Hi, are there any updates?

    Thank you,

    Best regards,

    Andrea

  • Hi Andrea,

    I'm not sure I get your question clearly.

    In our prebuilt library PN_API_IOD_INCLUDE_REC8028_8029 is set to 1 which indicates that the handling of 0x8028 and 0x8029 records is delegated to the stack.

    While the stack handles 0x8029 record, it can use PN_API_IOD_outSubmodSubstValReadCbf() to obtain substitute values from the application.

    The application implements PN_APP_IOD_cbOutSubmodSubstValRead() to provide the stack with substitute values of choice. The mode can be set based on the type of data provided: zero, last value received, or a replacement value chosen by the user.

    Kind regards,
    Kamil

  • Hi Kamil,

    thank you for your response.

    I now have a good understanding of how it works.
    What I don't understand is how do I choose in my callback to write PN_API_IOD_SUBST_ZERO mode or PN_API_IOD_SUBST_REPLACEMENT mode in the code? Is that a choice that I make as the developer or is there a way for the end user to choose the mode?

    My doubt arose because I saw in one of our old Profinet projects in the GSDML that it supported multiple modes (so SupportedSubstitutionModes="0 1 2"). It is clear to me from the demo when to use PN_API_IOD_SUBST_LAST_OUT (so mode 0), but I don't understand if I can support both mode 1 and 2 and if Profinet provides a way to specify it during the communication.

    The solution I have now adopted is to declare in the GSDML only two modes (so SupportedSubstitutionModes="0 1") and write in the code the two modes PN_API_IOD_SUBST_LAST_OUT and PN_API_IOD_SUBST_ZERO, but I don't want to have missed something to understand.

    Thank you,

    Best regards,

    Andrea

  • Hi Andrea,

    Our Profinet stack supports multiple modes: 0 (ZERO), 1 (Last value) and 2 (Replacement value). The choice of which mode to use and which substitute value to provide in response to 0x8029 record is completely up to the application running on the IO device. I.e. the PLC does not configure this parameter during connection startup, rather the application developer (or end user) can decide that within the implementation of PN_APP_IOD_cbOutSubmodSubstValRead() function.

    Thanks.
    Kind regards,
    Kamil