Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: Alex0saber on July 09, 2017, 04:21:51 PM

Title: Help: setup G-code associated with limit switch
Post by: Alex0saber on July 09, 2017, 04:21:51 PM
Hello, Need some help tip here.
I'm trying to setup to allow the spindle to do tube rolling expansion.
Because of the inconsistent feed rate, I'm using actuator cylinder to replace my z-axis.

Is it possible to program G-code associated with the limit switch?
I want to setup the spindle to act in the following sequence:

Spindle spin clockwise
Cylinder relay stroke on (custom M101)
Stop spindle rotation when the limit switch(Z++) is triggered. 
Spindle spin counter-clockwise
Cylinder relay stroke off (custom M102)

Any idea how to code it?  ???
Thanks.