Hello Guest it is April 25, 2024, 09:36:44 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

502
Mach4 Videos / Mach4 Quicky #4 - Where is the Startup Script
« on: May 23, 2016, 02:45:37 PM »
This eluded me too for a while  ;)

https://youtu.be/fKGJ3cfiW8s


DazTheGas

503
Mach4 Plugins / unPlugin V1.0.0
« on: May 23, 2016, 10:31:39 AM »
Ever wondered if those plugins that are not enabled are really not enabled, well there are plugins out there that still load even when not enabled.
This plugin will unload these plugins from the core at startup for you without deleting them from the plugins directory incase there being used in a different profile.


Watch the video for installation and usage at https://youtu.be/vH0lLcDi9oI


DazTheGas

504
It is the AXIS number as per API Docs, you assign motors to an axis,

IE - I have motors 1 and 3 assigned to axis 1, by doing this mach knows to do whatever on both motors.

DazTheGas

505
Mach4 General Discussion / Re: Testing scripts
« on: May 23, 2016, 10:17:35 AM »
You could use the keyboard plugin and assign a key to an input.

DazTheGas

506
Mach4 Videos / unPlugin V1.0.0
« on: May 22, 2016, 01:48:19 PM »
Ever wondered if those plugins that are not enabled are really not enabled, well there are plugins out there that still load even when not enabled.
This plugin will unload these plugins from the core at startup for you without deleting them from the plugins directory incase there being used in a different profile.


Watch the video for installation and usage at https://youtu.be/vH0lLcDi9oI


DazTheGas

507
You will need to add the mcSoftLimitSetState command in the screen load script. (This is accessed from the screen editor)

this command is an as per axis command, so for example if you only needed soft limits for axis 0 (X) then you would use mc.mcSoftLimitSetState(inst, 0, 1)

inst = our controller instance
0 = our axis number
1 = on and 0 = off

mc.mcSoftLimitSetState(inst, 0, 1)
mc.mcSoftLimitSetState(inst, 1, 1)
mc.mcSoftLimitSetState(inst, 2, 1)

this would turn on XYZ on my machine.

mc.mcSoftLimitSetState(inst, 0, 0)
mc.mcSoftLimitSetState(inst, 1, 0)
mc.mcSoftLimitSetState(inst, 2, 0)

and this would turn them back off

DazTheGas

508
Never too old - im no spring chicken myself ;-) Yes the PLC is an event running in its own thread.

you are not limited to using the editor my own screen is written in pure  wxlua / wxwidgets no editor used and is fully event driven

heres a small extract from my enable button that toggles the animation on the button depending on the state of OSIG_MACHINE_ENABLED and an event for each animation for when clicked.

Code: [Select]
 
    DTG.m_animCtrl1:Connect( wx.wxEVT_LEFT_UP, function(event)
    mc.mcCntlEnable(inst, 1);
    SetMessage(2, "Main control enabled")
    end )

    DTG.m_animCtrl2:Connect( wx.wxEVT_LEFT_UP, function(event)
    mc.mcCntlEnable(inst, 0);
SetMessage(2, "Main control disabled")
    end )


 CheckEnabled_timer = wx.wxTimer(DTG.cont_enable)
    DTG.cont_enable:Connect(wx.wxEVT_TIMER,
            function (event)
            if mc.mcSignalGetState (mc.mcSignalGetHandle (inst, mc.OSIG_MACHINE_ENABLED)) == 1 then
              DTG.m_animCtrl2:Show();
              else
              DTG.m_animCtrl2:Hide();
            end
    end)

    CheckEnabled_timer:Start(20)

DazTheGas

509
Sori for the lateness, was going to post this earlier but workload is high at moment but this might be of interest for both of ya.

http://www.machsupport.com/forum/index.php/topic,32573.new.html#new

DazTheGas

510
Mach4 Videos / Mach4 Quicky #3 Using wxTimer
« on: May 19, 2016, 05:24:50 PM »
Ever needed a timer in mach4 that wasnt in a loop like a = a +1 etc then try wxTimer


https://youtu.be/nkCx2xdoPEw

The Code

Code: [Select]
TimerPanel = wx.wxPanel (wx.NULL, wx.wxID_ANY, wx.wxDefaultPosition, wx.wxDefaultSize )

timer = wx.wxTimer(TimerPanel)

TimerPanel:Connect(wx.wxEVT_TIMER,
    function (event)

    -- Whatever code or function you need here

timer:Stop()
end) 


timer:Start(10000)

DazTheGas