[SOLVED] how to i can to setup a output for to activate a relay?
- Nest
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 100
- Thank you received: 10
15 Jul 2022 10:45 - 16 Jul 2022 20:21 #247364
by Nest
[SOLVED] how to i can to setup a output for to activate a relay? was created by Nest
My hardware is a MESA 7i96
how to i can to setup a output for to activate a relay?
I know that with the M7 command the coolant pump is activated
Is there a command to activate a relay or do I have to invent a command?
Thanks you
how to i can to setup a output for to activate a relay?
I know that with the M7 command the coolant pump is activated
Is there a command to activate a relay or do I have to invent a command?
Thanks you
Last edit: 16 Jul 2022 20:21 by Nest.
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 20202
- Thank you received: 6876
15 Jul 2022 11:17 #247369
by tommylight
Replied by tommylight on topic how to i can to setup a output for to activate a relay?
Moved to "driver boards".
-
Yes there are commands to activate relays for everything, just have to be set in hal.
The wiring explanation i am leaving to someone who does a better job at explaining.
-
Yes there are commands to activate relays for everything, just have to be set in hal.
The wiring explanation i am leaving to someone who does a better job at explaining.
The following user(s) said Thank You: Nest
Please Log in or Create an account to join the conversation.
- Nest
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 100
- Thank you received: 10
15 Jul 2022 13:14 #247379
by Nest
Replied by Nest on topic how to i can to setup a output for to activate a relay?
Thank you for moving the thread to where it belongs, sorry for the inconvenience.
I want to add a laser module to my cnc but I have to use two outputs, one for the power of the laser that I already have solved with (M03 $1) and another output to activate the laser and that it is not always switch on, and that output is the one that is missing
Thanks you
I want to add a laser module to my cnc but I have to use two outputs, one for the power of the laser that I already have solved with (M03 $1) and another output to activate the laser and that it is not always switch on, and that output is the one that is missing
Thanks you
Please Log in or Create an account to join the conversation.
- chris@cnc
- Offline
- Platinum Member
-
Less
More
- Posts: 529
- Thank you received: 139
15 Jul 2022 19:46 #247410
by chris@cnc
Replied by chris@cnc on topic how to i can to setup a output for to activate a relay?
How about one custom M-code?
For example M100 -> laser on M101 laser off.
Example:
linuxcnc.org/docs/stable/html/gcode/m-code.html#mcode:m100-m199
OnOff
For example M100 -> laser on M101 laser off.
Example:
linuxcnc.org/docs/stable/html/gcode/m-code.html#mcode:m100-m199
On
#! /bin/bash
#------ M100 Laser on ---------
halcmd setp *your-output* true
exit 0
#! /bin/bash
#------ M101 Laser off ---------
halcmd setp *your-output* false
exit 0
The following user(s) said Thank You: Nest
Please Log in or Create an account to join the conversation.
- JPL
- Offline
- Platinum Member
-
Less
More
- Posts: 335
- Thank you received: 118
15 Jul 2022 21:19 #247412
by JPL
Replied by JPL on topic how to i can to setup a output for to activate a relay?
Since you are already using M3 $1 to activate the laser you can maybe simply use M3 $2 to turn it on using an output associated with spindle #2 ?
Please Log in or Create an account to join the conversation.
- Nest
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 100
- Thank you received: 10
16 Jul 2022 20:18 #247499
by Nest
Replied by Nest on topic how to i can to setup a output for to activate a relay?
Hello, it is done, I have used the commands M101 to activate and M102 to deactivate. I have followed the instructions and it is very simple.
first we create two files with notepad one called M101 and the other called M102 without extension,
inside I put: M101:
In M102:
The path where to guide the files is:
/home/nameuser/linuxcnc/nc_files/
this path is in the .ini file in section [Display] in the line PROGRAM_PREFIX
and that's it
Thanks you so much
first we create two files with notepad one called M101 and the other called M102 without extension,
inside I put: M101:
#! /bin/bash
#------ M101 Laser on ---------
halcmd setp hm2_7i96.0.ssr.00.out-02 true
exit 0
In M102:
#! /bin/bash
#------ M102 Laser off ---------
halcmd setp hm2_7i96.0.ssr.00.out-02 false
exit 0
The path where to guide the files is:
/home/nameuser/linuxcnc/nc_files/
this path is in the .ini file in section [Display] in the line PROGRAM_PREFIX
and that's it
Thanks you so much
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
Moderators: PCW, jmelson
Time to create page: 0.127 seconds