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 - joeaverage

Pages: 1 2 3 4 »
Mach4 General Discussion / Un-Supported wxNumberEntryDialog
« on: January 20, 2019, 01:27:32 PM »
Hi All,
I have always struggled to make sense of wxLua. I have started doing some reading and experimenting and a glimmer of
understanding/hope is coming.

I have encountered a difficulty that maybe someone can explain.

I was experimenting with wx.wxNumberEntryDialog() As found in the wxWidgets web pages but found that neither
ZeroBrane supported it neither would the dialog execute.

I found that the convenience dialog wx.wxGetNumberFromUser() works but that is limited to positive integers only.

I was hoping that wx.wxNumberEntryDialog would allow the entry of real numbers which would be appropriate for
a dimension in a CNC job say.

Is there a means of real number entry in wxLua?


Mach4 General Discussion / Poor Mans Wizard
« on: January 19, 2019, 01:29:30 PM »
Hi All,
as I promised I thought I would start a new thread to show an idea that I have used on a few occasions to generate
Gcode files.

This thread started with:

Where I wrote some code for OP to 'jewel' some material. Chad was interested in the idea of opening a file and putting
the Gcode in it rather than executing it immediately with successive mcCntlGcodeExecuteWait() API commands.

Here it is:

Code: [Select]
function m125()
local inst=mc.mcGetInstance()
-- create the wxFrame window
    mainframe = wx.wxFrame( wx.NULL,          -- no parent
                        wx.wxID_ANY,          -- whatever for wxWindow ID
                        "DummyFrame", -- frame caption
                        wx.wxDefaultPosition, -- place the frame in default position
                        wx.wxDefaultSize,     -- default frame size
                        wx.wxDEFAULT_FRAME_STYLE ) -- use default frame styles

    -- create a panel in the frame
    panel = wx.wxPanel(mainframe, wx.wxID_ANY)--We are not going to show it but we need to have this to use the File dialog

local file = wx.wxFileDialog(panel, "Select Data File", "", "", "Text files (*.txt)|*.txt|Tap files (*.tap)|*.tap",
                             wx.wxFD_SAVE,wx.wxDefaultPosition,wx.wxDefaultSize, "File Dialog" );
        if(file:ShowModal() == wx.wxID_OK)then
            path = file:GetPath()
-- Jewel be edited as required
local jewelWidth=50
local jewelLength=100
local toolDiameter=6
local nominalStepover=0.66
local plungeSpeed=300
local retractZ=2
local safeZ=20
local jewelDwellTime=500
-- End of data block
local startXpos
local startYpos
local jewelZheight

local stepoverX,numjewelX
local stepoverY,numjewelY
local i=0
local j=0
-- Save the current position as the start of the jeweling have jogged to the start haven't you????
-- Calculate the required step over to meet the nominal step over as closely as possible but be an integral
-- number of 'jewels'
-- Reduce jewelWidth in X and Y by the diameter of the tool
-- Calculate the exact number of 'jewels' required to match the nomininal Steppover
numjewelX=jewelWidth / (nominalStepover * toolDiameter)
numjewelY=jewelLength / (nominalStepover * toolDiameter)
-- Find the integer number of 'jewels'
-- Calculate the actual stepover to be used so that an integral number of 'jewels' are perfomed
stepoverX=jewelWidth / numjewelX
stepoverY=jewelLength / numjewelY
local retract="g0 z "..tostring(jewelZheight+retractZ)
local safeHeight="g0 z "..tostring(jewelZheight+safeZ)
--mc.mcCntlGcodeExecute(inst,retract..'\n'..'g1 f'..tostring(plungeSpeed)..'\n')
fileHandle:write(retract..'\n'..'g1 f '..tostring(plungeSpeed)..'\n')
for i=0,numjewelX,i+1 do
for j=0,numjewelY,j+1  do
jewelX=startXpos + (i * stepoverX)
jewelY=startYpos + (j * stepoverY)
--mc.mcCntlGcodeExecute(inst,'g0 x '..tostring(jewelX)..' y '.. tostring(jewelY)..'\n'..
-- 'g1 z '..tostring( jewelZheight)..'\n'..
-- 'g4 p'..tostring(jewelDwellTime)..'\n'..
-- retract..'\n')
fileHandle:write('g0 x '..tostring(jewelX)..' y '..tostring(jewelY)..'\n')
fileHandle:write('g1 z '..tostring(jewelZheight)..'\n')
fileHandle:write('g4 p '..tostring(jewelDwellTime)..'\n')
if (mc.mcInEditor()==1)then

