Hello Guest it is April 23, 2024, 07:31:14 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - lesspaul

Pages: 1 2 »
1
Mach4 General Discussion / How to re-pack (zip) a Screenset?
« on: June 28, 2023, 02:25:30 PM »
The Mach4 screensets are simply renamed zip files and I'm able to unpack them and directly edit the XML (at the moment I'm trying to do a font replacement)
Unfortunately, I can't seem to figure out how to re-zip the file such that Mach4 is happy with it. I've tried taking a screenset, unpacking, and then re-zipping without making any changes and have had no luck. Mach4 responds that there was a problem loading Screenset.  I *think* it uses zip "Deflate" encryption but that's all I've been able to figure out. Any help much appreciated.

2
I have a basic 24x36 CNC router based on the Fineline Automation FLA-100. I've added a few features, but all-in-all it is not complex. I've written a few Lua scripts to automate tool change and finding top (ideas taken from Gerry's Screenset 2000 for Mach3).
Many of the features on the default Mach4 screensets are of little use to me.
But I'm torn between keeping it simple and just ignoring what I don't use, or redesigning to meet my needs.

It occurred to me that the latter might not be the best idea if there are significant changes from release to release with the code integral to the screensets. Are there significant changes to the screensets from release to release?

3
For a long list of reasons I have not been able to use my CNC for a while, and am happy to be getting back at it.
My current installation is Mach4 Industrial version 4.2.0.4118 and Warp9 ESS version 232.

I am assuming I can simply update to newer versions without major issues -- is this a valid assumption?
And I know that -- at least in the past -- the official Mach4 release can be quite a bit behind from what many are using.  Looking for any advise as to what would be my best bet (version) in terms of upgrading.

Much thanks in advance -- Paul

4
Ethernet Smoothstepper is currently compiled against Mach4 version 4.2.0.3882
However the downloads page still has 4.2.0.3804 and 4.2.0.3481 for Hobby and Industrial respectively.
The FTP site has versions 4.2.0.4105 through 4118

Any idea where I could find 3882 Industrial?

PS: It looks like there is a lot of development activity!

5
Mach4 General Discussion / My new screenset (and thanks to all)
« on: June 23, 2018, 06:03:53 PM »
Attached is a screenshot of my new screenset -- clearly inspired by the Mach3 "Screenset 2010".
Features:
The HOME and ZERO buttons turn green when homed/zeroed.
Pressing "Zero to Laser Crosshairs" sets Zero to the proper offset for my gantry mounted laser pointer, and turns X/Y Zeros green.
Pressing "Probe for Tool Zero" launches a coroutine script which does a fast then slow probe and sets Z-zero (and turns Z Zero green)
M6 is highly customized
1) Checks to ensure machine has been homed -- error if not
2) Records current X/Y, feed, and modals
2) Moves to Z0,  fixed plate loacation
3) If 1st M6 following "Probe for Tool Zero" then fast/slow probes plate for offset and returns to Z zero
4) Prompts for tool change and then fast/slow probes for zero and applies offset.
5) Returns to Z0, rapids to starting x/y and restores feed and modals.

Feedback and constructive criticism much appreciated


6
I've read conflicting information in the forums regarding the #vars .
Which #vars are safe for user functions?
Are any persistent (saved at Mach4 shutdown / reloaded at Mach4 startup)?   

7
Mach4 General Discussion / Can't seem to get load_modules.mcs working
« on: June 17, 2018, 11:42:37 AM »
RHTuttle posted in January about launching functions as coroutines from his scripts using load_modules.mcs to load his custom module, a user module, and a button script
 http://www.machsupport.com/forum/index.php/topic,36474.0.html

I had no success trying to duplicate his efforts. I reduced my code to a minor test case, and it seems that I'm doing something wrong regarding load_modules.mcs.

The file 'load_modules.mcs' in my profile's '\Macros' subdirectory
Code: [Select]
---------------------------------------------------------------
-- Load modules that you want to be able to use from Mcodes
---------------------------------------------------------------
inst = mc.mcGetInstance()
local profile = mc.mcProfileGetName(inst)
local path = mc.mcCntlGetMachDir(inst)

package.path = path .. "\\Profiles\\" .. profile .. "\\Modules\\?.lua;" .. path .. "\\Modules\\?.lua;"
--package.path = path .. "\\Modules\\?.lua;" .. path .. "\\Profiles\\" ..  profile .. "\\Modules\\?.lua;"

