MC_WriteParameter (motion control write parameter)

The MC_WriteParameter parameter modifies the value of a vendor-specific parameter of type REAL.
The parameters set by the MC_WriteParameter function block are only applied to the application temporarily. They are overwritten by the permanent settings, which are configured by the user in
FactoryTalk Design Workbench
motion configuration, when the controller is switched from
Program
to
Run
, or when the controller power is cycled OFF and ON.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the L50E and L70E controllers that support motion control.
MC_WriteParameter
MC_WriteParameter
MC_WriteParameter parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
Instruction block enable.
  • TRUE: Execute current MC_WriteParameter computation.
  • FALSE: There is no computation.
Applies only to ladder diagram programs.
AxisIn
Input
AXIS_REF
FB_AXIS_REF
Use the AXIS_REF data type to define the parameters for AxisIn.
For a feedback axis, use the FB_AXIS_REF data type to define the parameters for AxisIn.
Execute
Input
BOOL
TRUE: Writes the value of the parameter at the rising edge.
ParameterNumber
Input
DINT
Parameter identification.
The parameter number is defined in Motion control function block parameter details.
Value
Input
REAL
New value of the specified parameter.
MC_ExecutionMode
Input
SINT
Values are:
  • 0 (
    mcImmediately
    ): The functionality is immediately valid.
  • 1 (
    mcQueued
    ): The new functionality becomes valid when:
    • All previous motion commands set one of the following output parameters: Done, Aborted, or Error
    • The axis is not in a moving state
    • Implies that the output parameter Busy is set to FALSE.
When (MC_ExecutionMode = 0), for all parameters except Duty Cycle (1005), this FB can be completed successfully only when the axis state is Disabled or Standstill.
When (MC_ExecutionMode = 0), for Parameter Duty Cycle (1005), this FB can be completed successfully except the axis is in Homing or Error Stop state.
For (MC_ExecutionMode = 1), this function block can be successfully completed only when the axis state is Disabled, Standstill, or the ongoing motion can complete, ending with Standstill state.
Other input values are reserved currently and are considered as invalid parameters.
ENO
Output
BOOL
Enable output.
Applies only to ladder diagram programs.
Axis
Output
AXIS_REF
Axis output is read-only in ladder diagram programs.
Done
Output
BOOL
TRUE: The parameter was successfully written.
Busy
Output
BOOL
TRUE: Indicates that the function block has control of the axis.
Error
Output
BOOL
Indicates that an error occurred.
  • TRUE: An error is detected.
  • FALSE: No error.
ErrorID
Output
UINT
A unique numeric that identifies the error. The errors for this instruction are defined in Motion control function block error IDs.

MC_WriteParameter examples

MC_WriteParameter function block diagram example
MC_WriteParameter function block diagram example
MC_WriteParameter ladder diagram example
MC_WriteParameter structured text example
MC_WriteParameter structured text example
Results
Results
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal