Hello Guest it is March 29, 2024, 06:30:35 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 - SwiftyJ

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 »
71
Mach4 General Discussion / Re: Z home before cycle start
« on: March 06, 2022, 03:46:08 AM »
What are you trying to do?

72
Mach4 General Discussion / Re: Z home before cycle start
« on: March 04, 2022, 10:20:19 AM »
You can home axes via gcode using G28.1


73
Axis 3 is A axis, Axis 4 is B axis. Try enabling all axes and see if it works

74
Seems like the API call needs to only command the enabled axes rather than all of them.

Is the error message preventing the machine from moving?

75
The keyboard plugin has outputs that you can map to a Mach4 output. See attached image.  There is two options, one to disable keyboard, and another to disable keyboard inputs completely.

There is also a scr API call to return the window title which you can monitor in the PLC script and then if it does not equal the whatever is shown at the top of your window you can turn off the output.
Code: [Select]
scr.GetActiveWindowText()

Ok, I've ended up doing it for you  ;D Just drop this in your PLC script. You will need to check the mapping of the keyboard enable in the outputs and modify the code. Also the search term "Mach 4" can be changed depending what is shown at the top of your window.

Code: [Select]
local windowText = scr.GetActiveWindowText() --Get the window title text
local find = string.find(windowText, "Mach 4") --Search for "Mach 4" in the window title.
local hKeyboardOutput = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT1)
local keyboardOutputState = mc.mcSignalGetState(hKeyboardOutput)
if find ~= nil then
--"Mach 4" was found i.e. Window is active
if (keyboardOutputState == mc.MC_OFF) then --Only turn on the output if it is off
mc.mcSignalSetState(hKeyboardOutput, mc.MC_ON)
end
else
--"Mach 4" was not found i.e. window minimised or lost focus
if (keyboardOutputState == mc.MC_ON) then--Only turn off the output if it is on
mc.mcSignalSetState(hKeyboardOutput, mc.MC_OFF)
end
end




76
Mach4 General Discussion / Re: Error Message
« on: March 02, 2022, 06:20:12 AM »
For the error message, this is coming from the HiCON plugin. Check each of the 'Output Index' drop downs in each motor config in the HiCON plugin

For the Aux Position counts/unit in the Mach config, these should be set the same as the motor counts/unit otherwise you get issues with DROs not zeroing correctly

77
Looks like it is trying to command the A axis to zero, which you don't have, hence the message. When the button is pressed does it execute code in the screen load script or is does the plugin do it internally?

78
Mach4 General Discussion / Re: Spindle Speed Lua Script..
« on: February 24, 2022, 02:28:34 PM »
Try setting the 'DRO Code' property of the DRO you are using to display the spindle speed to 'Spindle True RPM'

79
Mach4 General Discussion / Re: Save in register from lua
« on: February 19, 2022, 10:06:51 AM »
What you're trying to do doesn't need any lua scripting.

1. Create your register via Configure>Plugins>Regfile. If you want to it be persistent i.e. save the value after you shutdown Mach4 then tick the 'Persistent' column
2. In the screen editor select your DRO and then in the properties on the left hand side there is a 'Register' property. In the dropdown list you will find your register you just created either iReg0/... or gRegs0/...
3. Exit the screen editor.

When you now enter a value in the DRO it will update the register automatically. You can see the register value by going to Diagnostics>Regfile and then selecting the + next to iRegs0 or gRegs0 depending on where you made your register.


If you need to now read the register value from inside an mcode or button script you can follow what compewter_numerical posted above

80
Mach4 General Discussion / Re: New to forum, I have mach4 issues
« on: February 18, 2022, 04:57:22 PM »
Can you post a copy of a gcode where you are having the issue? I think you may be correct with your point about THC not turning off, so it’s then active at the start of the next cut during piercing.

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 »