Programming 3 Programming 3.1 Programming a negative software limit switch Negative software limit switch The G98 command sets negative SLS in the programmed axes. If G90 is active, the negative SLS is set absolute to the programmed value. If G91 is active, the programmed value is added relative to P-AXIS-00177. G98 is active in each block; the software limit switches programmed using it are active cross-block. The positions for negative SLS programmed via G98 are stored in the axis-specific variables V.A. SWE.X, V.A. SWE.Y, V.A. SWE.Z, etc. [PROG]. The variables are pre-assigned the value of P-AXIS-00177 of each axis at a reset, mode change or axis change.
Negative software limit switch (Example 1 – absolute) %swe_abs.nc N110 G00 X0 Y0 G90 N120 G00 X20 Y30 (Sets neg. SLS in X to -100 and Y to -200) N130 G98 X-100 Y-200 ( .... ) (Example 2 – relative) %swe_rel.nc N110 G00 X0 Y0 G90 N120 G00 X20 Y30 (Offsets neg. SLS in X by 10 and Y by 20) N130 G98 G91 X10 Y20 ( .... ) TF5200 | TwinCAT 3 CNC Software limit switch 13 Version: 1.23