Hello Guest it is September 20, 2026, 09:17:44 PM

Author Topic: Screen Edit not saving.  (Read 180 times)

0 Members and 1 Guest are viewing this topic.

Screen Edit not saving.
« on: September 13, 2026, 07:45:52 PM »
Hi,
I've just started migrating from Mach4Hobby to MachPro.

One of the small changes I want to make is to have a <Zero (axis)> button alongside each DRO, much like the Mach4 screen set I am so familiar with.

With the scree editor open  I have located the  text axis label, "X" for example. Rather than delete it I've 'kicked it out' of the veiwable window by nominating
its location at1005, rather than at 05, when it is viewable. That works and when saved it sticks for the next MachPro session.

What does not work is when I drag the <Zero X> button from 1017 to 017. The button displays and I can try to save the screen edit but when a new screen is
drawn the button is absent. I've tried dozens of variations on editing the screen and the attempt to save it without being able to get the edit to permanently save.
The AI coach suggests that I use <F5> to ensure that a new Lua script is generated prior to saving.....and it seems that it does not work.

Has anyone had any similar experience?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Screen Edit not saving.
« Reply #1 on: September 14, 2026, 09:27:51 AM »
Hi,

The reason for this is that the modularity of the screen is hard coded. The buttons you place there are being written and saved, but they are being overwritten. We reccomend using the Dashboards in order to get your Zero's on your main screen.

https://support.machmotion.com/books/cnc-software/page/machpro-widgets-dashboard-commands-and-function-buttons
Thanks,

Paul
Re: Screen Edit not saving.
« Reply #2 on: September 14, 2026, 02:40:47 PM »
Hi Paul,
I'me somewhat skeptical of your explanation.

If for instance the AxisPosition panel is hard coded then why is it that I can kick the AxisTextLabel out of the viewing area, and that is saved accross future MachPro sessions.
Also I have dragged the A (U)  and C(W) DROs, the AxisLoad indicator and the DistanceToGo DRO into the viewable are and they have all been saved.
Were they hard code then they too would be overwritten, but they are not.

When however  I drag a ZeroAxis button into the viewable are it is not saved?

In Mach4, say either wx4.set and wx6.set there was a ZeroAxis button alongside each DRO. It does not seem to much to ask that I be able to replicate that functionality,
and lo.......there is the button, already instantiated, coded and ready to go just by dragging it into the viewable pane, and yet it does not stick?

Actually I very much like the idea of all the different buttons/controls/DROs/LEDs/LabelTexts all be instantiated, ready to be included in a customers screen set, all you have to do
is drag them into the viewable area, but it would appear that some will not save. That means that the screen editor is broken, you could certainly do as I wish in Mach4, but now it does not work.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Screen Edit not saving.
« Reply #3 on: September 14, 2026, 03:01:40 PM »
Hi,
discovered another failure of the same type.

I have a button included in the ControlGroup of my current installation. It is to drill location pins in PCBs which I regularly make.

Just a few moments ago I tried to increase the size of the ControlGroup (in MachPro) to accommodate and instantiate a new button. Saved the screen and exited, but
when the screen is redrawn my screen edits are gone.

One of the greatest strengths of Mach4 was that you could place a button/LED/Control DRO etc wherever you pleased and attach whatever code you pleased to achieve the
functionality you wanted. MachPro doe not permit this. It is a fault that needs be fixed.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Screen Edit not saving.
« Reply #4 on: September 14, 2026, 03:49:00 PM »
Hi,
after some more experimenting I have found, as you suggested, that if the A and C axes are not enabled then the corresponding DROs disappear whether I deliberately
drag them into the viewable area or not.

The bottom line is that the Axis Position Group IS NOT EDITABLE........and that is faulty.

You've taken away one of the greatest strengths of Mach4.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Screen Edit not saving.
« Reply #5 on: September 17, 2026, 04:58:40 PM »
Hi Paul,
I want to drill down  a bit into why it is not possible to edit the screen outside of the dashboard areas.

In particular you say for instance that areas outside of the dashboard areas are hard coded. It is clear that I can try to edit those areas, and the features I wish to add
or modify show up and look even to have the appropriate code behind them to operate but I cannot overwrite the 'as shipped' screen.

Is it possible to make a copy (editable) of the 'as shipped' screen and have MachPro execute that copy rather than its current default?.

I am not hugely in favour of one screen over another, I care very little for cosmetics, but I care VERY much about functionality and productivity.

