PROFINET Device  v2.01.00

◆ PN_API_DEV_pullModule()

uint32_t PN_API_DEV_pullModule ( uint16_t  slotNumber_p)

Pull module.

If a module was plugged once, it can be pulled with this function. The module will be removed completely from the equipment together with all submodules, attached to the module. Memory, which was allocated to concerned module and submodules will be freed.

By removing every attached submodule, function will check if it 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
If the DAP module has been pulled, it is required to plug another DAP.

If one of the submodules was an I&M Device Representative, 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 equipment configuration of the device: that means after pulling / plugging of modules / submodules.
Parameters
[in]slotNumber_pNumber of the slot, where desired module is plugged.
Returns
PN_API_DEV_EError_t as uint32_t value.
Return values
PN_API_DEV_eOKModule was pulled successfuly.
PN_API_DEV_eERROR_PULL_MODULE_INVALID_SLOTInvalid slot number (either > PNC_SLOT_MAX, or the slot is empty).
Example
#include <PN_API_DEV.h>
//Pull submodule
//Pull another submodule
....
// Finish equipment configuration
PN_API_DEV_pullModule
uint32_t PN_API_DEV_pullModule(uint16_t slotNumber_p)
Pull module.
Definition: PN_API_main.c:1275
PN_API_DEV_applyEquipmentConfiguration
uint32_t PN_API_DEV_applyEquipmentConfiguration(void)
Apply equipment configuration.
Definition: PN_API_main.c:1067