Hi,
A) how do I know which script I should be in when modifying these buttons like Screen Load Script or Screen Upload Script or PLC Script?
That is all part of the Mach4 learning curve. It was not really necessary to understand the inner workings of Mach3, all features, good and bad were exposed
and in many cases automatic. Mach4 is very different that that regard. It is a structured software with significant modularity. Understanding how control flows from
one section to another is both important and a challenge. Its a case of starting small and working your way up. You have now encountered two scripts, the
ScreenLoad and PLC scripts....that will keep you going for a while yet.
The ScreenLoad script is the most significant one, and it is where you'l place most of your function definitions. It is also the location of the SigLib{}, aka Signal Library Table.
That is where you'll be putting code for inputs and outputs.
The PLC script is also important if you need or want a polled input. The downside with the PLC is that it runs every wee while....if you make a mistake in your coding its going
to fail again and again, often locking you out.You should thoroughly test any code 'in a sandbox' before you put it in the PLC script.
The Screen Unload script is what runs when Mach shuts down, things like storing data, and settings. It is largely automatic and seldom needs editing or additions.
In the Move to work zero script, If I want Z to move to a Safe Number First before X+Y moves, say it raises to Z=-500 below MACHINE ZERO then X+Y Move to zero then Z drops to work zero IS THIS POSSIBLE TO DO?
But isn't that exactly how Mach4 works now?
The <GotoWorkZero> function as shipped, moves the Z ie Z zero in machine coordinates ie to the very top of travel and out of harms way, THEN moves to the X,Y zero. Thereafter, if you
have programmed it so the Z axis descends into the work zone. Isn't that exactly what you want, but rather than go to 'some safe height' it goes to the very top of the Z axis,
surely that is a safe as you can get?
My preference is as Mach ships where the X and Y axes got to zero, but the Z axis remains out of harm way right at the top, rather than drive down into the work zone
Then I jog the Z axis down manually. I can confirm that my Z zero is correctly set without risk. Having it drive down automatically risks any mistake being found but only AFTER a crash.
You can code it to go to some other height, say Z zero (work coordinates) plus some safety allowance, say 50mm. Note this is not standard code but would require you edit the
standard code to reflect your preference.
Fusion 360 allows a parameter 'Clearance Height' and is very convenient and is related to the part you are working on. When the tool path is simulated it
is the perfect opportunity to preview the Z zero and its suitability. When I do rotary four axis paths I specify a safe Z location, but that is done on a per part basis.
The thought of automatically driving to Z zero (work coordinates), especially without some safety allowance gives me the chills!
Craig