ECATDevReadParam
Function Block A function block groups an algorithm and a set of private data. It has inputs and outputs. - Returns the EtherCAT ***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 device-specific information.
Inputs
Input |
Data Type |
Range |
Unit |
Default |
Description |
---|---|---|---|---|---|
Enable |
BOOL |
0, 1 |
N/A |
No default |
Requests to read the EtherCAT device-specifc parameter. |
DeviceAddress |
INT |
No range |
N/A |
No default |
The address of the device data is read from.
|
ParameterNumber |
INT |
No range |
N/A |
No default |
Parameter number. See EtherCAT Device Parameters for more information. |
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 an invalid input. |
ErrorID |
INT |
No range |
N/A |
Indicates the error if Error output is TRUE. See Error Codes for more information. |
Value |
LREAL |
No range |
N/A |
Value of the parameter. |
Remarks
See EtherCAT Function Blocks that Work with Drive Parameters for information about function blocks not supported by ML and MC function blocks.
Error Codes
Value Dec (hex) |
Error Code |
Description |
---|---|---|
0 |
ECERR_OK |
No Error |
1792 (0x700) |
ECERR_DEVICE_ERROR |
EtherCAT device is not accessible. |
1832 (0x728) |
ECERR_DEVICE_INVALIDADDR |
The specified EtherCAT node address is invalid. |
1921 (0x781 |
ECERR_DEVICE_PARAM_NOT_FOUND |
Parameter was not found. |
EtherCAT Device Parameters
This is a list of supported parameters read by ECATDevParamRead.
Parameter |
ID |
Name |
R/W |
Description |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DEVICE_PARAM_DEVICE_TYPE |
1 |
Device Type |
Read Only |
EtherCAT Device Type
|
||||||||||||||||||
DEVICE_PARAM_DRIVE_FAMILY |
2 |
Drive Family |
Read Only |
EtherCAT device drive family details.
|
||||||||||||||||||
DEVICE_PARAM_DRIVE_GEN |
3 |
Drive Generation |
Read Only |
EtherCAT drive generation details.
|
Figure 6-74: ECATDevReadParam
FBD Language Example
FFLD Language Example
IL Language Example
Not available.
ST Language Example
(* ECATDevReadParam ST "Structured text" A high-level language that is block structured and syntactically resembles Pascal 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;