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 driveClosed In electrical engineering, a drive is an electronic device to provide power to a motor or servo. Control device for regulating the speed, torque and position of a motor. A unit controlling a motor using the current and timing in its coils. parameter by sending an ASCIIClosed American Standard Code for Information Interchange - ASCII provides a one-to-one mapping between alphanumeric characters and a digital one-byte word. command to a drive.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

Executes the functionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. 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 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 directlyClosed The orientation components of a vector in space., 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:

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 resetClosed New start of the microprocessor. 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