--ErrorCheck module
package.loaded.mcErrorCheck = nil
ec = require "mcErrorCheck"

ph = require "phModule"     -- resides: C:\Mach4Hobby\Profiles\MyCNC\Modules

'phModule.lua' in my profile's '\Modules' subdirectory.
Code: [Select]
local phModule = {}

   function phModule.bigMac()
      mc.mcCntlSetLastError(inst, "Special Sauce?")
   end

return phModule


Button code
Code: [Select]
ph.bigMac()

When I activate the screen button, I get the following error message:
C:\Mach4Hobby\ScreenScript.lua:1029: attempt to index global 'ph' (a nil value)
stack traceback:
   C:\Mach4Hobby\ScreenScript.lua:1029: in function <C:\Mach4Hobby\ScreenScript.lua:1028>
   
However, if I add the load_modules code to the Screen Load Script, my button functions as expected.
Code: [Select]
--My Stuff (Paul)
ph = require "phModule"

Yes, I got the code working, but I'm perplexed as to what I was doing wrong initially. Any and all help much appreciated.

8
I have a state flag that I need to be accessible in multiple scripts.

It looks like this could be done by creating a register in the register plugin or I could create a LED on the screenset and use its state to communicate. Or ??

Related questions
-- what are the differences between an "instance" and a "global" register?
-- is there a hook to trigger or launch a script when a new g-code file has been loaded?
 

9
Mach4 General Discussion / Reset required after G31 probing moves?
« on: June 14, 2018, 03:10:32 PM »
I am seeing something that seems unusual to this Mach4 newbie. I just got done writing my second script -- tool zero probing -- and found a strange behavior. Following a G31 probing move the MDI is disabled.  Test code:

Code: [Select]
mc.mcCntlGcodeExecuteWait(0,"G91 G31 Z-2.0 F5.0)
however, if I press [Reset] or add mc.mcCntlReset(0) to the script all is well and the MDI works as expected.

Code: [Select]
mc.mcCntlGcodeExecuteWait(0,"G91 G31 Z-2.0 F5.0)
mc.mcCntlReset(0)

I am using the most recent release version of Mach4 (4.2.0.3804) and Ethernet Smoothstepper with firmware #220.

So my questions are: Is this normal? And if not, which is the most likely culprit, something I did, Mach4 or ESS?

For completeness sake, here is my entire tool zero script:

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

local TouchPlate = 0.622 -- Thickness of touchplate above material
local SlowProbeRate = 0.7  -- IPM
local FastProbeRate = 5.0  -- IPM
local JogRate = 60
local Pos

mc.mcCntlSetLastError(inst, "Probing for Z Zero . . .")
wx.wxMessageBox("Ensure touch plate properly positioned and connected, then press ENTER.")

mc.mcCntlGcodeExecuteWait(inst,"G91 G31 Z-2.0 F".. FastProbeRate)  -- Probe TouchPlate at FastProbeRate
mc.mcCntlGcodeExecuteWait(inst,"G91     Z0.05  F".. JogRate)        -- Retract
mc.mcCntlGcodeExecuteWait(inst,"G91 G31 Z-0.07 F".. SlowProbeRate)  -- Probe TouchPlate at at SlowProbeRate

Pos = mc.mcAxisGetProbePos(inst, mc.Z_AXIS, 0)  -- Get Touch Position (work coordinates)

mc.mcCntlGcodeExecuteWait(inst,"G90 Z".. Pos .. " F".. SlowProbeRate) -- Move back to touch point in case of overshoot
mc.mcAxisSetPos(inst, mc.Z_AXIS, TouchPlate) -- set DRO to height of touchplate
mc.mcCntlGcodeExecuteWait(inst,"G91 Z1.0 F".. JogRate)        -- Retract

wx.wxMessageBox("Z Zero Set. Remove touch plate and press Enter")
mc.mcCntlSetLastError(inst, "Z Zero set")

mc.mcCntlReset(0)

10
After sitting on a license for several years I'm finally going to give Mach4 the old college try, but I'm pretty wedded to the simple and multi-tool zero functions in Gerry's 2010 screenset, as well as his X/Y zero to laser crosshairs feature.

I'm well aware that in cases such as this, Lua is my friend, and I'm no stranger to coding. However, there is never a point to reinventing the wheel so I thought I'd ask if anyone already has scripting similar in function. If not, time to knock the dust off my ol' friend UltraEdit.

(DaTheGas -- I've already seen your excellent youtube videos on modifying M6!)

Thanks!
-- Paul

Pages: 1 2 »