Hello Guest it is April 16, 2024, 07:33:01 PM

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

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 »
1
Mach4 General Discussion / Re: Quick way to update lua scripts in Mach4.
« on: September 08, 2023, 10:58:04 PM »
empty

2
Mach4 General Discussion / Re: How to re-pack (zip) a Screenset?
« on: September 08, 2023, 10:48:31 PM »
unzip with 7zip, make changes and then copy/paste into the original.set file using 7zip gui

3
I don't think the scr.'' functions work in macros so you can just create a 'getter' function for the screen elements in your module.

4
To include a module in a Mach4 macro, you can do this:

Code: [Select]
function m555()
    local inst = mc.mcGetInstance() 

    -- get your current profile/path names & disk location
    local profile = mc.mcProfileGetName(inst)
    local path = mc.mcCntlGetMachDir(inst)
       
    -- this is a comment

    -- point to the module 'directory'
    package.path = path .. "\\Profiles\\" .. profile .. "\\Modules\\?.lua;" .. path .. "\\Modules\\?.lua;"   
   
    -- debug your path target
    mc.mcCntlSetLastError(inst, tostring(package.path))       
   
    -- import your module
    FiveFiveFiveTimer= require "FiveFiveFiveTimer"                       

    -- use your module
    FiveFiveFiveTimer.startTimer.(param)
end

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

Your error is probably a double include, since you don't have to include all that stuff you are doing globally before the function. You only need to include the Modules folder to use a module in a macro.

5
Mach4 General Discussion / Re: Looking for a Mach 4 developer
« on: January 14, 2023, 03:00:16 AM »
You'll need someone local to you that can interface with the machine directly unless you can connect the machine remotely with a RELIABLE connection and a camera(s) to view the machine in operation.

Not an easy task remotely, especially if your machine is custom (ie wire bending, pipe bending, specialized tools [not just drill bits, lathe cutters or plasma]). You'll have to really prepare if you hire for remote work because these machines are dangerous in operation, and bugs will ALWAYS come up.

You'll also want to be certain that the developer isn't going to just walk away from the job when the budget goes over what you expected or once the job is "done" (expect to always go over budget with software development, there's no way around this when working with software unless you have a dedicated team that's worked together for years). Once that developer walks, it's almost always a "start from beginning" operation after that.

But you should also include in your request, what your motion controller is as well. Every motion controller and components to interface on the machine are different. Most every machine is different.

Also, make damn sure your servo or motor drives and all the electronics are in WORKING ORDER before "hiring" someone to develop your integration. MOST developers won't touch the electronics.

And lastly, ALWAYS ALWAYS ALWAYS verify that the developer has worked with the motion controller you are using. And make damn sure they have some idea of what Mach4 is. Mach3 is almost completely different.

6
Mach4 Toolbox / Re: When changing from mm to inch unit
« on: August 26, 2022, 10:17:55 PM »
I think I'm the only one who's crazy.

[Image 1] So I brought the inch version that everyone is using.
And I drew a 2-inch square exactly.

[Image 2] In that state, I changed it to metric units.
And restart.

[Image 3] MDI ordered the operation, but it looks 2mm in DRO
The real moving distance drew a 2 inch square.

Isn't it strange that I'm the only one like this?

Then is there anyone who can tell me what the problem is?

No, you aren't crazy. I've experienced this working with a company on their machine before.

They wanted to sell international and we were using imperial for the entire screenset the whole time we were developing the code for operation.

When we switched to metric, we had to change the counts per unit, velocity and acceleration for each motor in the motors tab of the Mach4 configuration.

The formula for calculation steps per unit is the giveaway here, as you need to put in the intended distance traveled to calculate it. (current steps * distance intended) / actual distance. That calculation WILL NOT be the same if you are using a different unit.

Just changing the units you are using in Mach4 DOES NOT change the steps per unit. It would be a nice additional feature to change it automatically for each motor if you choose to change the units, but I know from experience it DOES NOT.

The DRO's are just a GUI form element so you might need to go into the screen editor and change the way the DRO displays either inches or mm.

I posted a newer 'easier to use' wizard for calculating the steps per unit here:
https://www.machsupport.com/forum/index.php?topic=43830.msg281953#msg281953

The latest revision of that wizard is in the 5th post down on that forum post in a zip file. Just put it in your wizards directory in Mach4 and the wizard is called stepsCalc 


7
Mach4 Toolbox / Re: Mach4 Serial Pendant
« on: August 25, 2022, 12:59:33 AM »
This is cool stuff. I've done something similar.

The Mach4 screen set is just XML. It's possible to create an automated installer for your device instead of just a default screen set. I've done this for a diy pendant using Python, py2exe and wxWidgets.

Here is the script (with GUI) for editing the screen set using Python and transforming the machine 'ini' file into a dictionary and then back again. It's commented where the code looks ugly but it's portable. There's a pre-built exe made from py2exe in the repo but it's tailored for modbus via tcp and specific IO configs in Mach4.

https://github.com/kethort/esp32-cnc-mpg-handwheel-conversion-mach4/blob/master/src/installer/MPGInstaller.py

8
Mach4 General Discussion / Re: Read Register from a text file
« on: August 20, 2022, 12:02:48 AM »
best way to do this is with hardware like an arduino and using the modbus plugin

second best way to do this is change the registers on the fly in the PLC without an external program or software

but, if you use python and want to update registers in the PLC, don't open a file every 50ms. It will like just freeze Mach. Instead, in your python program, write an extra [blank] file to the filesystem everytime you "update" the values you want to send to Mach4. Then in the PLC, monitor and look for the "update file". if you find it, then delete the update file, open the file that contains the register settings and write your registers. This blank file would act like a 'nonce' in comm protocols. except the filename for the update file can be the same everytime since you will always delete it.

python has modbus libs. You might be able to create a virtual com, similar to a loopback address and communicate via the modbus plugin. Or maybe the tcp modbus can work that way, you'll have to find out for yourself.

9
Mach4 General Discussion / ESS MB3 3d printed Din Rail Mounts
« on: August 02, 2022, 06:02:56 AM »
here are 3d printed din rail mounts for MB3 with ESS

10
Mach4 General Discussion / Re: Mach4 Lua programatically clicking button
« on: August 02, 2022, 04:55:47 AM »
you can easily do it with registers and monitoring the state in the PLC

it may or may not be "fast"...depending on your idea of "that"

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 »