Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Fred_evans on January 25, 2015, 12:56:37 PM

Title: code to see if homed
Post by: Fred_evans on January 25, 2015, 12:56:37 PM
Hello chaps

is there a word (or a way ) to check if the machine has been homed?

regards

fred

Title: Re: code to see if homed
Post by: ger21 on January 25, 2015, 01:04:11 PM
Check the status of the Ref'd LED's.
Title: Re: code to see if homed
Post by: Fred_evans on January 25, 2015, 01:20:35 PM
Hello ger - yes i guess i got that - you mean the 2 led's on the top right of the
1024.lset screen??

I was wondering if it could be done programmatically -??
Title: Re: code to see if homed
Post by: Hood on January 25, 2015, 03:28:12 PM
You can look at them via VB and do what you want depending on state.
If you want to use that from within G Code then save the VB as a m101.m1s (or higher number) You will then get Mach calling the macro from G Code by entering m101 (or whichever number you chose)

Hood
Title: Re: code to see if homed
Post by: Fred_evans on January 25, 2015, 11:08:50 PM
Thank you Hood-- Am i correctly presuming that VB is visual basic?
I have not got as far as writing macros yet.
I will pass on this for a few more sessions until i learn about macros

best regards

fred
Title: Re: code to see if homed
Post by: Hood on January 26, 2015, 01:43:06 PM
What is it you are trying to do
Hood
Title: Re: code to see if homed
Post by: Fred_evans on January 26, 2015, 02:32:23 PM

when i am running a part prg i would like to try and set up a message if the machine has not
been homed
Title: Re: code to see if homed
Post by: Hood on January 26, 2015, 02:46:12 PM
Ok, I presume this is a Lathe?
Attached is a simple macro, place it in the macro folder of the profile you are using. When you call M123 it will look to see if referenced, if not it will stop the code then pop up a message box. If it is referenced it will just continue and will display a message in the ticker saying so.
Hood
Title: Re: code to see if homed
Post by: Fred_evans on January 27, 2015, 02:23:50 AM
thanks ever so much-- will also  give me an oppurtunity to look at a macro