Hello Guest it is April 19, 2024, 11:25:12 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 - DazTheGas

201
Mach4 General Discussion / Re: understanding Jog and signals?
« on: May 28, 2017, 03:45:16 PM »
When using the jog signals as I stated

Code: [Select]
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGYP), 1) --Turns on Y++
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGYP), 0) --Turns off Y++

you also need to tell mach4 what type of jog you are doing, I do this with

Code: [Select]
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.OSIG_JOG_INC),1)
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.OSIG_JOG_CONT),0)

and toggle the signals depending whether I need Inc or Cont

DazTheGas

202
Its very hard to decipher what you have script wise or hardware, try following something like this.

1. Setup the encoder Phase A & B signals in the ESS Pins Config for each encoder
2. Assign your pins to Input Signals in the ESS Config
3. Setup each encoder in Mach4 Config under the MPG Tab
4. Assign each MPG to an Axis in the Screen_load_script using

Code: [Select]
mc.mcMpgSetAxis(inst, 0, mc.X_AXIS) -- assigns MPG0 to X Axis
mc.mcMpgSetAxis(inst, 1, mc.Y_AXIS) -- assigns MPG1 to Y Axis
mc.mcMpgSetAxis(inst, 2, mc.Z_AXIS) -- assigns MPG2 to Z Axis

This is purely untested as I only use a shuttle.

DazTheGas

203
Mach4 General Discussion / Re: How to Emulate a Momentary switch?
« on: May 28, 2017, 02:57:34 PM »
The good thing with Mach4 is that it runs multiple instances of wxLua, there is one for the Gui itself and a very clean one for Macros. The instance for Macros does not allow for creating windows or panels, so using the wxMilliSleep within a macro would be absolute fine and will not hold up the Gui or PLC etc.

Code: [Select]
function m3()
    local inst = mc.mcGetInstance()
    local sig = mc.mcSignalGetHandle(inst, mc.OSIG_SPINDLEON) -- set to desired signal
    mc.mcSignalSetState(sig,1) --turn on signal
    wx.wxMilliSleep(2000) -- sleep for 2 sec
    mc.mcSignalSetState(sig,0) -- turn off signal
end
if (mc.mcInEditor() == 1) then
 m3()
end


DazTheGas

204
Looks very interesting and still maintained, but I think it will need a lot of customizing to include wxLua and the Mach API.

Just my OP

DazTheGas

205
Mach4 Videos / Basic Modules Mach4
« on: May 28, 2017, 11:45:45 AM »
Basic Module creation and use in Mach4

https://youtu.be/TMzAT0eb3p0

DazTheGas

206
Mach4 General Discussion / Re: understanding Jog and signals?
« on: May 27, 2017, 10:11:10 AM »
Personaly myself I use the signals such as
Code: [Select]
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGYP), 1) --Turns on Y++
mc.mcSignalSetState (mc.mcSignalGetHandle (inst, mc.ISIG_JOGYP), 0) --Turns off Y++

and ofcoarse all other axis needs the same, this way they serve as both inc and velocity dependingt on what you have set.

DazTheGas

207
Mach4 Videos / Momentary Switch in Mach4
« on: May 26, 2017, 03:36:42 PM »
Just as it says in the title  ;D ;D

https://youtu.be/1Q5YxjsBfT4

DazTheGas

208
Mach4 General Discussion / Re: How to Emulate a Momentary switch?
« on: May 26, 2017, 03:28:21 PM »
Hi Craig, ive read both this thread and another of what you are trying to do....

Quote
If you look in your Mach4 Hobby Program folder and then in the Lua Examples, there is a file called Activate Output.mcs.  I think we may be able to use this.
from another thread.

Well there is a problem with that script as it uses wx.wxMilliSleep(ActivateSignalTime) this command will halt the GUI for the time specified. so the simplest way is to use a timer event that does not halt the GUI in any way try this

https://youtu.be/1Q5YxjsBfT4

DazTheGas


209
Mach4 Videos / Mach4 Quicky #8 - Updating Custom WX4`s
« on: May 25, 2017, 06:18:11 PM »
Just a quick way I check what has changed in the WX4 screenset.

https://youtu.be/tkETxq0jl58

DazTheGas

210
Mach4 General Discussion / Re: Jog Speed
« on: May 23, 2017, 03:11:52 PM »
About the best way is to use the mc.mcJogSetRate as Craig mentioned, this could be done in the PLC script by getting the value of the slider and then setting the axis to what you require using a bit of maths ;-)

DazTheGas