ECATWriteSdoData

PLCopen motion icon Pipe Network motion icon

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Writes data to an EtherCATClosed Ethernet ofr Control Automation Technology. EtherCAT® is an open, high-performance Ethernet-based fieldbus system. The development goal of EtherCAT is to apply Ethernet to automation applications which require short data update times (also called cycle times) with low communication jitter (for synchronization purposes) and low hardware costs. device using a CANopenClosed CANopen® is a communication protocol and device profile specification for embedded systems used in automation for fieldbuses working in real time. SDO write command.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

On the rising edgeClosed The transition of a digital signal from low to high. AKA: positive edge. of Execute, an SDO write command is issued.

IndexClosed Zero pulse (zero signal) of a hardware pin such as digital input or feedback pin.

INT

-32768 to +32767

N/A

No default

The object directory index of the data to be written to.

See:

  • Communication SDOs.
  • Manufacturer specific SDOs.
  • Profile specific SDOs.

To read/write an SDO object with an index greater than 16#7FFF (32767), the value must be entered in this form:
any_to_int(index # in hex format).

Example: any_to_int(16#8321).

SubIndex

SINT

No range

N/A

No default

The sub-index of the object directory variable to be written to.

See:

  • Communication SDOs.
  • Manufacturer specific SDOs.
  • Profile specific SDOs.

To read/write an SDO object with an index greater than 16#7FFF (32767), the value must be entered in this form:
any_to_int(index # in hex format).

Example: any_to_int(16#8321).

Size

UINT

1 to 255

N/A

No default

The size (i.e., number of bytes) of the CoE object to write.

The size should be the exact size of the CoE object not exceeding 255 bytes.

DeviceAddress

INT

-32768 to +32767

N/A

No default

The EtherCAT address of the device from which data is written to.

  • The first node usually has the value 1001.
  • The second node usually has the value 1002.

  • Use the members of the EtherCAT structure to specify a device's address to Create Variables.
       

CoEDataArray[]

USINT

1 to 255

N/A

No default

The data to write to the CoE object.

The size of the array should be equal to or greater than the specified size.

The data is only set when an SDO write command has successfully completed.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

FALSE, TRUE

N/A

Indicates whether this function block has completed without error.

Error

BOOL

FALSE, TRUE

N/A

Indicates whether this function block has completed with error.

ErrorID

DINT

No range

N/A

The SDO call error result, if Error is TRUE.

Remarks

State Diagram

Figure 1: ECATWriteSdoData State Diagram

Figure 2: ECATWriteSdoData

EtherCATError Codes

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

(* Write DRV.NAME on first AKD Drive on EtherCAT network *)
Inst_ECATWriteSdoData(TRUE, 16#2031, 0, 10, EtherCAT.AKD_1, DriveName );
IF Inst_ECATWriteSdoData.Done OR Inst_ECATWriteSdoData.Error THEN
Inst_ECATWriteSdoData(FALSE, 16#2031, 0, 10, EtherCAT.AKD_1, DriveName ); END_IF;

See Also