Hello Guest it is July 12, 2020, 03:02:43 PM

Author Topic: Mach4 Button OFFLINE  (Read 13433 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach4 Button OFFLINE
« Reply #140 on: February 14, 2018, 06:44:08 AM »
Hi,
that screenshot shows the old code, not the latest. It looks like its attached correctly.

Do you have a copy in a separate folder so you can single step through with the debugger?

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach4 Button OFFLINE
« Reply #141 on: February 14, 2018, 06:56:24 AM »
Hi,
I see there's something wrong with your button. A regular button has more events than the four shown in your screenshot?

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach4 Button OFFLINE
« Reply #142 on: February 14, 2018, 07:07:28 AM »
Hi,
yes you have 'Toggle' button not a regular button.

You've done it again, you've avoided doing as I've asked, in particular I've ALWAYS posted the code so that you could put it in a file so you could single step
through it but you insist on attaching it to a button from the get go. If you had done so then you'd know the code was fine therefore there must be something
wrong with the button or the codes attachment.

I've asked you REPEATEDLY to single step through the code. Please do it!

Craig

My wife left with my best friend...
     and I miss him!
Re: Mach4 Button OFFLINE
« Reply #143 on: February 15, 2018, 04:30:48 AM »
Hi,
bring patience, I'm not able ...!
I'm a mechanic, I have little experience with programs and computers!
is not it possible to make a video? otherwise we will not come to the conclusion here anymore!
I follow him carefully.
So if everything works, I load it on the Italian forum, to increase the knowledge and interest in Mach4 (which I find an excellent program, only needs support to entice people, Mach4 needs to grow as it deserves!)
Re: Mach4 Button OFFLINE
« Reply #144 on: February 15, 2018, 05:03:19 AM »
Hi,
no I will not try to make a video because you are wasting my time. I have given you instructions time and time again to run the CURRENT
code through the debugger. Have you done so?

I have told you that you need to use a standard button. Have you swapped your toggle button out?

I have posted to this thread dozens of times, considerably more than the number of lines of code. I have not only single stepped you through the code
I have microstepped you through it. I've done everything from proposing a solution to writing and debugging the code, I've done everything but
install it on you machine and you still wont follow the instructions to get it to work.

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach4 Button OFFLINE
« Reply #145 on: March 01, 2018, 06:04:33 AM »
Hi,
I have tried so many times ..
does not work.
Re: Mach4 Button OFFLINE
« Reply #146 on: March 01, 2018, 06:22:10 AM »
Hi,
have you put the latest code I posted into a separate file? Have you then run the code through the editor debugger?

Have you removed the Toggle button and replaced it with an ordinary button? I would suggest you do not attach any code to it.
Because you did not initially put the code in a separate file you have fragments of code, a lot of it buggy, distributed through out Mach.
The whole point of putting the code in a file was to prevent just that. It is now going to be hard to track it all down and get rid of it.

The code works fine here, I'm guessing you have not set it up as I instructed.

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach4 Button OFFLINE
« Reply #147 on: March 06, 2018, 04:01:18 PM »
Hi,
I'm not capable with your method.
But I have some news .. !!
I did it, it's improvable, but it works!
if I can make improvements I warn you!
in any case, I thank you as always for your help!



--Remember Position
RememberPosition()
--One way
local inst = mc.mcGetInstance() -- Get the instance of Mach4
local xset = mc.mcAxisGetMachinePos(inst, 0) -- Get current Machine Coordinates
-- local yset = mc.mcAxisGetMachinePos(inst, 1) -- Get current Machine Coordinates
 local zset = mc.mcAxisGetMachinePos(inst, 2) -- Get current Machine Coordinates
 xval = tostring(xset)
-- yval = tostring(yset)
 zval = tostring(zset)
 mc.mcProfileWriteString(inst, "RememberPos", "XRemem", xval) --Create a register and write the machine coordinates to it
-- mc.mcProfileWriteString(inst, "RememberPos", "YRemem", yval) --Create a register and write the machine coordinates to it
 mc.mcProfileWriteString(inst, "RememberPos", "ZRemem", zval) --Create a register and write the machine coordinates to it




-- Return To Position
ReturnToPosition()
local inst = mc.mcGetInstance() -- Get the instance of Mach4
local xrememval = mc.mcProfileGetString(inst, "RememberPos", "XRemem", "NotFound") -- Get the register Value
--local yrememval = mc.mcProfileGetString(inst, "RememberPos", "YRemem", "NotFound") -- Get the register Value
local zrememval = mc.mcProfileGetString(inst, "RememberPos", "ZRemem", "NotFound") -- Get the register Value
mc.mcCntlMdiExecute(inst, "G00 G53 Z0.0000 \n G00 G53 X" .. xrememval .. "\n G00 G53 Y" .. yrememval .. "\n G00 G53 Z" .. zrememval)
Re: Mach4 Button OFFLINE
« Reply #148 on: March 06, 2018, 04:28:58 PM »
Hi,
I presume that you still have a toggle button and therefore require two scripts, one for each toggle state.
If thats the case then the code you have posted looks good.

Good work.

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach4 Button OFFLINE
« Reply #149 on: March 17, 2018, 12:46:15 PM »
Yes, exactly, that's what you say.
This way it works well, and this is enough for me.

Rather..
little off topic ...
I'm noticing so many problems with the Mach4 lathe.
1-The radius compensation works very badly (if you have 2 spokes, one of which is concave and one convex in a row, it generates wrong movements!).
2-blacklash DOES NOT WORK !!!
3-in the double line G76 there are errors on the "Q" parameters !! in addition to positioning, you are tied to a certain distance in X
4: the single line G76 can not use correctly.
5: the G83 every time the tip returns, hits the bottom of the hole of the previous increment.
I hope to be the cause, in the sense that I was wrong to program (but I do not think).
close off topic.
question.
are they still working on Mach4 ??
Mach4 is a beautiful software!
but he needs to work on it again, and for a long time they do not update the versions ...!
I thank everyone again for the help you gave me!
« Last Edit: March 17, 2018, 12:52:44 PM by daniba73 »