MC_ReadParam: Continuously read motion data of a positioning axis as of V6 (S7-1200) - Motion Control

S7-1200 Motion Control (S7-1200)

ft:publication_title
S7-1200 Motion Control (S7-1200)
Product
Motion Control
Version
V20
Publication date
11/2024
Language
en-US
MC_ReadParam: Continuously read motion data of a positioning axis as of V6

Description

The Motion Control instruction "MC_ReadParam" enables continuous reading of motion data and status messages of an axis. The current value of the corresponding tags is determined at the start of the command.

The following motion data and status messages can be read:

  • As of technology version V4:

    • Setpoint position of the axis

    • Setpoint and actual velocity of the axis

    • Current distance of axis from target position

    • Target position of the axis

  • Additional as of technology version V5:

    • Actual position of the axis

    • Actual velocity of the axis

    • Current following error

    • Drive status

    • Encoder status

    • Status bits

    • Error bits

Requirements

The positioning axis technology object has been configured correctly.

Override response

A MC_ReadParam command cannot be aborted by any other Motion Control command.

A new MC_ReadParam command does not abort any active Motion Control commands.

Parameters

Parameter

Declaration

Data type

Default value

Description

Enable

INPUT

BOOL

FALSE

TRUE

Read the tag specified with the "Parameter" and store the value in the destination address specified with "Value".

FALSE

Do not update assigned motion data

Parameter

INPUT

VARIANT (REAL)

-

VARIANT pointer to the value to be read. The following tags are permitted:

  • <Axis name>.Position

  • <Axis name>.Velocity

  • <Axis name>.ActualPosition

  • <Axis name>.ActualVelocity

  • <Axis name>.StatusPositioning.<Tag name>

  • <Axis name>.StatusDrive.<Tag name>

  • <Axis name>.StatusSensor.<Tag name>

  • <Axis name>.StatusBits.<Tag name>

  • <Axis name>.ErrorBits.<Tag name>

The description of the tags named and the tag structures can be found in the Appendix AUTOHOTSPOT.

Value

INOUT

VARIANT (REAL)

-

VARIANT pointer to the target tag or destination address to which the read value is to be written.

Valid

OUTPUT

BOOL

FALSE

TRUE

The read value is valid.

FALSE

The read value is invalid.

Busy

OUTPUT

BOOL

FALSE

TRUE

The command is being executed

Error

OUTPUT

BOOL

FALSE

TRUE

An error occurred during execution of the command. The cause of the error can be found in parameters "ErrorID" and "ErrorInfo".

ErrorID

OUTPUT

WORD

16#0000

Error ID for parameter "Error"

ErrorInfo

OUTPUT

WORD

16#0000

Error info ID for parameter "ErrorID"