PROFINET Device  v1.04.03

◆ PN_API_DEV_pullSubmodule()

uint32_t PN_API_DEV_pullSubmodule ( uint16_t  slotNumber_p,
uint16_t  subslotNumber_p 
)

Pull submodule.

If a submodule was plugged once, it can be pulled with this function. The submodule will be removed completely from the stack. Memory, which was allocated to this submodule, will be freed.

The function will also check, if the pulled submodule is an I&M Carrier and it's I&M Data Set is stored on stack. If so - I&M Data Set will be deleted and memory allocated to it will be freed.

Remarks
Every module must contain at least one submodule. If the last submodule of the module was pulled, it is mandatory to:
  • either to plug at least one new submodule and attach it to the module
  • or pull the module as well.

Every device must have an I&M Device representative. If I&M Device Representative was pulled, it is required to plug another I&M Device Representative.

Warning
It is required to invoke PN_API_DEV_APP_applyEquipmentConfiguration() function to finalize new configuration of the device: that means after finishing pulling / plugging of modules / submodules.
Parameters
[in]slotNumber_pNumber of the slot, where desired submodule is plugged.
[in]subslotNumber_pNumber of the subslot, where desired submodule is plugged.
Returns
PN_API_DEV_EError_t as uint32_t value.
Example
#include <PN_API_DEV.h>
//Pull submodule
//Pull another submodule
....
// Finish equipment configuration
PN_API_DEV_pullSubmodule
uint32_t PN_API_DEV_pullSubmodule(uint16_t slotNumber_p, uint16_t subslotNumber_p)
Pull submodule.
Definition: PN_API_main.c:1333
PN_API_DEV_applyEquipmentConfiguration
uint32_t PN_API_DEV_applyEquipmentConfiguration(void)
Apply equipment configuration.
Definition: PN_API_main.c:1062