FB_WriteDeviceParameter - Functional Description

Overview

Type:

Function block

Available as of:

V1.0.0.0

Functional Description

The function block FB_WriteDeviceParameter is used to write parameters to the IO-Link device.

The IO-Link protocol follows the big-endian layout. Depending on the read parameter type, consider a byte swap before processing the data from i_anyBuffer.

NOTE: If the IO-Link master is connected by Sercos protocol, the Sercos state must be in state 4 and the outputs of the bus coupler enabled to initiate that which is required for the communication to the IO-Link master and devices and to use this function block.

The maximum number of bytes that can be read with one execution are 232 bytes.

Up to 300 simultaneous function block executions for the read and write operations are supported.

NOTE: Do not change i_anyBuffer while q_xBusy is TRUE.
NOTE: The same buffer cannot be used for more than one read/write operation at a time. This can result in corrupted or inconsistent data.
 WARNING
UNINTENDED EQUIPMENT OPERATION
  • Do not modify input parameters while the Busy output is equal to TRUE.
  • Ensure that each function block instance that is executing has its own, unique buffer space.
Failure to follow these instructions can result in death, serious injury, or equipment damage.

Interface

Input

Data type

Range

Description

i_xExecute

BOOL

On rising edge, process is started.

i_ifIoLinkMaster

SE_IoLinkMaster.IF_IoLinkMaster

Interface of the IO-Link master.

NOTE: Provide the IoLink master instance of type FB_IoLinkMaster specified inside the Devices tree.

i_usiChannelNumber

USINT

1-4

Channel number of the IO-Link device.

i_timTimeout

TIME

T#1s – T#60s

Maximum time to establish the connection.

Default value: T#10s

In case the timeout is configured lower/higher than allowed by the range, it is automatically set to the minimum/maximum value allowed by the range.

NOTE: Take the fieldbus cycle, the task bus cycle, the bitrate of the IO-Link device (COM 1/2/3), and the minimum cycle time of the IO-Link device into account before setting the timeout.

i_stParameterAddress

ST_ParameterAddress

Structure containing the parameter address.

i_anyBuffer

ANY

Application buffer in which the read data is copied.

Output

Data type

Description

q_xDone

BOOL

Indicates that the execution process has been completed successfully.

q_xBusy

BOOL

Indicates that the execution process is in progress.

q_xError

BOOL

If this output is set to TRUE, an error has been detected. For details, refer to q_etResult and q_etResultMsg.

q_etResult

ET_Result

Provides diagnostic and status information as a numeric value.

q_sResultMsg

STRING [80]

Provides additional diagnostic and status information as a text message.