Hello Guest it is March 28, 2024, 06:56:50 PM

Author Topic: Mach 4 Touch button problems  (Read 3894 times)

0 Members and 1 Guest are viewing this topic.

Mach 4 Touch button problems
« on: February 10, 2017, 01:58:20 PM »
Hello!

The other day I started my computer and fired up my cnc to do a simple job.
I did as I always do, reference the machine and then jog it manually to the place on my table where the part/material is and then manually zero X and Y where I want it to be zeroed, and then I use the tool hight function (Touch button) but it wouldn't do a thing when i press the button? No response at all? No window?

Restarted Mach 4 but when I closed Mach? A error window pops up? tframe something something... something about the lua script?

I tired to create a new VxRouter profile and copy all the lua code from that profile in to my existing configured profile to see if it helped but without any success? I haven't done any major changes to anything in the lua script other than adding some lines to get the vfd (modbus) configuration working? With some help of a nice guy on this forum? I don't think this has anything to do with those changes? It worked after all those modifications?

Any ideas ?

https://s24.postimg.org/3k100ev79/IMG_0338.jpg
« Last Edit: February 10, 2017, 02:02:54 PM by Zuxztah »

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Mach 4 Touch button problems
« Reply #1 on: February 10, 2017, 03:13:51 PM »
Well, if you have been customizing things no one else can say. Best practice is to try with a unedited clean install of Mach4 using default profile, screens, modules, etc. (nothing at all modified). If it works as it should then you have to start removing your modifications until the error goes away. Or copy all the defaults and start putting the mods back in until it breaks.



When that message pops up you can go to the line it reports is the problem and see what you can figure out. To look at it go to Operator, Lua Script and see what line 655 has in it and all things related to it. But if you have been editing any scripts, it may not still be line 655.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Mach 4 Touch button problems
« Reply #2 on: February 10, 2017, 08:09:54 PM »
I understand what you mean, it happened so sudden with no actual reason? It worked the day before? :/

Offline Pedio

*
  •  200 200
    • View Profile
Re: Mach 4 Touch button problems
« Reply #3 on: February 14, 2017, 08:25:41 PM »
Check the LED window to see if the probe is already active. I had a short in the wires and the probe was activated when I tried to do a tool height set.

my 2 cents,
P
Re: Mach 4 Touch button problems
« Reply #4 on: March 18, 2017, 05:19:38 AM »
hello guys! still no solution... ive tired to replace the script from a newly created profile, copy and pasted it to my existing profile, it stopped working without any reason? dont know what to do...

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Mach 4 Touch button problems
« Reply #5 on: March 18, 2017, 07:26:28 PM »
Open up the screen editor and locate the Screen Unload Script replace with this and see how you go,

Code: [Select]
inst = mc.mcGetInstance()

local IsOpen = mc.mcProfileGetString(inst, 'TOffParams', 'ToffDialog', '0') -- Get the Value from the profile ini.
if (IsOpen == '1') then --The TouchOff dialog is open and we need to close it
    mc.mcProfileWriteString(inst, 'TOffParams', 'ToffDialog', '0') -- this line has been added
    Tframe:Close()
    Tframe:Destroy()
end

DazTheGas
New For 2022 - Instagram: dazthegas
Re: Mach 4 Touch button problems
« Reply #6 on: March 19, 2017, 04:40:56 AM »
Hi! ;) the new code fixed the problem clean! it's working as it used to,   I don't know what went wrong to begin with... XD it just appeared. Thanks a lot for the help! so happy to finally get that problem sorted out ;)

Offline thosj

*
  •  532 532
    • View Profile
Re: Mach 4 Touch button problems
« Reply #7 on: March 19, 2017, 09:45:43 AM »
It will be interesting to hear why changing the Screen Unload Script was necessary, and what about the code that was in the Screen Unload Script originally, the part about siglib? We don't need that, but do need this code to tell if the TouchOff dialog is open and close it?

OH, and where is the profile ini? I don't seem to have a profile ini on either of the two machines I have Mach4 installed on.

Just curiosity stuff, figured I could sort of hijack the thread seeing as the OP's issue was solved.  >:D

Tom H.
--
Tom

Offline DazTheGas

*
  •  778 778
  • DazTheGas
    • View Profile
Re: Mach 4 Touch button problems
« Reply #8 on: March 19, 2017, 11:16:18 AM »
I must ask microsoft why windows on my dev machine updated last night, actually come to think of it i wonder if autodesk update 360 but dont tell us  ;-)

Seriously though I think I answered that question for you in another thread.

You dont have a profile.ini, your profile is your machine.ini that is loaded into mach4 using the wxConfig class, so any changes you make using any of the mcProfile... API commands will change what is in this profile and then be commited back to the machine.ini on close of mach4 or using mcProfileFlush / mcProfileSave.

The error for Zuxztah is just one of those things where the profile setting for ToffDialog was stuck on a value of 1, so although mach4 thinks the dialog was open somewhere it wasnt so there was no Tframe to close this was causing the fault. So one simple extra line stops this from happening again.

DazTheGas
New For 2022 - Instagram: dazthegas