ECATReadSDO

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. - Reads a 32-bit word from I/O nodes using a CANopen SDO read command.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

0, 1

N/A

No default

On the rising edgeClosed A rising edge is the transition of a digital signal from low to high. It is also called positive edge of Execute, an SDO read command is issued.

  • The function block only handles one SDO command at a time.
  • If Execute is toggled quickly so that another rising edge occurs before the SDO command has completed, the function block does not issue a second SDO command.

Index

INT

No range

N/A

No default

The object directory index of the data to be read.

For more information, 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 read.

For more information, 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

SINT

1 to 4

N/A

No default

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

DeviceAddress

INT

No range

N/A

No default

The EtherCATClosed ***EtherCAT is an open, high-performance Ethernet-based fieldbus system. The development goal of EtherCAT was 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 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.
  • Alternately, use the members of the EtherCAT structure to specify a device's address to Create Variables.
    creating an EtherCAT variable   

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

No range

N/A

Indicates whether this function block has completed without error.

Error

BOOL

No range

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.

Value

DINT

No range

N/A

The value of the object directory variable being read.

Value is only set when an SDO read command has successfully completed.

Remarks

  • Is typically used to query the status of inputs.
  • See the FAQ to set the update rate for SDO communication.
  • See EtherCAT Function Blocks that Work with SDOs for information about function blocks which are used to work with drive or remote I/O parameters that are not supported by ML and MC function blocks.

State Diagram

ECATReadSdo State diagram

Figure 6-76: ECATReadSDO State Diagram

EtherCAT Error Codes

ECATReadSdo

Figure 6-77: ECATReadSDO

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

(* Read PL.KP on first AKD Drive on EtherCAT network *)
Inst_ECATReadSdo( TRUE, 16#3542, 0, 4, 1001 );
PositionProportionalGain := Inst_ECATReadSdo.Value;
(* Read the 4 byte data in SDO index 8321h (33569 decimal), sub-index 1 on the first AKD Drive
Inst_ECATReadSdo( TRUE, any_to_int(16#8321), 1, 4, 1001 );
ParamValue := Inst_ECATReadSdo.Value;

See Also

ECATWriteSDO