Hello Guest it is November 16, 2019, 06:33:34 PM

Author Topic: Save button - Save WCO, TLO,... like on exit  (Read 174 times)

0 Members and 1 Guest are viewing this topic.

Save button - Save WCO, TLO,... like on exit
« on: October 08, 2019, 09:57:17 AM »
Hi,

At least once a Week Mach 4 crashes.
Most of the time when I press "Load" it hangs and do not longer react so I have to end the task.
I never could find out why - but this is not the toppic here and only the background why Im asking...


The biggest problem with this is, that I loose the WCO, new set Tool lengths, and other settings because Mach 4 saves everything only on exit.
For that reason, I started to make a Picture of the WCO coordinates every time I mill a part with multiple files.
As you can imagine, this is irritating doing it 100 times per week for 1 Crash per week.

But a lot more convenient could be a "Save" button.
Just save everything - like on exit.

But I could not find out how to do this?
Seems not to be done in the wx4 screen unload script not in another place I can find.
Any tips if it is possible or how to do it a "Save all" button (script for a button)?

Offline Chaoticone

*
  • *
  •  5,628 5,628
  • Precision Chaos
    • View Profile
Re: Save button - Save WCO, TLO,... like on exit
« Reply #1 on: October 09, 2019, 10:49:58 AM »
Hanging on Load Gcode sounds like the directory last used might not be available. Is that the case and if so, why? You aren't trying to load Gcode files from some network location are you?

Yeah, no script necessary to save the things you are talking about. Mach handles that in the core. The problem you are having is crashing. Mach can't save things when it crashes........ it's crashed. 
;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: Save button - Save WCO, TLO,... like on exit
« Reply #2 on: October 09, 2019, 11:49:22 AM »
Yes, Its from Network. Of course wired with gigabit to NAS.
Maybe this happen when the Server HDDs are in energy save and need to spin up - take 1-2 seconds.
Using USB sticks for bringing a nc program from CAD to production is not really an option in the 21st century...
But again - not the deal of this topic even if this is not nice from Mach 4.


Found:
rc = mc.mcProfileSave( number mInst)
mcToolSaveFile(mInst);
mcFixtureSaveFile(mInst);

Any idea if it is possible to build this "Save" button with this?
Found no example how to use this and what is the correct instance number...

Offline Chaoticone

*
  • *
  •  5,628 5,628
  • Precision Chaos
    • View Profile
Re: Save button - Save WCO, TLO,... like on exit
« Reply #3 on: October 09, 2019, 12:51:58 PM »
Gcode being executed by Mach is to reside on the same drive as Mach. So you are right. Executing from a USb stick would be just as ridiculous. You can have your files on a network drive but you should not execute it from there. Copy from network and put a copy on the same drive as Mach unless you want problems. You waiting for 2 seconds for a drive to spool up is not a problem. Mach waiting for it is.
;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: Save button - Save WCO, TLO,... like on exit
« Reply #4 on: October 09, 2019, 01:24:49 PM »
Thread is about a save button!

Think about a power outage once a month or any other imaginable "Mach dones not close graceful".
I dont want to lose parts on those accidents and the only think against this is currently take photos of the DRO after each set zero... -> Bad and annoying


Someone has a hint on this save button thing?
Toppic is only about this "save" all settings button and if it is possible to build one.

Offline Chaoticone

*
  • *
  •  5,628 5,628
  • Precision Chaos
    • View Profile
Re: Save button - Save WCO, TLO,... like on exit
« Reply #5 on: October 09, 2019, 02:38:01 PM »
Excuse me........

Quote
At least once a Week Mach 4 crashes.
Most of the time when I press "Load" it hangs and do not longer react so I have to end the task.
I never could find out why - but this is not the topic here and only the background why Im asking...

Mach crashing is what is causing the problem you are trying to manually get around period. The fix is not to add stuff for when it crashes. The fix is to do things correctly so it does not crash. This is like asking the best thing to do everytime you shoot yourself in the foot. The correct answer is to quit shooting yourself in the foot.

For your power outages, I wouldn't consider running any PC without a UPS (battery backup). Improper shutdown of a PC can corrupt the entire hard drive and ruin hardware components. I mean after all, when the power unexpectedly goes out do you get advance notice so you can manually click a button to force a save (that already happens automatically when Mach closes gracefully)?

No, I don't think I will think about "any other imaginable Mach dones not close graceful". That is your job. Once you figure out all the ways you can do it you should do whatever it takes to stop it. Mach that crashes if used correctly will never knowingly be sent out. But it is designed and coded with a few expected environmental variables that is your job to provide (like a reliable power source and Gcode files residing on the same drive as Mach's install directory).

Sorry if that is not what you want to hear but I refuse to give bullets to anyone planning to shoot their self with it.
;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: Save button - Save WCO, TLO,... like on exit
« Reply #6 on: October 10, 2019, 01:02:28 AM »
I can not agree.

For shure you are right to always fight the source of the trouble instead the sympthom if possible.
But for a robust system you never trust on one fix.
There will always a person who inure his foot, and he is then more than happy that there is an ambulance to call.
Try to remove all weapons (in the us   ::) ) or all other sharp objects which might hurt you. This will just not work to pack the world in cotton wool.


There is no real reason for storing stuff only in ram and loosing it on meteor income, flood, storm, water pipe break, fire, windows update,... If you find a way to prevent from 100% of all possible desasters you won the holy grail.

My other mills (bCNC) store when you set the WCO to zero and that is even a free software.
In mach this can also be automated, if such a script/button exist.
For example also save when you change something like WCO or test all minute if a change in settings happend then automatically save.

Re: Save button - Save WCO, TLO,... like on exit
« Reply #7 on: October 10, 2019, 04:40:06 AM »
Found a solution - following script will save DRO and Tool offsets.

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

mc.mcProfileSave( 0 )
mc.mcToolSaveFile( 0 )
mc.mcFixtureSaveFile( 0 )

This also can be included to be called each time you zero an axis.
Then there can never be data loss, even after crash of mach for whatever reason.
If you save 1 Part in 10 Years with this, it was worth the effort :).