Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: joepardy on June 25, 2009, 03:06:27 PM

Title: Saving the Tool Table Changes
Post by: joepardy on June 25, 2009, 03:06:27 PM
I have integrated a tool height probe & macro into my code.  It works flawlessly.  It calculates the height of the tool, updates the tool table, and I am able to use the new tool offset when I run my next program.

HOWEVER, when I exit Mach 3, all of the changes to the tool table are erased.

I have tried hitting "save settings" before closing, but that does not work either.

Is there a way to force a write to the tool table inside my VB script?

Help! ??? ???
Title: Re: Saving the Tool Table Changes
Post by: Hood on June 25, 2009, 03:09:55 PM
It should save fine, check that the Tools3.dat in you profile macro folder is not read only.
Hood
Title: Re: Saving the Tool Table Changes
Post by: joepardy on June 25, 2009, 03:32:06 PM
The machine is running a job at the moment, so I dont want to mess with the computer.  But I assume that it is not read only because if I manually change an offset, hit "apply" - then "ok" - then "save settings" - then exit and reopen the program, the change is still there.

Title: Re: Saving the Tool Table Changes
Post by: Hood on June 25, 2009, 03:38:05 PM
Yes, it must be ok then. Do you not get a pop up screen asking if you want to save the tool table when you shut down?  Try going to General Config and checking the Optional Offsets and see if that works.
Hood
Title: Re: Saving the Tool Table Changes
Post by: joepardy on June 25, 2009, 03:54:28 PM
It does not ask about saving the tool table.  It does ask about saving fixtures when closing.

Optional Offset Save, Persistent Offsets, and Persistent DROs are all checked.
Title: Re: Saving the Tool Table Changes
Post by: Hood on June 25, 2009, 05:13:42 PM
Thats strange as Optional Offsets checked should mean you dont get the message at close to save the offsets, it should do it automatically, or at least I think thats the way it is from memory.
Hood
Title: Re: Saving the Tool Table Changes
Post by: vmax549 on June 25, 2009, 10:32:40 PM
COuld you post the code you used to do the update?

Just a thought, (;-) TP
Title: Re: Saving the Tool Table Changes
Post by: joepardy on June 26, 2009, 08:19:42 AM
Vmax549,

I do not think there is anything wrong with the code segment, but here it is.  I set my router bits up with collars, so, once they are set, they do not change.  I can remove them from the router, put them back in, and as long as they collar contacts the collet, all is good.  So, you will see in my code segment that I initialize the machine before calibrating the height of the bit.  In other words, it is intended to be run as a separate program, not as a subroutine within the program.

I did some additional testing on the when it saves.  This is what I found.

Run the snippet ... Exit the program ... tool offsets are not saved
Run the snippet ... Run Config/Save Settings ... Exit the program ... tool offsets are not save
Run the snippet ... Go into the Tool Table ... Select APPLY ... Exit the program ... TOOL OFFSETS ARE SAVED

Apparently, although the tool table is updated within Mach by the snippet, they will not be written to disk unless I hit APPLY within the tool table.
Title: Re: Saving the Tool Table Changes
Post by: vmax549 on June 26, 2009, 02:34:50 PM
I wan't questioning the code just needed the example to test the same way you do it (;-)

Your approach USED to work just fine back when Art first created the settoolparam() call.

Just a thought, (;-) TP
Title: Re: Saving the Tool Table Changes
Post by: vmax549 on June 26, 2009, 02:42:57 PM
YEP it is definantly broken , YOU need to fill out a BUG report (;-)

(;-) TP
Title: Re: Saving the Tool Table Changes
Post by: joepardy on June 26, 2009, 02:43:32 PM
OK ... it is just really weird that it stores it in the tool table - but really isn't saving it.  I am guessing that its one of those little nagging software bugs in the program.  I have seen some other kind of flakey things happen from time to time.  You know where you go into the program, change a setting, are pretty sure that you saved everything, but when you go back, nothing has changed.

I am hoping that the rewrite that Brian is doing on Mach 3, Version 4 will take care of some of these type of little problems.  I know that he is doing a lot of work on offsets - primarily with regards to screen display
Title: Re: Saving the Tool Table Changes
Post by: vmax549 on June 26, 2009, 02:48:11 PM
YEP he also totally rewrote the XML systems as well this should not be a problem in the future.  BUT he will also have to rewrite some of the VB calls as well to account for the changes.

I think this is one of the cases where the tool data you see is just mirror of the actual data and nothing updates unless you manually save the table to disk.  I think something changed from the time Art originally wrote it till now in the way things were saved and this call got missed.

Just a thought,

(;-) TP
Title: Re: Saving the Tool Table Changes
Post by: joepardy on June 26, 2009, 02:56:54 PM
You are probably right.  My background is in Systems Analysis so I have written a lot of software (albiet quite a few years ago) and this is an easy thing to do.
Title: Re: Saving the Tool Table Changes
Post by: vmax549 on June 26, 2009, 03:10:54 PM
YOU can use this to include in your code after your update. It will save the tool table, actually it brings up the tool table save screen AND it does save the table.

DoOemButton(121)

(;-) TP
Title: Re: Saving the Tool Table Changes
Post by: joepardy on June 26, 2009, 03:16:26 PM
Thanks.

I will drop it in my routine.