Hello Guest it is April 26, 2024, 01:31:40 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.


Messages - DazTheGas

471
Mach4 General Discussion / Re: Map Lua Code to ShuttlePro button
« on: May 29, 2016, 03:31:57 PM »
I cant see anywhere in your code where you have actually turned the spindle on??

try   


Code: [Select]
mc.mcSpindleSetCommandRPM(inst, 1 )
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.OSIG_SPINDLEON),1)
mc.mcSpindleSetDirection(inst, mc.MC_SPINDLE_FWD);

DazTheGas

472
Mach4 General Discussion / Re: M Code Parameters
« on: May 28, 2016, 06:43:31 PM »
Quote
Finally got it.  The return data type is a number, which is why 1 didn't equal 1.

Best place to look is in the api docs thats in the docs directory, all commands are there and tell if you need int or string

DazTheGas

473
Mach4 General Discussion / Re: M Code Parameters
« on: May 28, 2016, 03:36:26 PM »
Can you elaborate a bit as to what is your gcode is passing as the args?

DazTheGas

474
I think that could be refering to mach3

DazTheGas

475
M62 is not yet implemented in the Mach4 Plugin.

DazTheGas

476
Mach4 General Discussion / Re: Map Lua Code to ShuttlePro button
« on: May 27, 2016, 05:49:12 PM »
Check that theres no error in the script or it wont compile

DazTheGas

477
Mach4 General Discussion / Re: M Codes in MDI
« on: May 27, 2016, 05:47:01 PM »
Just tried using the sim and worked fine using had to add a number as I dont have the dro, try putting a messagebox below it to see what is getting passed to the gcode

Code: [Select]
function m101()
    ---------------------------------------------------------------------
    -- GoTo Safe Z
    ---------------------------------------------------------------------
    inst = mc.mcGetInstance()
    mc.mcCntlSetLastError(inst, 'Move to SafeZ')
    local SafeZ = 5 --scr.GetProperty('droSafeZ', 'Value')
    local CodeLine1 = 'G00 Z' .. SafeZ
    mc.mcCntlGcodeExecute(inst, CodeLine1)
    --mc.mcCntlMdiExecute(inst, CodeLine1)
    --mc.mcCntlGcodeExecuteWait(inst, CodeLine1)
end

if (mc.mcInEditor() == 1) then
 m101()
end

DazTheGas

478
Mach4 General Discussion / Re: Stretching Images
« on: May 27, 2016, 03:34:48 PM »
Not time for a video but try this..

from the screen editor

1. Add a lua panel and set the size the same as the image you want + 10 on both height and width
2. Add into the script part

Code: [Select]
local inst = mc.mcGetInstance()
    panel = mcLuaPanelParent -- get the panels parent id
    local window = panel:GetParent() -- get the panels id
    local BGround = panel:GetBackgroundColour() -- get the screen background colour
    window:SetBackgroundColour(BGround) -- set to background of top window
    window:SetWindowStyleFlag(wx.wxBORDER_NONE) -- remove border
    window:ClearBackground() -- clear background
    window:Refresh() -- refresh to apply changes

local my_image = "C:\\DTG_Mach4Hobby\\Profiles\\ESS_Motion_V2\\Screen\\Buttons\\24v_dwn.png" -- bitmap to load

wx.wxStaticBitmap( window, wx.wxID_ANY, wx.wxBitmap( my_image , wx.wxBITMAP_TYPE_ANY ), wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) -- create the bitmap container

window:Layout() -- redraw the new panel

This will create a bitmap that will not resize with the screen, the panel itself will but not the image.

DazTheGas

479
Mach4 General Discussion / Re: Writing to machine.ini
« on: May 27, 2016, 03:17:04 PM »
I really cant see the point when it can be done as you go with the button? but anyway you could use the registry plugin and save the states to registry values.

DazTheGas

480
Mach4 General Discussion / Re: Map Lua Code to ShuttlePro button
« on: May 27, 2016, 02:16:00 PM »
Delete the ones with the extension MCC and delete the mcLUA.MCC

DazTheGas