Hello Guest it is April 19, 2024, 09:57:43 PM

Author Topic: GO TO WORK ZERO - ERROR  (Read 6871 times)

0 Members and 2 Guests are viewing this topic.

Re: GO TO WORK ZERO - ERROR
« Reply #10 on: September 17, 2017, 05:56:27 PM »
Hi Rustin,
I think that the repeated Z0 is to allow you to customise. For instance you might have clamps in the way so
you might wish to go to X0Y0 but Z50 to clear the clamp and THEN goto X0Y0Z0.

Note that if you alter this piece of code you have customised the screen set. At some later date when you update
Mach again the screen set will be overwritten and your edits/tweaks will be lost. To avoid this when you edit a screen set
you should save it with a distinct name and all your tricks won't get overwritten.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: GO TO WORK ZERO - ERROR
« Reply #11 on: September 17, 2017, 05:59:03 PM »
I got it figured out, with the following code in the screen editor:

GoToWorkZero()
local inst = mc.mcGetInstance()
mc.mcCntlMdiExecute(inst, "G00 G90 G53 Z0\nG00 X0 Y0\nG00 Z0")


I found a couple issues, the first being the "--" at the beginning, which ignores anything following! However, I had to add the "G90" as well, to switch to absolute mode.
Not sure if I need to put a "G91" at the end, to go back to Incremental, or is that automatic for jogging?

Re: GO TO WORK ZERO - ERROR
« Reply #12 on: September 17, 2017, 06:01:02 PM »
Craig,
Thanks for the info on saving the profiles. It looks like there will be plenty "tweaks" and I definitely don't want to lose them!
Re: GO TO WORK ZERO - ERROR
« Reply #13 on: September 17, 2017, 06:28:24 PM »
Hi Rustin,
glad you got it sorted.

The '--' means that everything on the same line after it is a comment. It is common practice to leave
an unused statement in a block of code by 'commenting it out'. It allows for someone else to come along
and see the alternative approach. It is also used in Mach to describe how a function works at some location
likely to be interrogated by a user while the ACTUAL working code is elsewhere, maybe buried in a whole
bunch of other code.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: GO TO WORK ZERO - ERROR
« Reply #14 on: September 18, 2017, 01:40:53 AM »
Hi Guys,

I'm not  a programmer nor do I have any inclination to be one.  However. looks like I'm going to have to start learning to sort out the issue.  I have a general grasp of Gcode so I just have to see how and what file you are editing.  I only want to set X & Y to go back to work zero without any change in Z.

Sorry we're a bit slow in Australia......something to do with being upside down.  :-)

Cheers

Daryl
Re: GO TO WORK ZERO - ERROR
« Reply #15 on: September 18, 2017, 02:48:25 AM »
Hi,
Whoa there pal, I'm from New Zealand and I can program just fine...its got nothing to do with being upside down but how much your
prepared to try to master something. Aussies are usually pretty fair at sticking to it even if somewhat behind us Kiwis!

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: GO TO WORK ZERO - ERROR
« Reply #16 on: September 18, 2017, 02:57:55 AM »
Hi Daryl,
jokes and jibes aside this is a minor piece of work...to do and understand it is very satisfying and the true power of Mach4 becomes apparent.

Mach4 has now gathered a lot of new users but many are like yourself very unsure or unwilling to get to grips with LUA. I can myself only claim
beginner status but what I have learnt is that Mach4 is going to absolutely HOSE Mach3 and the momentum is building. I urge you not to miss out by
Quote
I'm not  a programmer nor do I have any inclination to be one.
If you want to be an expert CNCer that can build and customise machines you need to do this.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: GO TO WORK ZERO - ERROR
« Reply #17 on: September 18, 2017, 03:09:46 AM »
Hi Craig,

THANKS.....I am actually a scratch builder of  a very capable CNC machine. (Number 2) and I do take your point.

However, my philosophy on this is - I spend my dollars and purchase a piece of software.  I understand I have to set up I/O's, motor tuning etc and don't have an issue doing this.  I want to be able to come out to my workshop turn everything on and produce work.  Something that was happening for me without issue until I updated to the latest version.  Why should I then have to alter a script which I have never touched but now find is giving me an issue?



Cheers

Daryl

Re: GO TO WORK ZERO - ERROR
« Reply #18 on: September 18, 2017, 03:17:00 AM »
Hi,
if it was working why did you update?

People are wedded to the idea that software needs to be updated all the time which is rubbish. You might need anti-virus updates but does your machine
get exposed to viruses, mine sure as hell doesn't.

If you follow the advice I gave Rustin you will find that YOUR screen set, that is to say one of the standard screensets which you have added to and tweaked
remains constant when you update. You only need to update if theres something new that you want.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: GO TO WORK ZERO - ERROR
« Reply #19 on: September 18, 2017, 03:20:06 AM »
Good question,

I updated because I got an Email from PMDX (the supplier of my BOB) stating there was an issue with their plugin and Mach4 and I needed to update both.