Switch relay in a defined x position
- Benb
-
- Offline
- Elite Member
-
Less
More
- Posts: 180
- Thank you received: 58
08 Aug 2025 15:56 #333051
by Benb
Replied by Benb on topic Switch relay in a defined x position
Attached is revised spinport.comp which incorporate
position axis.y.pos-cmd > 1000 and < 1500 ---> cylinder retracted and halt any axis movement
Note your hal configuration is monitoring y-axis.
position axis.y.pos-cmd > 1000 and < 1500 ---> cylinder retracted and halt any axis movement
Note your hal configuration is monitoring y-axis.
Please Log in or Create an account to join the conversation.
- mgm
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 210
- Thank you received: 13
09 Aug 2025 20:34 #333139
by mgm
Replied by mgm on topic Switch relay in a defined x position
Thank you very much for your effort
I will try to test the revised version in my simulation.
I will report at the latest when I am back at the machine, or when I am back from vacation.
Thanks again for your work.
Greetings Michael
I will try to test the revised version in my simulation.
I will report at the latest when I am back at the machine, or when I am back from vacation.
Thanks again for your work.
Greetings Michael
Please Log in or Create an account to join the conversation.
- mgm
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 210
- Thank you received: 13
12 Aug 2025 16:58 - 12 Aug 2025 17:03 #333287
by mgm
Replied by mgm on topic Switch relay in a defined x position
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 ...
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 ...
Last edit: 12 Aug 2025 17:03 by mgm.
Please Log in or Create an account to join the conversation.
- Benb
-
- Offline
- Elite Member
-
Less
More
- Posts: 180
- Thank you received: 58
13 Aug 2025 20:28 - 13 Aug 2025 20:30 #333363
by Benb
Replied by Benb on topic Switch relay in a defined x position
Let see if I grasp the concept. You have an existing reed switch that detects that the support is in extended position and you like stop all axis from moving when switch is active.
1) Wire the reed switch to your mesa digital input.
2) Load the new revised .comp file
3) You may need the change operations by changing the state of pins. for example, trigger=1; to trigger=0; same for halt and reedsw.
Attached is revised the revised spinport.comp
1) Wire the reed switch to your mesa digital input.
2) Load the new revised .comp file
3) You may need the change operations by changing the state of pins. for example, trigger=1; to trigger=0; same for halt and reedsw.
Attached is revised the revised spinport.comp
Last edit: 13 Aug 2025 20:30 by Benb.
Please Log in or Create an account to join the conversation.
- mgm
-
Topic Author
- Offline
- Elite Member
-
Less
More
- Posts: 210
- Thank you received: 13
15 Aug 2025 12:39 #333464
by mgm
Replied by mgm on topic Switch relay in a defined x position
Hello Benny,
That's it now... Thank you very much for your support.
The only thing I had to change was:
- motion.enable
to
- halui.estop.activate
The latest version is now attached.
That's it now... Thank you very much for your support.
The only thing I had to change was:
- motion.enable
to
- halui.estop.activate
The latest version is now attached.
Attachments:
Please Log in or Create an account to join the conversation.
Time to create page: 0.064 seconds