DriveParamStrRead

PLCopen motion icon Pipe Network motion icon

 Function Block - Reads a single drive parameter by sending an ASCII command to a drive.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

Executes the function block.

Drive

INT

-32768 to +32767

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

FALSE, TRUE

N/A

Indicates whether this function block has completed without error.

Error

BOOL

FALSE, TRUE

N/A

Indicates whether this function block 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


  • 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 either the Done or Error output is TRUE.
    If it is not called at each cycle, the rest of SDO communication (e.g., the AKD GUI Views) is blocked.
    Using this FB in SFC 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.


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

Usage

Use this function block to read drive parameters that are not supported by other function blocks.

Examples include:

  • Drive bus voltage
  • Drive display
  • Fault history
  • Motor temperature
  • Present drive limit settings
  • Present regeneration loading

Figure 1: DriveParamStrRead

EtherCAT Error Codes

FBD Language Example

Not available.

FFLD Language Example

Not available.

IL Language Example

Not available.

ST Language Example

(* 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