Hello Benny,
I'm not sure if I expressed myself correctly,the file spinport.comp causes the cylinder to retract when the y-axis reaches position 900 (while processing a program or jogging), allowing the axis to pass through the support.
When the y-axis reaches position 1600, the cylinder is extended again.
I haven't changed anything on the machine yet because I'm on vacation. But after my vacation, I want to install the new spindle support quickly. I tore down the support shortly before my vacation!
Code:
component spinport "LinuxCNC HAL component that switches the spindle support";
description
"""
Component to trigger the spindle support
\\fBEXAMPLE:\\fR
.br
.br
loadrt spinport names=spport
.br
addf spport servo-thread
.br
net position axis.y.pos-cmd => spport.position
.br
setp spport.on 900
.br
setp spport.off 1600
.br
net spport-trigger spport.trigger
""";
author "Rod Webster"; [attachment=71242]spinport.comp[/attachment]
pin in float position "Motion signal for Axis position";
pin out bit trigger "True if spinport segment should be triggered";
param rw float on "Absolute axis coordinate from which the support is retracted";
param rw float off "Absolute axis coordinate from which the support is extended";
function _;
license "GPL";
;;
#include <rtapi_math.h>
FUNCTION(_) {
if((position > on)&&(position < off))
trigger = 0;
else
trigger = 1;