PROFINET Device  v1.04.03

◆ PN_API_DEV_registerModuleSubstitutes()

uint32_t PN_API_DEV_registerModuleSubstitutes ( PN_API_DEV_SModuleSubstitute_t pModuleSubstitutes_p,
uint8_t  numberElements_p,
PN_API_DEV_SModuleSubstituteEntry_t **  ppModuleSubstituteEntryAddress_p 
)

Register an array of module substitutes on stack.

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

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

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

Caution by reusing same handle pointer for different modules. If during configuration a module 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.

Parameters
[in]pModuleSubstitutes_pPointer to the array of module substitutes.
[in]numberElements_pNumber of elements in the array.
[in,out]ppModuleSubstituteEntryAddress_pHandle pointer to the stored substitute set.
Returns
PN_API_DEV_EError_t as uint32_t value.
Return values
PN_API_DEV_eOKModule substitutes were stored successfuly.
PN_API_DEV_eERROR_REG_MOD_SUBST_INVALID_POINTERInvalid input: NULL pointer to the array of substitutes.
PN_API_DEV_eERROR_REG_MOD_SUBST_INVALID_NUM_OF_ELEMSInvalid input: invalid number of elements in the array (should be > 0 and < PNC_MAX_MOD_SUBST_ENTRIES) .
PN_API_DEV_eERROR_REG_MOD_SUBST_NO_FREE_SPACENo free memory.