[SOLVED] how to i can to setup a output for to activate a relay?

More
15 Jul 2022 10:45 - 16 Jul 2022 20:21 #247364 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
Last edit: 16 Jul 2022 20:21 by Nest.

Please Log in or Create an account to join the conversation.

More
15 Jul 2022 11:17 #247369 by tommylight
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.
The following user(s) said Thank You: Nest

Please Log in or Create an account to join the conversation.

More
15 Jul 2022 13:14 #247379 by Nest
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

Please Log in or Create an account to join the conversation.

More
15 Jul 2022 19:46 #247410 by chris@cnc
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
On
#! /bin/bash
#------ M100 Laser on ---------
halcmd setp *your-output* true
exit 0
Off
#! /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.

More
15 Jul 2022 21:19 #247412 by JPL
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.

More
16 Jul 2022 20:18 #247499 by Nest
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:
#! /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: PCWjmelson
Time to create page: 0.080 seconds
Powered by Kunena Forum