Hello Guest it is April 25, 2024, 01:56:53 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 - jtiedeman

Pages: 1 2 »
1
Oh, that would explain why nothing I try works. I've got some ideas to change the program and work around it.

Thanks for the reply!

Joel

2
I have made a large tube plasma system (40' long, up to 10" diameter with 3/8 wall thickness  ;D) and do a lot of cutoffs with it. I have a certain program that does a lot of incremental cuts in the Y axis so at the end of the program I want to re-home the y axis (it homes in place). I don't want to just zero the work offset because I use multiple work offsets. If I don't home it before the next tube it wants to completely unwind the y axis to start the next program from Y0. I am trying to use an M code to home my Y axis and it works great when I run it from the script editor but I can't seem to get it to do anything when I run it in MDI with an m code. Is there something I am missing or doing wrong here?

Code: [Select]
function m101()
    inst=mc.mcGetInstance()
    mc.mcAxisHome(inst,1)
end

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

I have a button to home the Y axis that works great, I am just trying to save some extra mouse clicks between tubes. Any help would be great. Thanks!

Joel

3
Mach4 General Discussion / Re: arcs with a linear and rotational axis
« on: June 10, 2016, 04:26:33 PM »
I'm very inexperienced with LUA, does anybody think that they would be able to rewrite this for Mach4 and post it?

Thanks!

4
Mach4 General Discussion / Re: arcs with a linear and rotational axis
« on: June 10, 2016, 12:44:28 PM »
You can rewrite this and do the same thing in Mach4.

Sorry, just saw the last line.

5
Mach4 General Discussion / Re: arcs with a linear and rotational axis
« on: June 10, 2016, 12:42:22 PM »
Andrew,

This looks awesome! Do you know if this will work with Mach4?

Thanks,
Joel

6
Mach4 General Discussion / Re: change motor counts with lua
« on: June 09, 2016, 12:59:57 PM »
Looking through the Mach4 Core API I found mcMotorGetInfoStruct and mcMotorSetInfoStruct, but they only have C/C++ syntax listed and no LUA syntax. Can I accomplish this with C/C++ instead?

7
Mach4 General Discussion / Re: change motor counts with lua
« on: June 09, 2016, 12:00:54 PM »
Yes I retyped it. I checked and it is correct on the PC running Mach4.

We are trying to do this because I am making a tube plasma and I must be able to do arcs in the Z and C axis and Mach doesn't support cylindrical interpolation. Therefore, I have the machine set up as a XYZ machine and I'm just changing the motor counts based on the tube diameter. I can make it work by just closing and reopening Mach and selecting a different profile, but I was hoping to make it work with less user interaction (just an M code).

8
Mach4 General Discussion / Re: change motor counts with lua
« on: June 09, 2016, 10:32:19 AM »
No Luck.

For testing, here is the code I have:
Code: [Select]
fuction m108()
   inst=mc.mcGetInstance()
   mc.mcProfileWriteInt(inst, "Motor0", "CountsPerUnit", 800)
   mc.mcProfileSave(inst)
   mc.mcProfileReload(inst)
end

fuction m110()
   inst=mc.mcGetInstance()
   mc.mcProfileWriteInt(inst, "Motor0", "CountsPerUnit", 1600)
   mc.mcProfileSave(inst)
   mc.mcProfileReload(inst)
end

then I run:

Code: [Select]
M108
G91G1X1F30
M0
M110
X1F30
M30

My motors are currently set up at 800 counts per rev so I would expect that code to do 1 revolution after the M108 and then 2 revolutions after the M110. The code seems to update the value but I don't see any actual change in the motor revolutions until I open the settings.

9
Mach4 General Discussion / Re: change motor counts with lua
« on: June 09, 2016, 09:29:57 AM »
First, why not use mc.mcProfileWriteInt() instead of converting to string and then writing the string?

Yes that is the right way to do that. I'm very new to lua and still learning.

I'll try the mc.mcProfileSave(inst) and mc.mcProfileReload(inst) and see if that works. I'll report back with results.

Thanks for your help!
-Joel

10
Mach4 General Discussion / change motor counts with lua
« on: June 08, 2016, 02:35:11 PM »
I'm trying to change a motor count value with a lua scripted M code.

This code works to change the value but it doesn't seem to make a difference in how the motor runs until I disable and actually open the Mach settings (Configure menu > Mach). I've tested and just disabling and enabling the control does not do anything. To get it to work I have to disable, open the settings, hit cancel, and then enable.

Code: [Select]
function m108()
   inst = mc.mcGetInstance()
   local val = tostring(1000)
   mc.mcProfileWriteString(inst, "Motor0", "CountsPerUnit", val)
end

Any ideas or solutions?

Pages: 1 2 »