PROFINET Device  v1.04.03

◆ PN_API_DEV_registerSubmoduleSubstitutes()

uint32_t PN_API_DEV_registerSubmoduleSubstitutes ( PN_API_DEV_SSubmoduleSubstitute_t pSubmoduleSubstitutes_p,
uint8_t  numberElements_p,
PN_API_DEV_SSubmoduleSubstituteEntry_t **  ppSubmoduleSubstituteEntryAddress_p 
)

Register an array of submodule substitutes on stack.

Stack offers a possibility to store limited number of submodule substitutes. The substitutes will be stored as a set and can be assigned to submodules.

Application must create an array of module substitutes and pass them to the stack. If input parameters are correct and there is free memory, stack will store the input array in form of linked list chain. Stack will return a pointer to the stored substitute set. Application can use this pointer to assign a group of substitutes to one ore more submodules.

Remarks
A set of substitutes must be created prior plugging desired submodule as substitutes can be assigned to a submodule only during plugging.

Caution by reusing same handle pointer for different submodules. If during configuration a submodule was plugged and then pulled, stack will check, if attached substitute set is not used elsewhere. If not - stack will remove the set from stack and handle to the concerned substitute set (if stored) will become invalid.

By pulling a whole module, concerned submodules will be affected as well.

Parameters
[in]pSubmoduleSubstitutes_pPointer to the array of submodule substitutes.
[in]numberElements_pNumber of elements in the array.
[in,out]ppSubmoduleSubstituteEntryAddress_pHandle pointer to the stored substitute set.
Returns
PN_API_DEV_EError_t as uint32_t value.
Return values
PN_API_DEV_eOKSubmodule substitutes were stored successfuly.
PN_API_DEV_eERROR_REG_SUBMOD_SUBST_INVALID_POINTERInvalid input: NULL pointer to the array of substitutes.
PN_API_DEV_eERROR_REG_SUBMOD_SUBST_INVALID_NUM_OF_ELEMSInvalid input: invalid number of elements in the array (should be > 0 and < PNC_MAX_SUBMOD_SUBST_ENTRIES) .
PN_API_DEV_eERROR_REG_SUBMOD_SUBST_NO_FREE_SPACENo free memory.