Sercos3_IDNWrite (FB)

FUNCTION_BLOCK Sercos3_IDNWrite

This function block could be used to write Sercos III slave parameter. In contrast to Sercos3_IDNWrite4 also parameters longer than 4 Bytes will be supported. The parameter to be written is specified by the IDN as used in the object dictionary.

InOut:

Scope

Name

Type

Initial

Comment

Input

xExecute

BOOL

On a rising edge at this input the reading of the slave parameter will be started. In order to get the internal channel deallocated, the instance must be called at least once by “xExecute:= FALSE”.

xAbort

BOOL

FALSE

If this parameter is TRUE, the current write process will be aborted.

usiCom

USINT

1

Number of the Sercos III master: If only one Sercos III master is used, usiCom is ‘1’. In case of multiple masters use ‘1’ for the first, ‘2’ for the second, etc.

uiAddress

UINT

Topological address or Sercos address, depends on the parameter xIsSercosAddress

xIsSercosAddress

BOOL

FALSE

This input switches between topological address and Sercos address FALSE: uiAddress is the topological address TRUE: uiAddress is the Sercos address

usiChannel

USINT

1

Reserved for future extensions. Currently not used.

dwIDN

DWORD

IDN (Identification Number) with 4 Bytes (SI (structure instance) and SE (structure element))

wElem

WORD

Value 7: Data value

udiTimeOut

UDINT

Here you can set a timeout in milliseconds. If the writing of the parameter has not been finished within this time, an error message will be generated.

pBuffer

POINTER TO BYTE

0

Pointer on a the buffer which contains the data to be written

szSize

CAA_SIZE

0

Size of the data buffer (see above: pBuffer) in Bytes.

Output

xDone

BOOL

This output is TRUE as soon as the command has been finished successfully.

xBusy

BOOL

This output is TRUE as long as the execution of the command has not been finished.

xError

BOOL

This output is TRUE, if an error is detected. eError will show the cause.

eError

SERCOS3_ERROR

This output shows the cause of the detected error, which is indicated by xError. For example ‘SERCOS3_TIMEOUT’ in case of an timeout.

udiSercosError

UDINT

Error code if the function block has not been finished successfully.

szDataWritten

CAA_SIZE

Number of written Bytes; will be set to szSize after successful writing