For example you posted that I could put <ZeroAxis> buttons in the dashboard area, as a solution to not being able to put the same feature alongside the DRO. Understand that
I have literally thousands of hours operating my machine, and it is now a matter of muscle memory that I zero an axis using the button alongside its DRO. Likewise I consider it normal
and logical to put a button (for drilling registration holes) with its underlying function coding in the file group alongside <CycleStart>,<Reset>,<Enable> etc.

I note from my other thread that MachPro is very strong on separating User Logic, User Mcodes etc from underlying 'as shipped' logic and functionality. Ostensibly meaning that future
updates will not overwrite user code. I understand that philosophy, but does that philosophy preclude me from doing it my way?

I do not update Mach4 all the time, in fact I am using build 4612, which is at least three years old. Simply put I do not feel the need to update software all the time. If what I've got works
then why bother?. If there were something genuinely new and advantageous in an update, well that's fine.....but more often than not updates contain little or nothing that improve
the parts coming out of the machine. This is a critical difference between me and many other hobbyists, I could care less about cosmetic changes but am hugely interested in
productivity enhancements.

Suffice it to say that I am accustomed to maintaining a 'fork' in Mach4 to handle those specific features that I have determined aid productivity, and accept responsibility of the complications
were I to do the same thing with the MachPro screenset.

Another question in a similar vein is whether it is possible to have multiple pages or tabs  in the screen set?. In particular I like to maintain a Machine Diagnostics tab. It has a data block that
maintains all the relevant offsets that apply at a given moment. I only use it occasionally and therefore do not want to waste real-estate on the main page (tab) for it.....but it is very convenient when
you're diagnosing a problem. The same tab (pictured) used to have a lot more LED's reflecting various IO's, but at the last update after which I had to re-do the screen I just could not be bothered with the
extra work, and in general they provided very little in the way of extra information pursuant to problem solving.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Screen Edit not saving.
« Reply #6 on: September 18, 2026, 10:17:13 AM »
Hi,

Great questions. I'll address them the best I can..

Yes, you can run your own copy of the screen
The screen is not compiled into MachPro. It is a data file (a .set file) that is loaded at startup. The built-in workflow is exactly what you described:

  • Load the shipped screen.
  • Enter screen-edit mode.
  • Use Screen → Save As and give it your own name (for example, MyMill.set).
  • MachPro remembers that filename in your profile and loads your copy from then on. The shipped file is never touched.
  • So the "fork" approach you are already used to works here too: maintain your own .set, take responsibility for merging changes if you ever do update, and keep the original as your fallback.
  • Nothing in the user-code separation philosophy prevents this. That philosophy is about protecting you from updates, not about locking you out of the screen.
Your offsets, and those zero buttons

Your fixture offsets live on the Fixtures tab. That page exists for exactly the purpose you described: viewing and managing all the offsets that apply at a given moment.

And on the muscle-memory point: when you switch into Edit Offsets mode, Zero DRO buttons appear right next to each DRO. So the "zero button beside the DRO" workflow you're used to is already built into the screen. It only appears in that mode, deliberately, so an accidental tap during normal running can't zero an axis mid-job.

The Fixtures tab also has spare room and editable fields. If you want to rearrange it or add your own touches (extra readouts, your registration-hole button, and so on), it's a normal editable area in your forked copy, no workarounds needed.

Why some areas can't be edited
The reason you can add things outside the dashboard but can't change certain existing elements is that those areas (like the DRO block) are single, self-contained controls rather than groups of individually editable pieces. The editor can show them and let you attach code, but it can't let you rearrange what is inside them. There is nothing to grab onto.

The practical workaround where it matters: place your own buttons as separate controls overlapping or immediately adjacent to a sealed block, with your own code behind them. To the operator, the result looks and behaves the same as if the button were part of the block.

Screen editing tips
Use the UserGUIModule for behavior instead of (or alongside) the screen
If you haven't explored it yet, the UserGUIModule is your best friend for screen work. It lets you change what is displayed, switch pages, set labels, and adjust properties programmatically, which means you can often get what you want without editing the screen file at all. For example, forcing a specific page on a button press:

Code: [Select]
function UserGUIModule.MyCustomPage()

    scr.ShowPage("CustomPageName")

end
--If you want the button in your dashboard.
function UserGUIModule.CreateUserCommands()
w.CreateCommandActionOption("ShowMyCustomPage", function(from_opr_panel) UserGUIModule.MyCustomPage() end)
w.CreateSimpleCommand("ShowMyCustomPage")
end
Alternatively, if you wanted to call anything from the UserGUIModule inside the screen with, lets say a custom button:
Code: [Select]
--Button Script
h.ScreenButtonCall(User.MyCustomPage(), ...)



