Hello Guest it is March 26, 2026, 03:48:42 AM

Recent Posts

Pages: « 1 2 3 4 5 6 7 8 9 10 »
71
MachPro General Discussion / Re: PLC Scripts
« Last post by tbadger on March 09, 2026, 09:56:11 AM »
Thanks Paul - looking forward to the documentation. As I'm not a coder, but can figure out mostly how to add custom stuff that others have built and get it to work. Since Mach Pro has changed so much, its a challenge sometimes to figure out where to get things done.  While exploring further, I did note the Compile Scripts button on the Service tab. I think it is mostly getting used to the changes and knowing how things are done in Pro.

I think some clear examples of what might be considered typical of what someone might want to do would be helpful. In other words, beginning to end.

BTW, I am on the Beta, so happy to review the doc in progress.
72
General Mach Discussion / Re: UC100 USB motion controller
« Last post by paul.stephens on March 09, 2026, 09:53:44 AM »
UC100 is a USB based motion controller, It requires udp and tcp ports to communicate, but that will not require internet access to do that. You may need to open these ports on your pc, as some PC's seem to be particular about devices. Please Refer to the UC100 manual and web page for instructions of how to get set up.
https://cncdrive.com/UC100.html
If you have complications with installing the USB drivers on Windows 10 or 11 then please follow the instructions on this website: http://www.szentkereszty.net/uc100/
73
MachPro General Discussion / Re: PLC Scripts
« Last post by paul.stephens on March 09, 2026, 09:48:41 AM »
In MachPro there's actually already a built in method for handling Light Stacks inside of Configure → Control → Settings. Alternatively you can also handle it through the GMS plugin as well.
If you prefer the lua code route, under the Service → Maintenance tabs, we have a Compile Scripts button that should apply your custom programming and most changes, so you no longer have to power cycle Mach.

In an ideal sense, we prefer to not have custom programming on the newer software as it becomes a nightmare to support. We are working on documentation on how to handle all these things.
74
Hi Craig

Thanks very much for takig the time to reply.  I have learned alot from reading your posts on this forum, so thanks for that too.  I'm now thinking that the issue might be that the profile hasnt been properly generated by the Pokeys plugin.  My macros folder for Johnny 5 is empty but a profile that I made years ago for some preliminary testing (this DIY build has been on and off again for years) has an m6.mcc, m6.mcs and mclua.mcc in it's macros folder, which seems like it could be significant.  I might try and make a new profile and see what happens. I will also do as you suggest although I think I did already try making an m100 and nothing happened with that either. I dont want to edit m6 I just want mach to run it, which it currently wont. You are absolutely correct about AI.  I was using Claude but quickly found it's limits. 
Thanks again for your help 
75
Hi,
I'm no expert in Mach4 Lua coding but I've never written 'luafunction m6()', but rather just 'function m6()'.

function m100()               rather than:

luafunction m100()


Second thing I'd try is NOT use m6. m6 is reserved for tool change and in all probability Mach4 already has some rudimentary m6() code built-in. All you are doing is overwriting it.

May I suggest try the same test code, but call it m(100). I follow the old Mach3 rule, all user written scripts should be m100 or higher.
If you write your own m6 for instance then YOU MUST ASSUME RESPONSIBILITY for ALL the required functionality of an m6. If there is something that Mach expects or requires from
an m6 and you overwrite the supplied m6 then your code must include it.

My guess is that you are using chatGPT or similar to code Lua.......good luck, you get good looking code, just that it does not work! There's no substitute for rolling up your sleeves and learning this stuff
for yourself. I cannot ever see a time where AI is going to mean that humans do not have to learn. Learning is a fundamental human trait.

Craig
76
MachPro General Discussion / Re: PLC Scripts
« Last post by tbadger on March 07, 2026, 05:02:03 PM »
Okay, might just be user error. I did not restart Mach Pro after updating the script. On restarting, it does seem to be working as expected.
77
MachPro General Discussion / PLC Scripts
« Last post by tbadger on March 07, 2026, 04:45:09 PM »
I'm wanting to add a PLC script that calls a module for Mach status lighting. In Mach 4, that seemed pretty straight forward. I'm not a seasoned coder, so there is little that is intuitive about LUA coding for me.  In Mach Pro, the "new" PLC Script just has the following:


Code: [Select]
if m.CommonPLCScript ~= nil then
m.CommonPLCScript()
end

I want to insert this code into the PLC Script, so that it calls the towerscript.lua module.

Code: [Select]
if towerscript == nil then
towerscript = require "towerscript" -- Load's towerscript.lua from a path. probably C:\Mach4\Modules
end
towerscript.PLCScript()

I tried just pasting it at the end of the previous lines, but that did not seem to work. I've found little information in the documentation that would guide me in the right direction.


78
General Mach Discussion / UC100 USB motion controller
« Last post by kolias on March 07, 2026, 04:03:17 PM »
I'm using UC100 USB with Windows10 PRO for my 3 axis CNC. My desktop PC is a dedicated PC just for my CNC and I don't want MS updates. If I disable my wireless connection would the US100 work properly?

Thanks

79
Brains Development / Modbus Input Holding Not Reading in Brains
« Last post by BSRHAANN on March 07, 2026, 03:54:51 PM »
Set up Mudbus RTU to Servo Drive to read and write holding registers.  I can run "Test Modbus" without any issues, all requested input and outputs read and write correctly.  I have setup my Modbus configuration using the same parameters.  Created and Enabled a simple Brain that compares the CFG(0) Modbus input to turn off/on an output but I only get 0.0000 in my Modbus Reading.  Have also tried similer ouput (CFG)'s and Brains, it only wants to send 0.0000.  Any ideas what I am missing??? 

Thank You,

Brandon
80
Hi all,
It's my first post, so please accept my apologies if I should have posted this somewhere else.  I have a custom 5-axis router running Mach4 4.2.0.4300 with a PoKeys57CNC motion controller. My profile (johnny5) was created using the PoKeys setup wizard and uses the wx6 screenset.
I am unable to get any macros to execute. I have tried M6 and M30. Both are silent — no errors, no popups, nothing. The macro files are in C:\Mach4Hobby\Profiles\johnny5\Macros\ and are correctly structured Lua scripts following the standard format:

luafunction m6()
    inst = mc.mcGetInstance()
    mc.mcCntlSetLastError(inst, "test")
end

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

Files are saved with ANSI encoding. ZeroBrane compiles them with no errors. However no .mcc files are ever created in the macros folder after restarting Mach4.
The diagnostic log shows M30's internal rewind firing 125ms after cycle start with no macro involvement at all — the macro is simply never called.
The johnny5 profile folder does not contain a Modules subfolder. The default Mach4Mill profile does not appear to have .mcc files either.
Doe anyone know what is preventing macro compilation and execution in this profile please? Is there a configuration step I am missing when setting up a new profile from scratch via the PoKeys wizard?
Thanks very much in advance for reading, and giving this some thought.
Pages: « 1 2 3 4 5 6 7 8 9 10 »