Hello Guest it is March 29, 2024, 03:34:06 AM

Author Topic: Connection between button function and script  (Read 2965 times)

0 Members and 1 Guest are viewing this topic.

Connection between button function and script
« on: November 23, 2017, 12:33:42 PM »
When I'm in edit mode and have a button highlighted, it shows eg, btnReturn, how does Lua know that this function is been call?  I assume if a button has the name of btn(114), its just been placed but not been given a function yet?  The button (btn(114)) has been titled "Touch" but doesn't seem to do anything.

I have downloaded the latest version, expecting it all to work, seems like I was wrong, how much does one have to do to get just whats on the display to work.....
Re: Connection between button function and script
« Reply #1 on: November 23, 2017, 01:04:39 PM »
This is the problem i am having. Mach 4 seems to be really good but i think the amount of learning into LUA you need to do just for basic functions is a mistake.
Have you tryed going to "Screen Load" and then loading the wx4.set screen? Apparently this is the most up to date screen set and has the probing screen included and working.
Also you will need to edit you "A" axis out of the "Go to Zero" button if you only have 3 Axis as it will try to command A Axis to move and error out.
Re: Connection between button function and script
« Reply #2 on: November 23, 2017, 01:20:50 PM »
So when say edit out, edit out where, in the Lua (wx.4.set) script, or Darwin? And if its in the script how do I find it and what do I do to edit it out or make it a comment type line?

Thanks btw
Re: Connection between button function and script
« Reply #3 on: November 23, 2017, 01:34:45 PM »
"Operator"
"edit screen"
Under the title "screen tree Manager" click on "wx4"
Then under the screen tree manager youll see a page with a lightening signal on it click that
Then click on the "screen load script"
Scroll down till you find this...
---------------------------------------------------------------
-- Go To Work Zero() function.
---------------------------------------------------------------
function GoToWorkZero()
    mc.mcCntlMdiExecute(inst, "G00 X0 Y0 A0")--Without Z moves
    --mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 A0\nG00 Z0")--With Z moves
end

Change this to
either this....

---------------------------------------------------------------
-- Go To Work Zero() function.
---------------------------------------------------------------
function GoToWorkZero()
    mc.mcCntlMdiExecute(inst, "G00 X0 Y0")--Without Z moves
end


Or if you want Z moves change it to this....

---------------------------------------------------------------
-- Go To Work Zero() function.
---------------------------------------------------------------
function GoToWorkZero()
    mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0\nG00 Z0")--With Z moves
end

Hope this helps.
As i say this is for the wx4.set screen and only if your using 3 axis
Re: Connection between button function and script
« Reply #4 on: November 23, 2017, 02:24:18 PM »
Thanks, I do have 3 axis at moment, so will use that. So does this mean that the "Touch" button will now work or does that also need to be added to the script as it only has a title btn(114)?

Just noticed its gone to demo mode, should it do that when you up-load to the newer version 3841?
Re: Connection between button function and script
« Reply #5 on: November 23, 2017, 02:28:37 PM »
Do u by any chance know why I get the following error failed  mwSim.m4pw?
Re: Connection between button function and script
« Reply #6 on: November 23, 2017, 02:31:29 PM »
Hi,
I'm not at all sure that Darwin supports Touch.

Many of the interesting Mach functions require implementation in the motion controller. Darwin is a motion controller
but is quite limited in features it supports. My ESS runs the Touch module fine.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Connection between button function and script
« Reply #7 on: November 23, 2017, 02:39:32 PM »
Hi Craig
When you look at the "Touch" button in the script what name / title does it have?  Does yours also have btn(114) or something else like the return button has btnReturn?

Thanks
Dion
Re: Connection between button function and script
« Reply #8 on: November 23, 2017, 02:42:13 PM »
Like Joe says do some research make sure that the Darwin actually supports the probe and touch function first.
If it does then the "Touch" button in the wx4.set screen should work with no extra scripting i think.
The mwsim.m4pw is your motion control plugin i think?
This probably means Mach is having trouble talking to your motion controller? But im not 100% sure?

Re: Connection between button function and script
« Reply #9 on: November 23, 2017, 02:57:12 PM »
The LED comes on when I touch the plate, What happens in the video that I've seen is that a window opens up, in mine it doesn't.  So is that a module that needs to be added? Please have a look at the script in yours and let me know what the button reference is? Thanks