Siemens 6AV6651-7KA01-3AA4 - S7-1200 + KTP400 Basic Starter Kit 6AV6651-7KA01-3AA4 Benutzerhandbuch

Produktcode
6AV6651-7KA01-3AA4
Seite von 364
 
Motion control is easy 
 
10.5 Motion control instructions 
Easy Book 
Manual, 03/2014, A5E02486774-AF 
241
 
10.5.13 
MC_ReadParam instruction (read parameters of a technology object) instruction 
You use the MC_ReadParam instruction to read a select number of parameters that indicate 
the current position, velocity, and so forth of the axis defined in the Axis input. 
Table 10- 32  MC_ReadParam instruction  
LAD / FBD 
SCL 
Description 
 
"MC_ReadParam_DB"( 
    Enable:=_bool_in_, 
    Parameter:=_variant_in_, 
    Value:=_variant_in_out_, 
    Valid:=_bool_out_, 
    Busy:=_bool_out_, 
    Error:=_real_out_, 
    ErrorID:=_word_out_, 
    ErrorInfo:=_word_out_); 
You use the MC_ReadParam 
instruction to read single status 
values, independent of the cycle 
control point.  
 
1
  STEP 7 automatically creates the DB when you insert the instruction. 
  In the SCL example, "MC_ReadParam_DB " is the name of the instance DB. 
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- 33  Parameters for the MC_ReadParam instruction 
Parameter and type 
Data type 
Description 
ENABLE 
IN 
Bool 
Start the instruction. Default value: FALSE 
PARAMETER 
IN 
Variant 
Pointer to the TO-parameter that is to be read 
VALID 
OUT 
Bool 
If TRUE, the value has been read. Default value: FALSE 
BUSY 
OUT 
Bool 
If TRUE, the instruction is operating. Default value: FALSE 
ERROR 
OUT 
Real 
If TRUE, an error occurred. Default value: FALSE 
ERRORID 
OUT 
Word 
ID of the error. Default value: 0 
ERRORINFO 
OUT 
Word 
Related information to the ERRORID. Default value: 0 
VALUE 
INOUT  Variant 
Pointer to the location where the read value is stored