Essentially all I have done is open a file dialogue so you can open a new file, or open an existing file with a normal Browse window
and then use exactly the same code that did the jeweling but replaced the mc.CntlGcodeExecuteWait() commands (I just
commented them out) with suitable file write commands.

Note that this code will run if you MDI <m125>.

The procedure would then be:
1) Jog to the location of the first (lower lefthand) 'jewel'
2) Lower the Z axis until the tool/brush makes contact with the material with sufficient force to effect the jewel
3) MDI <m125>

I have attached a coy of the file generated. Not very best a poor mans Wizard.....and I am a poor man!


Mach4 General Discussion / Out-Of-Band Axes in Hobby vs Indusrial
« on: May 05, 2018, 07:44:44 PM »
Hi All,
in Mach4Hobby we are limited to one out-of-band axis and that axis is always the spindle. As such there is good control over it via the API but not indexing. That is to say that the spindle
is meant to be free running and cannot without some work-around be stopped at some precice location/angle.

If I understand Mach4Industrial allows all six out-of-band axes. Does anyone know what control mechanisms exist for those axes? I imagine for instance it would be highly desired that there
could be more than on free running spindle for multispindle machines. I imagine also that position/index control would be available. I'm thinking that such a feature would be required of a 'tombstone'
type workpeice which required indexable movement in order that multiple parts could be made from the one tombstone as an example.

The workaround I have used with Mach4Hobby is to programmatically reassign my spindle as a rotational axis, C say, then call a C axis move to the required index. Provided no other axes are called
on the same line of Gcode then it could be considered that the C axis moved independently of all other axes ie a quasi 'out-of-band' axis.

I must say that until I understood the implication of the restriction to one out-of-band axis and that its always a spindle as applies to Mach4Hobby I would have said there is nothing about
Mach4Industrial that I'd miss. I'm now thinking that I miss not having indexable out-of-band axes, even one would be good.

Notwithstanding Chads use of MacroB and the glowing report he makes of it, it is not a feature that I require at this time, but would like at least one indexable out-of-band axis.


Mach4 General Discussion / Functions vs Actions
« on: March 23, 2018, 01:38:44 PM »
Hi All,
when using the keyboard plugin you can assign a function to each defined key, the functions in the drop down list are of the form JogX+, JogA--
for example. A poster in another thread is looking to use keyboard short cuts for estop and feedhold for instance.

In the screen editor buttons have events LeftUpAction  and LeftDownAction and the drop down list of Actions include all the features required by our poster.

Is there a way of making the Actions available as choices as keyboard shortcuts?


Mach4 General Discussion / List of Control States?
« on: February 08, 2018, 01:15:11 PM »
Hi All,
have had reason recently to consider Machs control states, I've had my nose rubbed in 'Idle' but I'm not sure what all the other states are or what they mean.
Is there a list or explanation somewhere?


Mach4 General Discussion / MERROR_NOT_NOW from GcodeExecuteWait() API Call
« on: February 03, 2018, 06:50:45 PM »
Hi All,
have run into a problem with some code.This is a snippet, I've left the wxMessage boxes etc in there, they are for testing purposes only.

Code: [Select]
        --Mach enabled but servos 'offline'
        --Need to restore current position and reset servos 'online'
        local Xpos=mc.mcCntlGetPoundVar(inst,500)
        local Zpos=mc.mcCntlGetPoundVar(inst,501)
local state=mc.mcCntlGetState(inst)
local statename=mc.mcCntlGetStateName(inst,state)
local rc=       mc.mcCntlGcodeExecuteWait(inst,'g53 g0 x'..Xpos..' z'..Zpos)

