DriveParamStrRead
Function Block A function block groups an algorithm and a set of private data. It has inputs and outputs. - reads a single drive parameter by sending an ASCII command to a drive.
Inputs
Input |
Data Type |
Range |
Unit |
Default |
Description |
---|---|---|---|---|---|
Execute |
BOOL |
0, 1 |
N/A |
No default |
Executes the function block. |
Drive |
INT |
No range |
N/A |
No default |
The address of the drive from which data is read. |
Param |
STRING |
No range |
N/A |
No default |
The parameter to read. |
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 call has completed with error. |
ErrorID |
DINT |
No range |
N/A |
The DriveParamStrRead error result if Error is TRUE. Upon success, Error is set to 0 (zero). See the EtherCAT Error Codes for more information. |
Value |
STRING |
No range |
N/A |
The value of the drive parameter. Value is only set when the function block has successfully completed. |
Remarks
The value returned is the string response from the drive.
-
- This differs from DriveParamRead because the drive response is not parsed.
DriveParamRead parses the drive response and returns the numeric value of the parameter and the units found that represent that parameter.
Since DriveParamStrRead returns the drive response directly, it can be used to read parameters that have string representations (e.g., the AKD2G’s AXIS#.FAULTMSG# parameters).
See EtherCAT Function Blocks That Work With Drive Parameters for information about function blocks that are not supported by ML and MC function blocks.
Figure 7-188: DriveParamStrRead
-
-
This function block uses and reserves the EtherCAT SDO Channel.
The SDO Channel remains reserved until the done output is TRUE.
This FB should be called at each cycle until the done output is TRUE.
If it is not called at each cycle, the rest of SDO communication (e.g., the AKD GUI "Graphical User Interface" A GUI is a type of user interface which allows people to interact with a computer and computer-controlled devices Views) is blocked.
Using this FB in SFC "Sequential function chart" It can be used to program processes that can be split into steps. The main components of SFC are: - Steps with associated actions - Transitions with associated logic conditions - Directed links between steps and transitions P0 or P1 steps is not recommended because these steps are executed only once.
If this FB is used in P0 or P1, then it must be used in an SFC N step to ensure the FB completes.
EtherCAT Error Codes
Error Code |
Value dec (hex) |
Description |
---|---|---|
ECERR_OK |
0 |
The SDO call succeeded |
ECERR_DEVICE_ERROR |
1792 (0x700) |
EtherCAT device is not accessible |
ECERR_DEVICE_INVALIDCMD |
1794 (0x702) |
Invalid mailbox command |
ECERR_DEVICE_INVALIDINDEX |
1795 (0x703) |
An invalid value for the Index input was specified |
ECERR_DEVICE_INVALIDACCESS |
1796 (0x704) |
Reading of the variable is not permitted |
ECERR_DEVICE_INVALIDSIZE |
1797 (0x705) |
An invalid size for the parameter was specified |
ECERR_DEVICE_INVALIDDATA |
1798 (0x706) |
Invalid parameter value(s) in SDO index and/or sub-index |
ECERR_DEVICE_NOTREADY |
1799 (0x707) |
Device is not in a ready state, network is not in operational |
ECERR_DEVICE_BUSY |
1800 (0x708) |
Device is not available to respond |
ECERR_DEVICE_INVALIDCONTEXT |
1801 (0x709) |
Device responded with an illegal error code, indicating the command is not allowed under the present conditions |
ECERR_DEVICE_NOMEMORY |
1802 (0x70A) |
EtherCAT mailbox is out of memory or device is out of disk space |
ECERR_DEVICE_INVALIDPARM |
1803 (0x70B) |
EtherCAT mailbox request was not valid |
ECERR_DEVICE_NOTFOUND |
1804 (0x70C) |
EtherCAT device not found |
ECERR_DEVICE_SYNTAX |
1805 (0x70D) |
An unexpected error occurred |
ECERR_DEVICE_INVALIDSTATE |
1810 (0x712) |
The EtherCAT device is in an invalid state |
ECERR_DEVICE_TIMEOUT |
1817 (0x719) |
|
ECERR_DEVICE_INSERTMAILBOX |
1826 (0x722) |
Error while inserting the mailbox command into internal FIFO |
ECERR_DEVICE_INVALIDOFFSET |
1827 (0x723) |
An invalid value for the SubIndex input was specified |
ECERR_DEVICE_UNKNOWNMAILBOXCMD |
1828 (0x724) |
The master sent an unknown mailbox command to the slave |
ECERR_DEVICE_ACCESSDENIED |
1829 (0x725) |
Device responded with an invalid access error code, indicating the command is not allowed |
ECERR_DEVICE_INVALIDADDR |
1832 (0x728) |
Can’t send a mailbox command to the specified slave |
ECERR_DEVICE_NOT_A_FSOE_MASTER |
1836 (0x72c) |
Device is not a FSoE master. |
ECERR_DEVICE_PARAM_ACCESS_ERROR |
1920 (0x780) |
Unknown error occurred while accessing parameter |
ECERR_DEVICE_PARAM_NOT_FOUND |
1921 (0x781) |
Parameter was not found |
ECERR_DEVICE_PARAM_NOT_INTEGER |
1922 (0x782) |
Parameter is a floating-point value. Integer value required. |
ECERR_DEVICE_VALUE_IS_NEGATIVE |
1923 (0x783) |
No negative values allowed. Value specified was negative. |
ECERR_DEVICE_VALUE_OUT_OF_RANGE |
1924 (0x784) |
Value is out of data-range |
ECERR_DEVICE_VALUE_GREATER_THAN_MAX |
1925 (0x785) |
Value bigger than maximum |
ECERR_DEVICE_VALUE_LOWER_THAN_MIN |
1926 (0x786) |
Value lower than minimum |
ECERR_CLIENT_ERROR |
2048 (0x800) |
Error in Mailbox response to a previously sent mailbox command |
ECERR_CLIENT_TIMEOUT |
2049 (0x801) |
The SDO command timed out |
ECERR_CLIENT_ INVALIDPARM |
2050 (0x802) |
An invalid value was specified |
ECERR_CLIENT_ INVALIDSIZE |
2051 (0x803) |
An invalid value for the size input was specified |
Usage
Use this FB to read drive parameters that are not supported by other function blocks.
Examples are motor temperature, drive bus voltage, present drive limit settings, present regen loading, drive display, and fault history.
FBD Language
Not available.
FFLD Language
Not available.
IL Language
Not available.
ST Language
(* Read AXIS1.FAULTMSG1 on first AKD2G Drive on EtherCAT network *)
(* The code continually calls the FB (without re-executing it) until the first execution is done, then reads the returned value from the drive and reset the FB *)
IF ReadFaultMsg Then
Inst_DriveParamStrRead1(True, 1001, 'AXIS1.FAULTMSG1' );
End_If;
On Inst_DriveParamStrRead1 Do
FaultMsg := Inst_DriveParamStrRead1.Value; (* Reads the returned value from the drive *)
Inst_DriveParamStrRead1(False, 1001, 'AXIS1.FAULTMSG1');
ReadFaultMsg := False; (* Reset the FB *)
End_DO;
See Also