ETC_CO_SdoWrite

Library: IODrvEtherCAT

This function block is for writing EtherCAT slave parameters. Unlike ETC_CO_SdoWrite4, parameter longer than 4 bytes are also supported. The parameters to be written are specified with Index and Subindex, as used in the object directory.

Inputs

Name

Data type

Description

xExecute

BOOL

Rising edge: Starts the reading of the slave parameters.

In order to release the internal channel again afterwards, the instance must be called at least once with xExecute: = FALSE.

xAbort

BOOL

TRUE: The current write process is aborted.

usiCom

USINT

Number of the EtherCAT master: usiCom is always 1 if only one EtherCAT master is used. If several masters are used, 1 designates the first, 2 the second and so on.

uiDevice

UInt

Physical address of the slave.

If the auto-configuration mode is deactivated in the master, the slave can be given its own address. This address must be specified here

If the auto-configuration mode is activated, the first slave is given the address 1001. The current address of a slave is always located on the Slave tab of the slave in the EtherCAT address field.

usiChannel

USINT

Reserved for future extensions

wIndex

WORD

Index of the parameter in the object directory.

bySubindex

BYTE

Subindex of the parameter in the object directory.

udiTimeOut

UDINT

Definition of the watchdog time in milliseconds.

If the writing of the parameters is not yet complete on expiry of this time, an error message is output.

pBuffer

CAA_PVOID

Pointer to a data buffer containing the data to be written.

szSize

CAA_SIZE

Size of the data buffer (pBuffer) in bytes

eMode

ETC_CO_MODE

Number of bytes to be written. Possible entries:

  • ETC_CO_AUTO

  • ETC_CO_EXPEDITED

  • ETC_CO_SEGMENTED

AUTO mode is usually set and the mode suitable for the length is thus automatically used.

Outputs

Name

Data type

Description

xDone

BOOL

TRUE: Writing of the parameter was completed without error.

xBusy

BOOL

TRUE: Writing is not yet completed.

xError

BOOL

TRUE: An error occurred during writing.

eError

ETC_CO_ERROR

Information about the cause of the error that was displayed by xError, e.g. ETC_CO_TIMEOUT in case of a timeout

udiSdoAbort

UDINT

If an error has occurred in the device, this output provides further information about it

szDataWritten

CAA_SIZE

Number of bytes written; maximally szSize (input).

ENUM ETC_CO_MODE

AUTO

0

Client automatically selects the mode

EXPEDITED

1

Client uses the expedited protocol

SEGMENTED

2

Client uses the segmented protocol

See also