Hello Guest it is April 25, 2024, 01:09:29 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

101
Mach4 General Discussion / Re: Lua programming of voltage meter
« on: February 18, 2018, 12:25:20 PM »
Loops in the PLC are bad, try a simpler way.

if machEnabled == 1 then
-- update meters
end

DazTheGas

102
Mach4 General Discussion / Re: PLC to start cycle and rewind g-code?
« on: February 18, 2018, 05:29:20 AM »
You can do this with a dummy panel and wxTimer

Code: [Select]
TimerPanel = wx.wxPanel (wx.NULL, wx.wxID_ANY, wx.wxDefaultPosition, wx.wxSize( 0,0 ) )
BotTimer = wx.wxTimer(TimerPanel)
TimerPanel:Connect(wx.wxEVT_TIMER,
function (event)
    -- send something to bot
-- process any returns from bot
BotTimer:Start(10000, true) --restart BotTimer if required
end)

BotTimer:Start(10000, true) -- start BotTimer on a RunOnce

DazTheGas

103
Mach4 General Discussion / Re: Lua programming of voltage meter
« on: February 17, 2018, 03:11:24 PM »
The Meters can be set using the "scr" class functions,

Lets assume you have you register sorted and have assigned a it to a local value as it shows in the pokeys manual from page 31 onwards.

All you need to do now is send that value to the meter, if say for instance your meter is called amtr and you want to set it to 75 then use scr.SetProperty("amtr","Value","75")

DazTheGas

104
Mach4 General Discussion / Re: Lua script detect when the cycle is running
« on: February 16, 2018, 01:20:31 PM »
May I suggest that you actualy post your m6 code, its very hard to give advice with only partly knowing what you are doing, you never know there may be a completely different solution to what you need.

DazTheGas

105
Mach4 General Discussion / Re: Lua programming of voltage meter
« on: February 13, 2018, 11:41:20 AM »
You could use the meter and set its value from a register that is updated by the pokeys analog signal.

DazTheGas

106
Mach4 General Discussion / Re: ESS not communicating to Mach 4
« on: February 12, 2018, 03:22:40 AM »
If you see the dro`s moving then the ESS is communicating, I would check the bob has voltage going to it and disable the chargepump.

DazTheGas

107
Mach4 General Discussion / Re: Can mcScriptExecute be called from a macro?
« on: February 10, 2018, 06:08:12 PM »
mcScriptExecute just basically executes a script and is global - it can change things globally and have its variables changed etc, using the private version just like it says makes it private and more protected, remember we all have our own prefs how we use things and i like my privacy lol

DazTheGas

108
Mach4 General Discussion / Re: Can mcScriptExecute be called from a macro?
« on: February 10, 2018, 04:57:49 PM »
Everything should work but I would use mcScriptExecutePrivate to be safe.

Place an mcs file in a directory

Code: [Select]
-- test.mcs
wx.wxMessageBox("Hello")

Code: [Select]
-- Macro
function m111()

local mInst = mc.mcGetInstance()
mc.mcScriptExecutePrivate(mInst, "test.mcs", false);
end

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


DazTheGas

109
Mach4 General Discussion / Re: Message Box with Cancel?
« on: February 10, 2018, 03:19:09 PM »
Here you go http://www.dazthegas.co.uk/forumanswers/m110.mp4 perhaps this will explain the error i was on about.

DazTheGas

110
Mach4 General Discussion / Re: Message Box with Cancel?
« on: February 10, 2018, 02:01:59 PM »
Oh I see now, der me....   you cannot run any of the getnumberfromuser or textfromuser from a macro. just remembered I tried to use this a while back. the lua stack is a cutdown version and wont allow dialogs like this.

DazTheGas