Open loop motion control
12.6 Subroutines created by the Motion wizard for the Axis of Motion
S7-200 SMART
626
System Manual, V2.3, 07/2017, A5E03822230-AF
Turn on the Abort parameter to command the Axis of Motion to stop execution of this
command and decelerate until the motor comes to a stop.
The Error parameter (Page 659) contains the result of this subroutine.
The C_Pos parameter contains current position of the Axis of Motion. Based upon the units
of measurement, the value is either a number of pulses (DINT) or the number of engineering
units (REAL).
The C_Speed parameter contains the current speed of the Axis of Motion. Based upon the
units of measurement, the value is either a number of pulses/second (DINT) or the
engineering units/second (REAL).
12.6.5
AXISx_RUN subroutine
Table 12- 12 AXISx_RUN
LAD / FBD
STL
Description
CALL AXISx_RUN,
START, Profile,
Abort, Done, Error,
C_Profile, C_Step,
C_Pos, C_Speed
The AXISx_RUN subroutine (Run Profile) commands the Axis of Motion
to execute the motion operation in a specific profile stored in the con-
figuration/profile table.
Table 12- 13 Parameters for the AXISx_RUN subroutine
Inputs/Outputs
Data type
Operands
START
BOOL
I, Q, V, M, SM, S, T, C, L, Power Flow
Profile
BYTE
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *AC, *LD, Con-
stant
Abort, Done
BOOL
I, Q, V, M, SM, S, T, C, L
Error, C_Profile, C_Step BYTE
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *AC, *LD
C_Pos, C_Speed
DINT, REAL ID, QD, VD, MD, SMD, SD, LD, AC, *VD, *AC, *LD
Turn on the EN bit to enable the subroutine. Ensure that the EN bit stays on until the Done
bit signals that the execution of the subroutine has completed.
Turn on the START parameter to send a RUN command to the Axis of Motion. For each
scan when the START parameter is on and the Axis of Motion is not currently busy, the
subroutine sends a RUN command to the Axis of Motion. To ensure that only one command
is sent, use an edge detection element to pulse the START parameter on.