IO-Link Master  1.09.00
SMI

The Standardized Master Interface (SMI) is a generic interface which is set on top of the regular API of the stack. It matches the interface with other IO-Link standards and acts as a connecting interface for multiple clients. It also includes the configuration management and event dispatching.

Architecture

Most services have ArgBlocks as their parameters. These ArgBlocks are made up of an identifier and contain with different content, depending on its type. The supported ArgBlocks are listed in a following chapter (see IOLM_SMI_EArgBlockID). If no ArgBlock is used "NULL" is passed instead of the ArgBlock parameter, e.g. for a request. Most SMI services are acknowledged by a separate confirmation. They are executed in the Mainloop. Some simple services are also available with direct confirmation. The normal API should not be used if the SMI is enabled.

Initialization and Run

The following code snippet shows how to initialize the SMI interface.

// Setup the desired callbacks
IOLM_SMI_SCallbacks suSMICallbacks_g =
{
.cbGenericCnf = IOLM_SMI_vGenericCnf,
.cbMemFree = IOLM_SMI_vMemFree,
.cbMemAlloc = LOLM_SMI_pu8ArgBlockAlloc,
.cbLoadNvCfg = IOLM_SMI_LoadNVCfg,
.cbDeviceEventInd = IOLM_SMI_DeviceEventInd,
.cbPortEventInd = IOLM_SMI_PortEventInd,
.cbDeviceWriteCnf = IOLM_SMI_DeviceWriteCnf,
.cbDeviceReadCnf = IOLM_SMI_DeviceReadCnf,
};
// Initialize stack and SMI (suSMICallbacks_g has to be global)
IOLM_SMI_vInit(&suSMICallbacks_g);
// Application Mainloop
while (1)
{
IOLM_SMI_vRun(); // SMI Mainloop (at least once per ms)
User_Application(); // ToDo: Insert application specific code here
}

It is only required to provide the desired callbacks. There is a generic API for all services, or an API for each single service.

Services

Callbacks

ArgBlocks

The ArgBlock IDs are listed in IOLM_SMI_EArgBlockID. The following structures are available

Direct Services

IOLM_SMI_SCallbacks::cbGenericCnf
IOLM_SMI_CBGenericCnf cbGenericCnf
Callback for IOLM_SMI_vGenericReq.
Definition: IOLM_SMI.h:2302
IOLM_SMI_SCallbacks
SMI Callbacks. Must be initialized via IOLM_SMI_vInit.
Definition: IOLM_SMI.h:2300
IOLM_SMI_vRun
void IOLM_SMI_vRun(void)
SMI Mainloop.
Definition: IOLM_SMI.c:2483
IOLM_SMI_vInit
void IOLM_SMI_vInit(IOLM_SMI_SCallbacks *psuCallbacks_p)
Initialize SMI interface.
Definition: IOLM_SMI.c:290