DriveParamWrite

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. - Writes a 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

On the rising edgeClosed The transition of a digital signal from low to high. AKA: positive edge. of Execute, a drive parameter is set.

Drive

INT

-32768 to +32767

N/A

No default

The address of the drive where data is written.

  • The first node usually has the value 1001.
  • The second node usually has the value 1002.

Param

STRING

No range

N/A

No default

The parameter to write.

Value

LREAL

No range

N/A

No default

The value to set the drive parameter to.

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 DriveParamWrite error result if Error is TRUE.

Upon success, Error is set to 0 (zero).

See the EtherCAT Error Codes.

Remarks

  • It takes multiple cycles to complete this function block.
  • Typically only one DriveParamRead or DriveParamWrite function should be active for each axis at one time.
  • If executing this function block continuously or if multiple times is required, add code that waits for this function block to complete (e.g., Done bit = 1) before executing it again.
  • See EtherCAT Function Blocks that Work with Drive Parameters about function blocks not supported by ML and MC function blocks.

Figure 1: DriveParamWrite

EtherCAT Error Codes

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

(* Write 58.000 to PL.KPClosed Proportional gain of a control loop. 
AKA: P-gain. of first AKD Drive on EtherCAT network *
Inst_DriveParamWrite( TRUE, 1001, 'PL.KP', 58 );

See Also

DriveParamRead