IO-Link Master  1.03.03
Process Data

Overview

Process Data API.

Functions

IOL_FUNC_DECL IOL_EErrorInfo IOLM_API_AL_eGetInput (INT8U u8Port_p, INT8U **ppu8Data_p, INT8U *pu8Length_p)
 Read input data. More...
 
IOL_FUNC_DECL IOL_EErrorInfo IOLM_API_AL_eSetOutput (INT8U u8Port_p, INT8U *pu8Data_p, INT8U u8Length_p)
 Write output data. More...
 
IOL_FUNC_DECL IOL_EErrorInfo IOLM_API_AL_eControlReq (INT8U u8Port_p, IOL_EPDOutStatus eControlCode_p)
 Send control code for PDOutStatus indication. More...
 
IOL_FUNC_DECL void IOLM_Port_AL_vNewInput (INT8U u8Port_p)
 New input indication. More...
 
IOL_FUNC_DECL void IOLM_Port_AL_vPDCycle (INT8U u8Port_p)
 Process Data cycle. More...
 
IOL_FUNC_DECL void IOLM_Port_AL_vControlInd (INT8U u8Port_p, IOL_EPDInStatus eControlCode_p)
 Control indication. More...
 

Function Documentation

◆ IOLM_API_AL_eControlReq()

IOL_FUNC_DECL IOL_EErrorInfo IOLM_API_AL_eControlReq ( INT8U  u8Port_p,
IOL_EPDOutStatus  eControlCode_p 
)

Send control code for PDOutStatus indication.

The control request function is used to set the Process Data valid or invalid. This function needs only to be called once if the state of Process Data changes. The default state is IOL_ePDOutStatus_PDOUTINVALID. The Process Data needs to be set valid after each reconnect (i.e. port changes to IOL_ePortMode_SM_OPERATE).

Parameters
[in]u8Port_pThe port number of the affected port.
[in]eControlCode_pIOL_ePDOutStatus_PDOUTINVALID or IOL_ePDOutStatus_PDOUTVALID.
Returns
IOL_EErrorInfo ErrorCode
Precondition
The port number must be smaller than IOLM_PORT_COUNT.
Postcondition
None.
IRQ-safe
No Function needs to be called in Mainloop context.

◆ IOLM_API_AL_eGetInput()

IOL_FUNC_DECL IOL_EErrorInfo IOLM_API_AL_eGetInput ( INT8U  u8Port_p,
INT8U **  ppu8Data_p,
INT8U pu8Length_p 
)

Read input data.

The get input function is used to read the most recent Process Data. The data pointer is valid until the next call of the function for this port.

If the port is in DI mode, the Process Data length is 1 byte and interpreted as boolean. The value held the state of the Input pin.

The data consistency depends on the PD buffer configuration. For details see IOLM_PD_BUFFER_COUNT.

Parameters
[in]u8Port_pThe port number of the affected port.
[out]ppu8Data_pPointer to the most recent Process Data.
[out]pu8Length_pLength of the Process Data.
Returns
IOL_EErrorInfo ErrorCode
Precondition
The port number must be smaller than IOLM_PORT_COUNT.
Postcondition
On success, valid output pointer.
IRQ-safe
Yes Function can be called in interrupt context. For consistency requirements see IOLM_PD_BUFFER_COUNT.

◆ IOLM_API_AL_eSetOutput()

IOL_FUNC_DECL IOL_EErrorInfo IOLM_API_AL_eSetOutput ( INT8U  u8Port_p,
INT8U pu8Data_p,
INT8U  u8Length_p 
)

Write output data.

The set output function is used to set the process output image. The caller has to take care that the length corresponds to the Device's Process Data length. Otherwise invalid data can be transfered.

If the port is in DO mode, the first byte is interpreted as boolean and set as pin output state.

The data consistency depends ont the PD buffer configuration. For details see IOLM_PD_BUFFER_COUNT.

Parameters
[in]u8Port_pThe port number of the affected port.
[in]pu8Data_pPointer to the most recent Process Data.
[in]u8Length_pLength of the Process Data.
Returns
IOL_EErrorInfo ErrorCode
Precondition
The port number must be smaller than IOLM_PORT_COUNT.
Postcondition
pu8Data_p is copied and can be freed.
IRQ-safe
Yes Function can be called in interrupt context. For consistency requirements see IOLM_PD_BUFFER_COUNT.

◆ IOLM_Port_AL_vControlInd()

IOL_FUNC_DECL void IOLM_Port_AL_vControlInd ( INT8U  u8Port_p,
IOL_EPDInStatus  eControlCode_p 
)

Control indication.

This function is called if the Process Data status has changed. The control code indicates the new Process Data state.

Parameters
[in]u8Port_pThe port number of the affected port.
[in]eControlCode_pInput data status.
Returns
void
IRQ-safe
Yes Function can be called in interrupt context.

◆ IOLM_Port_AL_vNewInput()

IOL_FUNC_DECL void IOLM_Port_AL_vNewInput ( INT8U  u8Port_p)

New input indication.

This function is called if new input data are available. They can be read by call of IOLM_API_AL_eGetInput().

Parameters
[in]u8Port_pThe port number of the affected port.
Returns
void
Precondition
The port number must be smaller than IOLM_PORT_COUNT.
Postcondition
None.
IRQ-safe
No Function will be called from Mainloop context.

◆ IOLM_Port_AL_vPDCycle()

IOL_FUNC_DECL void IOLM_Port_AL_vPDCycle ( INT8U  u8Port_p)

Process Data cycle.

This function is called if the Process Data cycle is finished. The application can provide new Process Data using IOLM_API_AL_eSetOutput().

Parameters
[in]u8Port_pThe port number of the affected port.
Returns
void
Precondition
The port number must be smaller than IOLM_PORT_COUNT.
Postcondition
None.
IRQ-safe
No Function will be called from Mainloop context.