What appears to be happening if there is a Gcode file loaded and has partly run then Stopped, the control is Idle,
but when I execute the GcodeExecuteWait() statement it returns -18 or MERROR_NOT_NOW. My guess is that the Gcode interpreter is still loaded with
the Gcode file and is unavailable to execute the Gcode within my API call in MDI context?

Has anyone encountered this? Is my guess as to why the GcodeExecuteWait() API call does not complete correct? That same stament does execute correctly
under other circumstances so I am reasonably confident that its not some syntax error in my code.

If my guess is correct is there some way to shove the Gcode file out of the way, have the MDI Gcode execute, then shuffle the Gcode file back in?


Mach4 General Discussion / Additional Button Properties
« on: February 03, 2018, 03:38:57 PM »
Hi All,
in the screen editor when I look at the properties availble to be edited for Machs Enable button I see entries like 'Text Up' , 'Text Down'
'Button Colour Up' and 'Button Colour Down'.

I have a button on screen wish I wish to be able to change colour when active.  This button was one that was already there, I've just resused it for my purposes.
I doesn't have all the properties that the Enable button has.

How can I add those properties to my button?


Mach4 General Discussion / Trouble Loading Mach4Lathe
« on: January 26, 2018, 03:05:58 PM »
Hi All,
I have had reason lately to fire up the Mach4Lathe profile and have had a bit of a battle.

My laptop  had a meltdown and so I'm using Windows7 Embedded 32 bit as OS. This restricts usable memory to 2.5Gig

I had assumed that memory was the problem I've encountered when trying to load Mach4Lathe. After selecting the profile
Mach attempts to load the screen elements and the 'percent completion bar' suggests that it completed OK. It then goes
to load the canned cycle modules and mostly it fails. It would appear that a warning screen flashes up but it dissappears
as Mach shuts down before I can see it.

If I shut the PC down then restart from cold the first load of Mach4Lathe works, it loads up and I can run it, no problems.
This debunks the theory that lack of memory is the fault. If I shut Mach down and then try to load Mach4Lathe it fails.
In fact if I use the screen editor when Mach attempts to redraw the screen when exiting the screen editor it fails.

It suggests to me that some portion of the canned cycle modules is hanging up and preventing subsequent restarts.
I used Task Manager to check if any application or fragment was hanging up but it showed nothing. I'm guessing that
whatever fragment is hanging up is not an application as far as Task  Manager is concerned.


Mach4 General Discussion / Is Mach4 really Hobby Material?
« on: January 17, 2018, 01:28:52 AM »
Hi All,
I've been using Mach4Hobby for about a year and I luv it. I especially like the flexibility that comes with the modular structure and how Lua has been integrated.
I would admit that at the beginning I had my doubts but the more I learn the better I like it.

I have noticed however that many who try Mach4 are less that happy...comments like "I'll wait for NFS to make Mach4 like Mach3 used to be...' are common.
It strikes me that if half (this is my wild guess) of people who try Mach4 who don't carry on with it then is Mach4 really a hobby product?

I am happy to make the effort to program Mach4 to my liking but maybe you are not. I'm hoping that this post might generate a few comments and maybe a poll
is in order to establish what people like and dislike about Mach4.


Mach4 General Discussion / Toolpath Regen
« on: December 26, 2017, 05:38:01 PM »
Hi All,
have just noticed something about the 3481 build.

I have two Gcode files, one for the top of a PCB and one for the lower side. When I load say, the top etch file it loads and the tooplath draws as normal.

If I then close that file and load the lower side file, it loads and the dialogue box suggests it is going to draw the toolpath, but it fact draws the toolpath
of the previously loaded file, ie the upper layer.

If I close the current file and then do a <Regen Toolpath>, ie draw a blank page, then load a new file all is well, the new file draws correctly.

Has anyone noticed the same? I have noticed this with build 3481 but have not noticed it with earlier builds but don't know whether the earlier builds
behave the same way. Does anyone have an earlier build active who would be prepared to test the redraw behavior?


Pages: 1 2 3 4 »