DriveParamStrRead
Description
This function block reads a single drive parameter by sending an ASCII command to a drive. The value returned is the string response from the drive.
-
- This differs from DriveParamRead in that 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, such as the AKD2G’s AXIS#.FAULTMSG# parameters.
Figure 7-188: DriveParamStrRead
-
-
This function block uses and reserves 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 SDO Channel. The SDO Channel will remain reserved until the done output is "true". Therefore, 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 (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, for example) will be 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 as 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.
Arguments
Input
Execute |
Description |
Executes the Function BlockA function block groups an algorithm and a set of private data. It has inputs and outputs. |
Data type |
BOOL | |
Range |
0, 1 | |
Unit |
N/A | |
Default |
— | |
Drive |
Description |
The address of the drive from which data is read. |
Data type |
INT | |
Range |
— | |
Unit |
N/A | |
Default |
— | |
Param |
Description |
The parameter to read. |
Data type |
STRING | |
Range |
— | |
Unit |
N/A | |
Default |
— |
Output
Done |
Description |
Indicates whether this function block has completed without error. |
Data type |
BOOL | |
Unit |
N/A | |
Error |
Description |
Indicates whether this function block call has completed with error: |
Data type |
BOOL | |
Unit |
N/A | |
ErrorID |
Description |
The DriveParamStrRead error result if Error is TRUE (see list of Error Codes in table below). Upon success, Error is set to zero. |
Data type |
DINT | |
Unit |
N/A | |
Value |
Description |
The value of the drive parameter. Value is only set when the function block has successfully completed. |
Data type |
STRING | |
Unit |
N/A |
Usage
Use this FB to read drive parameters that are not supported by other function blocks. Examples would be motor temperature, drive bus voltage, Present drive limit settings, present regen loading, drive display, and fault history.
Related Functions
DriveParamRead, DriveParamWrite
Example
Structured Text
(* 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;