Hello Guest it is March 29, 2024, 07:07:40 AM

Recent Posts

Pages: « 1 2 3 4 5 6 7 8 9 10 »
71
if you can't fix the error replace the wx4.set file in the screen sub-folder with the original file. That will put all the screen scripts back as they were when you installed. If you've made a lot of modifications they will of course be lost.. usually I save the last screen set file that worked when I start to make changes so if something doesn't work, and won't let Mach4 run, I can at least revert back to the last file that did.  :o
72
I was editing a screen and added a button. I set the click script to call macro 'm500', and typed it in that way. It should be 'm500()'. But now when I load the screen it gives the error:
Lua: Script error during pre compilation
c:\mach4hobby\Screenscript.Lua:861'Syntex error near 'end'

I tried removing the line from Screenscript.lua, (I did remove the read-only status). Saved the file and and verified my change was saved. But when I restart Mach 4 I get the same error, and when I check Screenscript.lua the line with the error is back.

How do I fix this error?
73
Thank you so much for your explanation! It was nice and clear! And worked exactly like I needed it to.
74
Mach4 General Discussion / Re: Upgrade problem - 4498 to 5310
« Last post by RecceDG on March 10, 2024, 11:30:49 AM »
Some quick tests:

1. Wear offset is editable. Check.

2. Tool change works and applies offset. Check.

3. Tool offset is applied and changes DRO. Check.

4. Cycle Start panel button works. Check.

5. Jog buttons on UI work. Not at first. Enabling machine"ungreyed" the panel, but the buttons would not highlight on mouseover. Then they did, and I don't know what triggered that. Incremental step change button works. Speed slider works. Axes work. Button jog mode button does NOT work (always continuous)

Good progress, thanks!
75
Mach4 Toolbox / Re: how to get wxMessageBox to disappear with an input?
« Last post by cncmagic on March 10, 2024, 09:03:10 AM »
and while this would be beyond my really truly meager capabilities.. I guess you could somehow retrieve the message box instance itself (or its thread or whatever id or position in the Ether it holds) and kill that in code.. way past anything I would attempt myself.  :o
76
Mach4 Toolbox / Re: how to get wxMessageBox to disappear with an input?
« Last post by idoma on March 10, 2024, 05:35:00 AM »
Hey. Thanks for taking the time to reply.
That's what I thought, but was hoping for someone to have a better idea...  :P

77
Mach4 General Discussion / Re: PLC script to write to a text file
« Last post by SwiftyJ on March 10, 2024, 04:24:35 AM »
I think you should only close the file when you want to stop recording the data i.e. when output 9 turns off. If you close it after every time you write data you will need to open the file each time, but you are only opening it once when output 9 turns on. Something like this...

Code: [Select]
-------------------------------------------------------
--  position Data
-------------------------------------------------------
local val_x = mc.mcAxisGetPos(inst, mc.X_AXIS) -- get X position
local val_y= mc.mcAxisGetPos(inst, mc.Y_AXIS) -- get Y position
WriteRegister("X_pos",val_x) -- to monitor in register diagnostics ok
WriteRegister("Y_pos",val_y) -- to monitor in register diagnostics ok

local LoadCellSignal = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT9 ) -- monitor output 9 activated by macro
local LoadCellSignalState = mc.mcSignalGetState(LoadCellSignal)

if (LoadCellSignalState == 1) then -- if output 9 is activated

local hregTime_LC = mc.mcRegGetHandle(inst, "iRegs0/Time_LC") -- get register Time_LC = 0
local LoadCellTime= mc.mcRegGetValue(hregTime_LC)

if (LoadCellTime==0) then
local Path = GetRegister(Layer_path) -- get File path from register
local MyFile = wx.wxGetCwd() .. Path -- define the file path in Mach4
file = io.open(MyFile, "a") -- open file in append mode
end


LoadCellTime = LoadCellTime+0.05 - follow PLC cycle time as sample rate
WriteRegister("Time_LC",LoadCellTime) --  monitor in register ok


local text = string.format ("%.4f, %.4f, %.4f \n", val_x, val_y, LoadCellTime );
file:write(text ) --Write the Gcode file
file:flush() --Save written data

else
       if (file ~= nil) then
            file:close() --Close file
       end
end



[/code
78
Mach4 Toolbox / Re: how to get wxMessageBox to disappear with an input?
« Last post by cncmagic on March 09, 2024, 10:58:19 PM »
my mistake.. not sufficient coffee this morning... no.. I don't see any method to close a message box using an input.. why don't you simply write into the bottom message banner when the guard is open.. you can clear that from the plc script.. or put a box on the screen and then make it invisible. Or you could do something really crazed and try to stuff keystrokes into the keyboard buffer to clear the box.. now that would be something to post!!!  :-\
79
Mach4 Toolbox / Re: how to get wxMessageBox to disappear with an input?
« Last post by cncmagic on March 09, 2024, 10:00:47 PM »
in the screen plc code read the state of the input and generate the message.. make sure you keep track and only do on a transition so it doesn't generate the message every scan.. and simply either lockup Mach4, crash or both.  :o
80
Mach4 Toolbox / Re: On Screen Cycle Counter
« Last post by cncmagic on March 09, 2024, 09:36:45 PM »
and just for the heck of it attached is what the Cycle Start script should look like   :(
Pages: « 1 2 3 4 5 6 7 8 9 10 »