Technology instructions
10.3 Motion control
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
759
The MC_ReadParam instruction works on an enable behavior. As long as the input "Enable"
is true the instruction reads the specified "Parameter" to the "Value" storage location.
The "MotionStatus" "Position" value updates at each Cycle Control Point (CCP) based upon
the current HSC value.
The "MotionStatus" "Velocity" value is the command velocity at the end of the current
segment (updated ~10ms). The MC_ReadParam can also read this value.
If an error occurs, the instruction switches to an error state that can only be reset by a new
rising edge at the input "Enable".
Table 10- 81 Parameters for the MC_ReadParam instruction
Start the instruction. Default value: FALSE
PARAMETER IN Variant Pointer to the TO-parameter that is to be read
If TRUE, the value has been read. Default value: FALSE
If TRUE, the instruction is operating. Default value: FALSE
If TRUE, an error occurred. Default value: FALSE
ID of the error. Default value: 0
Related information to the ERRORID. Default value: 0
Pointer to the location where the read value is stored
Table 10- 82 Condition codes for ERRORID and ERRORINFO
Successful read of a parameter
Invalid parameter (incorrect length)
Invalid parameter (no TO-DB)
Invalid parameter (not readable)
Invalid parameter (wrong value)
The axis "MotionStatus" consists of four values. You will want to monitor changes in these
values, which can be read while the program is running:
Readable through
MC_ReadParam
• Position
REAL Yes
• Velocity
REAL Yes
• Distance
REAL Yes
• TargetPosition
REAL Yes