IO-Link Master  1.09.00
Device Communication

Set up IO Link Port

There are several ways to configure an IO-Link port. The simplest way is to use the AUTOCOM mode. In this mode the Master accepts all Devices and sets its internal parameters according to the Device's requirements. Start up in AUTOCOM mode is done as follows:

IOLM_SPortConfig suPortCfg;
// Prepare struct
IOL_Port_vMemSet(&suPortCfg, 0, sizeof(IOLM_SPortConfig));
// Set desired target mode
// Send the configured struct to the System Management layer

Another way is to set up a specific Device by Vendor and Device ID. During the startup procedure it is checked if the correct Device is connected or if the Device is compatible. If this check fails, it is indicated by the port mode IOL_ePortMode_COMP_FAULT

IOLM_SPortConfig suPortCfg;
// Prepare port configuration struct
IOL_Port_vMemSet(&suPortCfg, 0, sizeof(IOLM_SPortConfig));
// Set desired target mode and inspection level
// Set specific Vendor and Deviec ID
suPortCfg.au8ConfiguredVendorID[0] = 0x12;
suPortCfg.au8ConfiguredVendorID[1] = 0x34;
suPortCfg.au8ConfiguredDeviceID[0] = 0x12;
suPortCfg.au8ConfiguredDeviceID[1] = 0x34;
suPortCfg.au8ConfiguredDeviceID[2] = 0x54;
// Send the configured struct to the System Management layer

The most complex way is to check if the Serial Number is also correct. This is also the safest way to check, whether the connected Device is the exact one which is expected on the specific port. If the check fails, it is indicated by the port mode IOL_ePortMode_SERNUM_FAULT

IOLM_SPortConfig suPortCfg;
char au8Serial[] = "SER12345"
// Prepare port configuration struct
IOL_Port_vMemSet(&suPortCfg, 0, sizeof(IOLM_SPortConfig));
// Set desired target mode and inspection level
// Set specific Vendor and Deviec ID
suPortCfg.au8ConfiguredVendorID[0] = 0x12;
suPortCfg.au8ConfiguredVendorID[1] = 0x34;
suPortCfg.au8ConfiguredDeviceID[0] = 0x12;
suPortCfg.au8ConfiguredDeviceID[1] = 0x34;
suPortCfg.au8ConfiguredDeviceID[2] = 0x54;
// Set specific Serial Number
IOL_Port_vMemCpy(suPortCfg.au8ConfiguredSerialNumber, au8Serial, sizeof(au8Serial));
suPortCfg.u8ConfiguredSerialNumberLen = sizeof(au8Serial);
// Send the configured struct to the System Management layer

Stop Communication / Disable Port

The communication can be stopped by setting the port to the inactive state:

IOLM_SPortConfig suPortCfg;
// Prepare port configuration struct
IOL_Port_vMemSet(&suPortCfg, 0, sizeof(IOLM_SPortConfig));
// Set desired target mode
// Send the configured struct to the System Management layer

Standard Input and Output (SIO) Mode

The Port is set to SIO mode by the following command:

IOLM_SPortConfig suPortCfg;
INT8U u8State;
// Prepare port configuration struct
IOL_Port_vMemSet(&suPortCfg, 0, sizeof(IOLM_SPortConfig));
// Set desired target mode
suPortCfg.eTargetMode = IOL_eTargetMode_DI; // For intput mode (IOL_eTargetMode_DO for output mode)
// Send the configured struct to the System Management layer

Process Data

After each establishment of a communication relation, the Process Data is marked invalid. The application layer has to set the data valid again by IOLM_API_AL_eControlReq.

This can be done via the IOL_ePortMode_SM_OPERATE event in the function IOLM_Port_SM_vPortMode.

IOL_eInspectionLevel_IDENTICAL
@ IOL_eInspectionLevel_IDENTICAL
Check Vendor ID, Device ID and Serial Number.
Definition: IOLM_Types.h:527
IOLM_SPortConfig::au8ConfiguredSerialNumber
INT8U au8ConfiguredSerialNumber[16]
Configured Serial Number.
Definition: IOLM_Types.h:822
IOLM_API_SM_eSetPortConfig
IOL_FUNC_DECL IOL_EErrorInfo IOLM_API_SM_eSetPortConfig(INT8U u8Port_p, IOLM_SPortConfig *psuPortConfig_p)
Port setup.
Definition: IOLM_SM.c:413
IOL_eTargetMode_INACTIVE
@ IOL_eTargetMode_INACTIVE
Communication disabled, no DI, no DO.
Definition: IOL_Types.h:267
IOLM_SPortConfig
This structure is used for the desired port mode.
Definition: IOLM_Types.h:779
IOLM_SPortConfig::au8ConfiguredDeviceID
INT8U au8ConfiguredDeviceID[3]
Configured Device ID.
Definition: IOLM_Types.h:814
IOLM_SPortConfig::au8ConfiguredVendorID
INT8U au8ConfiguredVendorID[2]
Configured Vendor ID.
Definition: IOLM_Types.h:810
IOL_eTargetMode_CFGCOM
@ IOL_eTargetMode_CFGCOM
Device communicating in mode CFGCOM after successful inspection (FIXEDMODE).
Definition: IOL_Types.h:273
IOL_eTargetMode_DI
@ IOL_eTargetMode_DI
Port in digital input mode (SIO).
Definition: IOL_Types.h:269
IOL_eTargetMode_AUTOCOM
@ IOL_eTargetMode_AUTOCOM
Device communicating in mode AUTOCOM without inspection (SCANMODE).
Definition: IOL_Types.h:275
IOLM_SPortConfig::eTargetMode
IOL_ETargetMode eTargetMode
This parameter indicates the requested operational mode of the port.
Definition: IOLM_Types.h:790
IOLM_SPortConfig::u8ConfiguredSerialNumberLen
INT8U u8ConfiguredSerialNumberLen
Configured Serial Number length.
Definition: IOLM_Types.h:826
IOL_eInspectionLevel_TYPE_COMP
@ IOL_eInspectionLevel_TYPE_COMP
Check Vendor ID and Device ID.
Definition: IOLM_Types.h:525
IOLM_SPortConfig::eInspectionLevel
IOLM_EInspectionLevel eInspectionLevel
Device check during startup.
Definition: IOLM_Types.h:806
INT8U
uint8_t INT8U
8 bit unsigned integer
Definition: IOL_Port_Types.h:68