Anything you can do with scr.SetProperty or scr.ShowPage in a module survives updates cleanly, because modules are user code and are never overwritten. A good strategy is: use Save As for layout changes you can't achieve any other way (button placement for muscle memory), and use the UserGUIModule for everything else (showing pages, relabeling, hiding and showing elements). That minimizes the diff in your forked screen and makes any future merge almost painless.

Why the self-contained controls are actually on your side
I understand the frustration, but the "hard-coded" composite controls exist for a reason. Actually several, and they all benefit you directly:

They can't be broken by screen edits. The DRO block contains logic that must always work: position display, units handling, work/machine coordinate switching. If its internals were exposed to the editor, one accidental drag in edit mode could silently break a safety-critical readout. You'd never know until you scrapped a part.
  • They can't be broken by screen edits. The DRO block contains logic that must always work: position display, units handling, work/machine coordinate switching. If its internals were exposed to the editor, one accidental drag in edit mode could silently break a safety-critical readout. You'd never know until you scrapped a part.
  • They come pre-automated. This is the big one, and it's easy to overlook if you're coming from Mach4. Much of what a Mach4 user had to hand-build, such as wiring buttons to function codes, scripting enable/disable behavior, linking LEDs to signals, and making DROs respond to units and coordinate modes, is already built into these controls. Drop a Cycle Start button on the screen and it works: no script, no signal plumbing, no PLC ladder. Anyone who set up a Mach4 screen from scratch knows how many evenings that used to take. MachPro's controls remove that startup burden. The screen is functional out of the box, and your time goes into the custom things your machine needs, not into re-implementing the basics.
  • They survive updates. Because the control owns its own layout and behavior, a MachPro update can improve or fix the DRO block and your forked screen picks up the improvement automatically. The .set file just references the control; it doesn't freeze its internals.
  • Your code still attaches to them. You can read their properties, react to their state, and build your own controls around them. They're sealed, not isolated.

In other words: the areas you can't edit are precisely the areas that either (a) would cost you parts if accidentally broken, or (b) would cost you evenings to rebuild if they weren't automated. The areas you can edit (pages, groups, dashboards, and your own buttons with your own code) are where all the productivity wins live anyway, and there the field is wide open.

Why custom buttons should use h.ScreenButtonCall()
When you add your own button to the screen, its script property (for example, the Left Up Script) should call h.ScreenButtonCall(...) rather than calling your function directly. It is the standard entry point the shipped buttons use, and it gives your custom button the same protection and polish for free:
  • Password protection is enforced automatically. If you set a password level on the button in the screen editor, ScreenButtonCall checks it before your code runs. No extra code in your handler, and no chance of an unauthorized operator triggering your function.
  • Errors can't crash the screen. Your handler runs inside a protected wrapper. If your Lua code throws an error, you get a warning message instead of a dead UI.
  • Every press is logged. The button's label and press are written to the log, which makes diagnosing "what did the operator do just before this happened" much easier.
  • Standard argument handling. It passes your custom arguments first and the standard screen-event parameters (control name, event source, control type) last, so your handler signature stays consistent with every other button in the system.

The pattern looks like this in the button's script:
Code: [Select]
h.ScreenButtonCall(m.screen.MyCustomFunction, ...)
Yes, multiple pages and tabs are supported
Tabs are a first-class feature of the screen system. A dedicated Machine Diagnostics tab holding your live offsets block (and as many or as few I/O LEDs as you feel are worth the effort) is a completely normal thing to build. It costs zero space on the main page until you click over to it, which is exactly the behavior you described wanting. And with a scr.ShowPage("Diagnostics(1)") style call in the UserGUIModule, you can even jump to it from a button or a key rather than hunting for the tab.

One note before you build it: check the Fixtures tab first. Between its offsets display and Edit Offsets mode, it may already cover much of what your diagnostics page was doing, which would save you the rebuild.
Thanks,

Paul
Re: Screen Edit not saving.
« Reply #7 on: September 18, 2026, 03:20:46 PM »
Hi Paul,
excellent reply.....thanks.

Still digesting it all, but I like the trick of placing a self scripted button on top of or alongside a hard coded block.

When writing code in Mach4 all the calls were prepended 'mc........' or 'wx.........' To my mind these are Lua table structures with mc meaning Mach Core and wx meaning Widgets.
In Mach4 there is a similar table 'scr.....' but I never used it, and the advice given at the time was that it is and was not generally considered a table for use by a user.

In your reply I note that you specifically use and recommend the use of several tables for which I am unfamiliar.......starting with 'scr.' But also 'h.' and 'w.' Is there any documentation
that I can access to find out more about these tables and the functionality they confer?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'