M1nn code to trigger an "alarm/sound loop" when G-code finishes?

More
3 years 9 months ago #262360 by clunc
Has anyone here seen user M-code to trigger an alarm or other audible indication that a program has finished?  It's fairly easy for a trained ear to understand when a program is done, but audio confirmation would be good to indicate when it has ended predictably.

Thank you.

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

More
3 years 9 months ago - 3 years 9 months ago #262361 by my1987toyota
Are you looking for just a simple buzzer or for it to make different sounds to mean different things when the program ends?
Also what kind of board are you using ? Parallel port , mesa, ect? You may also want to try an  M64 P code to turn the
alarm on and an M65 P code to turn it off.
Last edit: 3 years 9 months ago by my1987toyota. Reason: adding info

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

More
3 years 9 months ago #262417 by andypugh
The M100+ codes can be any executable file, so maybe

M101
Code:
#! /usr/env python import os file = "file.mp3" os.system("mpg123 " + file)

Maybe?

mpg123 is not part of a standard LinuxCNC install, you would need to install it, or some other sound-making app.

There is also the possibility of triggering the pc speaker direct from HAL. There is a component "hal_speaker"
github.com/LinuxCNC/linuxcnc/blob/2.8/sr...rivers/hal_speaker.c
Though it seems to have no documentation so is hard to know about.
So feeding a siggen into that is a way to make an (unpleasant) noise.
The following user(s) said Thank You: my1987toyota

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

More
3 years 9 months ago #262420 by clunc

Are you looking for just a simple buzzer or for it to make different sounds to mean different things when the program ends?
Also what kind of board are you using ? Parallel port , mesa, ect? You may also want to try an  M64 P code to turn the
alarm on and an M65 P code to turn it off.
 
I was thinking a simple noisemaker that passersby could recognize to go turn the machine off. 

I'm now running a 6i25 (5i25 variant) parport interface.

I was not familiar with M64/M65, but a software solution would be easier for me to pull off.

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

More
3 years 9 months ago #262421 by clunc

The M100+ codes can be any executable file, so maybe

M101
Code:
#! /usr/env python import os file = "file.mp3" os.system("mpg123 " + file) Maybe? mpg123 is not part of a standard LinuxCNC install, you would need to install it, or some other sound-making app.
 
Oh, boy, this is exactly the possibility I hoped for.

Code:
There is also the possibility of triggering the pc speaker direct from HAL. There is a component "hal_speaker" https://github.com/LinuxCNC/linuxcnc/blob/2.8/src/hal/drivers/hal_speaker.c Though it seems to have no documentation so is hard to know about. So feeding a siggen into that is a way to make an (unpleasant) noise.

Sound-making apps I got.  PC speaker possibly not (Dell OptiPlex 780)...

...WHICH I see makes questions about "how to make a sound" appear premature...

...AND a search of the "setup" documentation from Dell for that model for the word "speaker" turns up nil.

(I suppose this is the part where I go out and buy a sound board more expensive than the original computer.)

Thanks, all!

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

More
3 years 9 months ago - 3 years 9 months ago #262425 by Aciera
While it may not have a speaker it will probably have a connector for head phones to plug in an active speaker.
Last edit: 3 years 9 months ago by Aciera.

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

Time to create page: 0.349 seconds
Powered by Kunena Forum