PROFINET Device4.2.0
 
Loading...
Searching...
No Matches

◆ PN_API_IOD_pullSubmod()

uint32_t PN_API_IOD_pullSubmod ( PN_API_IOD_Handle_t *const  pnHandle,
uint32_t  api,
PN_API_IOD_DevAddr_t addr 
)

Removes an installed submodule.

During operation, this function can be invoked to adjust the current configuration, particularly if there's a need to unplug a submodule from its subslot. In such instances, the Profinet stack automatically dispatches an alarm to the IO controller.

Warning
The submodule to be pulled needs to be plugged in first using one of the functions PN_API_IOD_startup(), PN_API_IOD_plugSubmod() or PN_API_IOD_plugSubmodList() .
Parameters
[in]pnHandleProfinet API Handle.
[in]apiApplication Process Identifier.
[in]addrGeographical address (slot/subslot) of the module/submodule.
Returns
result of the operation as uint32_t.
Return values
PN_API_OKSuccess.
PN_API_NOT_OKSomething went wrong.
PN_API_ERR_PARAMInvalid parameter.
Example
#include "pn_api_iod_device.h"
#include "pn_api_iod_startup.h"
PN_API_IOD_Handle_t* pnHandle = NULL;
uint32_t status;
pnHandle = PN_API_IOD_new();
//Prepare and call PN_API_IOD_startup()
...
uint32_t api = 0;
addr.address.geo.slot = 1;
addr.address.geo.subslot = 2;
status = PN_API_IOD_pullSubmod(pnHandle, api, &addr);
uint32_t PN_API_IOD_pullSubmod(PN_API_IOD_Handle_t *const pnHandle, uint32_t api, PN_API_IOD_DevAddr_t *addr)
Removes an installed submodule.
PN_API_IOD_Handle_t * PN_API_IOD_new(void)
Creates Profinet API handle.
@ PN_API_IOD_AddrGeo
Definition pn_api_iod_types.h:155
struct PN_API_IOD_Handle PN_API_IOD_Handle_t
API handle instance which holds IO device's info.
Definition pn_api_iod_types.h:61
union PN_API_IOD_DevAddr_t::@0 address
PN_API_IOD_AddrType_t type
Definition pn_api_iod_types.h:446
struct PN_API_IOD_DevAddr_t::@0::@1 geo
uint32_t subslot
Definition pn_api_iod_types.h:453
uint32_t slot
Definition pn_api_iod_types.h:452
Module/Submodule address (logical/geographical).
Definition pn_api_iod_types.h:445