This section provides an overview of all interface functions that can be used with the SMI disabled. The great advantage of SMI is that most of the API functionality is handled by the SMI and doesn't have to be set manually. To deactivate the SMI, the IOLM_SMI_ENABLED definition must be set to 0. For more details, see the corresponding function descriptions and the following sections.
The stack needs to be initialized once during startup with the following function:
To proceed the internal state machines and send notifications to the application layer, the main run function must be called periodically. This must be done at least once during an IO-Link cycle.
The following functions are used for timing:
For details see Timer System.
The following functions are used to access the physical layer:
For details see Physical Layer.
The configuration of device specific stack values (like IOLM_PORT_COUNT for the number of available ports on the Master, IOLM_SMI_ENABLED, etc.) needs to be set in IO-Link Port Definitions and in IO-Link Master Port Definitions.
The System Management is used to configure the port modes and indicate their current state.
The following functions are used to access the process image:
If the Port is in a SIO Mode, the process image length is 1 byte and used as boolean for the state of the pin.
The following function indicates that there is new input process image available:
The following function indicate the end of a Process Data cycle:
The following functions are used to set/indicate the status of the Process Data:
The ISDU/Parameter API is used to access parameters of a device. Requests are sent with the Req functions. If the request is finished (which takes multiple IO-Link cycles), the corresponding Cnf function is called with the result. If a device needs too much time to respond, the request can be aborted. There is also a auto timeout of IOL_ISDU_TIMEOUT_MS milliseconds.
Events are indicated by the following function:
Events must always be acknowledged. The application will receive no further device Event until the last one is acknowledged by the following function.
The following functions are used to access the Data Storage:
For a detailed description see Data Storage.
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.
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.
The following code snippet shows how to initialize the SMI interface.
It is only required to provide the desired callbacks. There is a generic API for all services, or an API for each single service.
The ArgBlock IDs are listed in IOLM_SMI_EArgBlockID. The following structures are available