ECATDevReadParam

PLCopen motion icon Pipe Network motion icon

 Function Block - Returns the EtherCAT device-specific information.

Inputs

Input

Data Type

Range

Unit

Default

Description

Enable

BOOL

FALSE, TRUE

N/A

No default

Requests to read the EtherCAT device-specifc parameter.

DeviceAddress

INT

-32768 to +32767

N/A

No default

The address of the device data is read from.

  • 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.
       

ParameterNumber

INT

-32768 to +32767

N/A

No default

Parameter number.

See EtherCAT Device Parameters.

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 an invalid input was specified.

ErrorID

INT

-32768 to +32767

N/A

Indicates the error if Error output is TRUE.

See Error Codes.

Value

LREAL

No range

N/A

Value of the parameter.

Remarks

See EtherCAT Function Blocks that Work with Drive Parameters about function blocks not supported by ML and MC function blocks.

Error Codes

EtherCAT Device Parameters

This is a list of supported parameters read by ECATDevReadParam.

Parameter

ID

Name

R/W

Description

DEVICE_PARAM_DEVICE_TYPE

1

Device Type

Read Only

EtherCAT Device Type

Output Value

Numerical Value

Description

DEVICE_TYPE_OTHER

0

The EtherCAT device is not a drive.

DEVICE_TYPE_DRIVE

1

The EtherCAT device is a drive.

DEVICE_PARAM_DRIVE_FAMILY

2

Drive Family

Read Only

EtherCAT device drive family details.

Output Value

Numerical Value

Description

DEVICE_NOT_A_DRIVE

-1

The EtherCAT device is not a drive.

DRIVE_FAMILY_OTHER

0

The drive family cannot be determined.

DRIVE_FAMILY_S300_S700

1

The device is an S300/S700 family drive.

DRIVE_FAMILY_AKD

2

The device is in the AKD2G, AKD-N, or AKD servo drive family.

DRIVE_FAMILY_AKT2G_STEPPER

3

The device is an AKT2G Stepper family drive.

DEVICE_PARAM_DRIVE_GEN

3

Drive Generation

Read Only

EtherCAT drive generation details.

Output Value

Numerical Value

Description

DEVICE_NOT_A_DRIVE

-1

The EtherCAT device is not a drive.

DRIVE_GEN_UNKNOWN

0

The drive generation cannot be determined.

DRIVE_GEN_1

1

The device is a 1st generation drive (e.g., AKD, AKD-N, S300, S700, AKT2G-SM-L15, AKT2G-SM-L50).

DRIVE_GEN_2

2

The device is a 2nd generation drive (e.g., AKD2G).

Figure 1: ECATDevReadParam

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

(* ECATDevReadParam ST example *)
Inst_ECATDevReadParam( TRUE, EtherCAT.AKD_2, DEVICE_PARAM_DEVICE_TYPE );
DeviceType := Inst_ECATDevReadParam.Value;

Inst_ECATDevReadParam( TRUE, EtherCAT.AKD_2, DEVICE_PARAM_DRIVE_FAMILY );
DeviceFamily := Inst_ECATDevReadParam.Value;

Inst_ECATDevReadParam( TRUE, EtherCAT.AKD_2, DEVICE_PARAM_DRIVE_GEN );
DriveGen := Inst_ECATDevReadParam.Value;