So, I've now tested it in a VM.
If I leave the query in the function
if((position > stop1)&&;(position < stop2))
halt=1;
else
halt = 0;
I cannot activate the machine!
If I reverse the query, I can reference the machine and also move the axis to the position support.stop1 From this point on, the axis can no longer be moved.So far, so good!
What I still don't understand:
- Where or with which pin is the reed sensor of the cylinder connected
The reed sensor that tells me that the cylinder is retracted!
Of course, this is now a simulation and on the real machine it is an input on the Mesa card, but there must be a pin to compare whether the spport.halt and reed sensor of the cylinder are the same or not?
The motion.enable should only trigger when the two signals are different.
So the axis is between the positions stop1 and stop2:
- If halt.motion is true and the cylinder's reed sensor is also true, the axis can continue to move- If the two signals are different,
the axis must stop, which is what it is currently doing ...