ECATDevReadParam
Description
This function block returns the device-specific information.
See EtherCAT Function Blocks That Work With Drive Parameters for information about function blocks which work with drive parameters that are not supported by ML and MC function blocks.
Figure 7-193: ECATDevReadParam
Arguments
Input
Enable |
Description |
Requests to read the EtherCAT device-specifc parameter |
|
Data type |
BOOL |
|
Range |
0, 1 |
|
Unit |
N/A |
|
Default |
— |
DeviceAddress |
Description |
The address of the device from which data is read. The first node usually has the value '1001'. The second node usually has the value '1002'. Alternately, you can use the members of the EtherCAT structure to specify a device's address when you create the variable. |
|
Data type |
INT |
|
Range |
- |
|
Unit |
N/A |
|
Default |
— |
ParameterNumber |
Description |
Parameter number, see table in EtherCAT Device Parameters |
|
Data type |
INT |
|
Range |
— |
|
Unit |
N/A |
|
Default |
— |
Output
Done |
Description |
Indicates when the function is complete. |
|
Data type |
BOOL |
Error |
Description |
Indicates an invalid input. |
|
Data type |
BOOL |
ErrorID |
Description |
Indicates the error if Error output is set to TRUE (see List of EtherCAT Error Messages below) |
|
Data type |
INT |
Value |
Description |
Value of the parameter |
|
Data type |
LREAL |
List of EtherCAT Error Messages
Error Code |
Value dec (hex) |
Description |
ECERR_OK |
0 |
No Error |
ECERR_DEVICE_ERROR |
1792 (0x700) |
EtherCAT device is not accessible |
ECERR_DEVICE_INVALIDADDR |
1832 (0x728) |
EtherCAT device address is invalid |
ECERR_DEVICE_PARAM_NOT_FOUND |
1921 (0x781 |
Parameter was not found |
EtherCAT Device Parameters
The table below is a list of currently supported parameters read by ECATDevParamRead.
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__ | 1 | The device is an S300/S700 family drive | DRIVE_FAMILY_AKD | 2 | The device is in the AKD2G, AKD-N, or AKD 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. |
|
Example
Structured Text
(* ECATDevReadParam 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;
Ladder Diagram
FBD