MC_Axis001 MC_Axis0
01
Vel.Act
inst_Enabled
instMC_TimeStampToPos
TimeStamp
Axis
Axis
Enable
Busy
ValueSource
MC_TimeStampToPos
Enabled
CalcPosition
TTP_Busy
C
alcPosition
Error
TTP_Err
ErrorID TTP_ErrID
N3_Input_Bit_00_Time_Stamp
After the MC_MoveVelocity (Velocity Control) instruction is executed for axis 1, the MC_TimeStampToPos
(Time Stamp to Axis Position Calculation) instruction is executed for axis 2.
Note: The contents of inline ST 2 are given below.
The number of rotations of the encoder axis is counted. (If the
current value is less than the previous value, it
is assumed that the modulo maximum position has been exceeded.)
inst_Enabled
Note: The contents of inline ST 3 are given below.
CalcPosition (calculated position) is obtained when the sensor output turns ON. (The position is saved
alternately in Position[0] and Position[1].)
N3_Input_Bit_00
Note: The contents of inline ST 4 are given below.
After two workpieces are detected, the distance between the
workpieces is calculated.
Finish
Contents of Inline ST 1
//MC_MoveVelocity parameters
Vel_Vel := LREAL#1000.0;
Vel_Acc := LREAL#0.0;
Vel_Dec := LREAL#0.0;
Vel_Jrk := LREAL#1000.0;
InitFlag := BOOL#TRUE;
Contents of Inline ST 2
IF MC_Axis001.Act.Pos < PreAxis001ActPos THEN
Inc(RotaryCount);
END_IF;
PreAxis001ActPos := MC_Axis001.Act.Pos;
Contents of Inline ST 3
IF Index < UINT#2 THEN
Position[Index] := CalcPosition;
Count[Index] := RotaryCount;
Index := Index + UINT#1;
END_IF;
3 Axis Command Instructions
3-443
NY-series Motion Control Instructions Reference Manual (W561)
MC_TimeStampToPos
3
Sample Programming