Hello Guest it is April 28, 2024, 11:13:05 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 - Dan13

101
Mach4 General Discussion / Mach4 Executing Gcode from LUA
« on: May 25, 2015, 06:37:04 AM »
Trying to execute Gcode from LUA. This script works fine:

local inst = mc.mcGetInstance()
mc.mcCntlGcodeExecute(inst, "G0 X10 Y10\n")


However, with the below function, the numbers in the DROs do not continuously update, but only when the final destination is reached.

local inst = mc.mcGetInstance()
mc.mcCntlGcodeExecuteWait(inst, "G0 X10 Y10\n")


When trying to execute two line of Gcode, like below, the DROs again don't update continously, but only when the final point is reached.

local inst = mc.mcGetInstance()
mc.mcCntlGcodeExecute(inst, "G0 X10 Y10\n")
mc.mcCntlGcodeExecute(inst, "G0 X5 Y5\n")


What is the correct way to programm in order for the DROs to continuously update?

Dan




102
OK, this worked:

local inst = mc.mcGetInstance()
local param = 1 -- variable #1
local val = 12
mc.mcCntlSetPoundVar(inst, param, val)

103
Scott, can you be more specific? Or is this documented anywhere?

Daniel, hardly understood a word of what you said.

Dan

104
Trying to set a #Variable value by a script in a button. As per the Mach4 Scripting Manual, I have created this function in the ScreenLoad Script:

function WriteRegister(regname, regvalue)
  local inst = mc.mcGetInstance()
  local hreg = mc.mcRegGetHandle(inst, string.format("#Variables/%s", regname))
  mc.mcRegSetValueString(hreg, tostring(regvalue))
end

And in the buttin script I have this:

WriteRegister("#1", 15)

However, clicking the button doesn't change the value of #1 to 15. Following the example above, tried change iRegs0 and Sim0 register values and it worked fine, but not with #Variables. How should it be done?

Dan

105
General Mach Discussion / Re: AC Servo Spindle and ESS
« on: April 22, 2015, 11:55:45 AM »
Hi Steve,

How did you programm the drives to decelerate in case of a pulse train suddenly stopping? As I recall you were using Mitsubishi drives and as far as I know the Delta drives I am using are a Taiwanese copy of the Mitsubishi.

Editing the buttons is an option, but it's still done in software, while I would prefer doing this at the controller level or the drive itself. There still is the Reset button in Mach3 that would cause the same, and also if the ESS runs out of data (which happens to me every ones in a while), so this is something for the controller to take care of, that is if I want to make it as safe as possible.

Dan

106
General Mach Discussion / Re: AC Servo Spindle and ESS
« on: April 15, 2015, 02:32:49 PM »
With the USB SS, Greg somehow made it work properly. A custom screen is a possible workaround (pressing the reset button would still result in the same), but a fundamental solution would be solving it at the controller - at no occasion it should allow for a sudden stop of the pulse train stop to the spindle. Even when it recognizes a sharp interrupt in the pulse train, it should take over and safely decelerate, regardless of Mach3 state.

Dan

107
General Mach Discussion / Re: AC Servo Spindle and ESS
« on: April 15, 2015, 09:44:23 AM »
Yes, I am aware of this Hood. In the kind of work I do, I rarely reverse the spindle just like that. So usually there will be an M5. But it does happen seldom. It's a good idea to have a  macrto take care of this. Thanks.

Dan

108
General Mach Discussion / Re: AC Servo Spindle and ESS
« on: April 15, 2015, 07:31:17 AM »
Right Hood. And as Terry said hitting a stop on a machine should not harm it. There is a problem with the ESS and everything else are just workarounds.

Dan

109
General Mach Discussion / Re: AC Servo Spindle and ESS
« on: April 15, 2015, 02:37:14 AM »
Jeff, I neglected to mention that hitting the Estop also cuts power to all drives.

Dan

110
General Mach Discussion / Re: AC Servo Spindle and ESS
« on: April 14, 2015, 03:23:53 PM »
Using the latest ESS plugin with 062 Mach version.

I don't have a problem with the Estop as it sends a command directly to the Serrvo emegency stop input. The servo then coasts to a stop. Like I said, I can send a signal over modbus to the servo emergency input on a Stop hit. Wonder if Mach allows to trigger a signal on a reset hit as well.

Dan