DriveParamStrRead

PLCopen motion icon Pipe Network motion icon

 Function BlockClosed 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 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 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 6-70: 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