Hello Guest it is April 25, 2024, 05:25:53 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 - mhd

Pages: 1
1
Mach4 Plugins / Re: mcX360 Plugin for Lua
« on: September 26, 2018, 01:53:36 PM »
Dear Sir ,

I think the problem was in the (( if GetXin("LTR_Val") > "150" )) the number should be in " ". I'm not that expert in coding but the fixed my problem.

Can I ask you for a favour. if you can do video in PMC it will be helpful for those who have a basic in code.

Best regard
shrooqi

2
Mach4 Plugins / Re: mcX360 Plugin for Lua
« on: September 26, 2018, 10:07:43 AM »
Your GetXin function is incorrect

your code
Code: [Select]
function GetXin(Xinput)
   local hreg = mc.mcRegGetHandle(mInst , string.format("mcX360_LUA/%s") , Xinput)
   return mc.mcRegGetHandle(hreg) -- This line is wrong
end

code should be
Code: [Select]
function GetXin(xinput)
local hreg = mc.mcRegGetHandle(inst, string.format("mcX360_LUA/%s", xinput))
return mc.mcRegGetValue(hreg) -- or return mc.mcRegGetValueLong(hreg)
end

DazTheGas



Dear Sir


I change it and still, I can not get the feed in the stateusList



------- Declaer local---------------
local mInst = mc.mcGetInstance()
local Xenable= 0

-------------- Ps3 Init Panel------------

Ps3_Penal = wx.wxPanel( wx.NULL , wx.wxID_ANY , wx.wxDefaultPosition , wx.wxDefaultSize)
Ps3_Timer = wx.wxTimer (Ps3_Penal)
Ps3_Timer : Start(100)

----------- Fauntion----------------

function GetXin(xinput)
        local hreg = mc.mcRegGetHandle(inst, string.format("mcX360_LUA/%s", xinput))
        return mc.mcRegGetValueLong(hreg)
    end

------------Event Timers-------------
Ps3_Penal : Connect (wx.wxEVT_TIMER , function(event)
      
      if GetXin("LTR_Val") > 150 and Xenable == 0 then
         Xenable = 1
         mc.mcCntlSetLastError(mInst , "Ps3 Running")
         
      elseif GetXin ("LTR_Val") < 50 and Xenable == 1 then
         Xenable =0
         mc.mcCntlSetLastError(mInst , "Ps3 Stopped")
         
      end   
      
      
   end   )




Sir, I copy this code for your previous and I insert what you explained from the video on it. It works know but I don't understand why?



local inst = mc.mcGetInstance()
local Xenable=0

local X360_PNL = mcLuaPanelParent;


    function GetXin(xinput)
    local hreg = mc.mcRegGetHandle(inst, string.format("mcX360_LUA/%s", xinput))
    return mc.mcRegGetValueString(hreg)
    end


   X360_timer = wx.wxTimer(X360_PNL)
    X360_timer:Start(100)

    X360_PNL:Connect(wx.wxEVT_TIMER,   function (event)
   
    if GetXin("LTR_Val") > "150" and Xenable==0 then
      Xenable=1
    mc.mcCntlSetLastError(inst,"PS3 Running")
    end
   
    if GetXin("LTR_Val") < "1"  and Xenable==1 then
      Xenable=0
    mc.mcCntlSetLastError(inst,"PS3 Stopped")
    end
 
    end)

3
Mach4 Plugins / Re: mcX360 Plugin for Lua
« on: September 25, 2018, 04:22:55 PM »
Your GetXin function is incorrect

your code
Code: [Select]
function GetXin(Xinput)
   local hreg = mc.mcRegGetHandle(mInst , string.format("mcX360_LUA/%s") , Xinput)
   return mc.mcRegGetHandle(hreg) -- This line is wrong
end

code should be
Code: [Select]
function GetXin(xinput)
local hreg = mc.mcRegGetHandle(inst, string.format("mcX360_LUA/%s", xinput))
return mc.mcRegGetValue(hreg) -- or return mc.mcRegGetValueLong(hreg)
end

DazTheGas



Dear Sir


I change it and still, I can not get the feed in the stateusList



------- Declaer local---------------
local mInst = mc.mcGetInstance()
local Xenable= 0

-------------- Ps3 Init Panel------------

Ps3_Penal = wx.wxPanel( wx.NULL , wx.wxID_ANY , wx.wxDefaultPosition , wx.wxDefaultSize)
Ps3_Timer = wx.wxTimer (Ps3_Penal)
Ps3_Timer : Start(100)

----------- Fauntion----------------

function GetXin(xinput)
        local hreg = mc.mcRegGetHandle(inst, string.format("mcX360_LUA/%s", xinput))
        return mc.mcRegGetValueLong(hreg)
    end

------------Event Timers-------------
Ps3_Penal : Connect (wx.wxEVT_TIMER , function(event)
      
      if GetXin("LTR_Val") > 150 and Xenable == 0 then
         Xenable = 1
         mc.mcCntlSetLastError(mInst , "Ps3 Running")
         
      elseif GetXin ("LTR_Val") < 50 and Xenable == 1 then
         Xenable =0
         mc.mcCntlSetLastError(mInst , "Ps3 Stopped")
         
      end   
      
      
   end   )

4
Mach4 Plugins / Re: mcX360 Plugin for Lua
« on: September 22, 2018, 02:37:40 PM »
It would be easier to post what code you are using.

DazTheGas



Posts: 7


   

Re: mcX360 Plugin for Lua
« Reply #77 on: September 20, 2018, 04:31:35 AM »
 

as I motion that the Register Diagnostics /mcX360_LUA give me a value when I press any bottom

I follow your video step by step and this is the code


 ------- Declaer local---------------
local mInst = mc.mcGetInstance()
local Xenable= 0

-------------- Ps3 Init Panel------------

Ps3_Penal = wx.wxPanel( wx.NULL , wx.wxID_ANY , wx.wxDefaultPosition , wx.wxDefaultSize)
Ps3_Timer = wx.wxTimer (Ps3_Penal)
Ps3_Timer : Start(100)

----------- Function----------------

function GetXin(Xinput)
   local hreg = mc.mcRegGetHandle(mInst , string.format("mcX360_LUA/%s") , Xinput)
   return mc.mcRegGetHandle(hreg)
end

------------Event Timers-------------
Ps3_Penal : Connect (wx.wxEVT_TIMER , function(event)
     
      if GetXin("LTR_Val") > 150 and Xenable == 0 then
         Xenable = 1
         mc.mcCntlSetLastError(mInst , "Ps3 Running")
         
      elseif GetXin ("LTR_Val") < 50 and Xenable == 1 then
         Xenable =0
         mc.mcCntlSetLastError(mInst , "Ps3 Stopped")
         
      end   
     
     
   end   )

5
Mach4 Plugins / Re: mcX360 Plugin for Lua
« on: September 20, 2018, 05:31:35 AM »
as I motion that the Register Diagnostics /mcX360_LUA give me a value when I press any bottom

I follow your video step by step and this is the code


 ------- Declaer local---------------
local mInst = mc.mcGetInstance()
local Xenable= 0

-------------- Ps3 Init Panel------------

Ps3_Penal = wx.wxPanel( wx.NULL , wx.wxID_ANY , wx.wxDefaultPosition , wx.wxDefaultSize)
Ps3_Timer = wx.wxTimer (Ps3_Penal)
Ps3_Timer : Start(100)

----------- Function----------------

function GetXin(Xinput)
   local hreg = mc.mcRegGetHandle(mInst , string.format("mcX360_LUA/%s") , Xinput)
   return mc.mcRegGetHandle(hreg)
end

------------Event Timers-------------
Ps3_Penal : Connect (wx.wxEVT_TIMER , function(event)
      
      if GetXin("LTR_Val") > 150 and Xenable == 0 then
         Xenable = 1
         mc.mcCntlSetLastError(mInst , "Ps3 Running")
         
      elseif GetXin ("LTR_Val") < 50 and Xenable == 1 then
         Xenable =0
         mc.mcCntlSetLastError(mInst , "Ps3 Stopped")
         
      end   
      
      
   end   )

6
Mach4 Plugins / Re: mcX360 Plugin for Lua
« on: September 19, 2018, 03:28:04 PM »
This was made for an XBox controller only.

DazTheGas

First of all, thank you for the good video
You say that the lua you but it only for XBox 360 but I hook my the PS3 controller and check the Register Diagnostics /mcX360_LAU and it gives me a value!!

The problem in my case that when I try to code the software help me with the function. because I'm not that good in coding and I'm learning from your video.

Like when I type (Local or mc.mcRegGetHandle) it the software help me find them

but in case of (mc.mcGetInstance(), Start) there is NO option to select from.


Did I do something wrong?


Best regard
shrooqi


7
General Mach Discussion / Re: mach3 cnfig.
« on: September 20, 2011, 05:39:45 AM »
Is this the one?

8
General Mach Discussion / Re: mach3 cnfig.
« on: September 20, 2011, 05:14:31 AM »
sorry but i'm now in this stuff :)
what an xml file?
do u mean the diagram for the wiring or the breakout bord mannul?

9
General Mach Discussion / Re: mach3 cnfig.
« on: September 20, 2011, 04:59:43 AM »
32bit

10
General Mach Discussion / mach3 cnfig.
« on: September 20, 2011, 03:30:45 AM »
Hi guys,
I'm new in this forum and I really enjoy doing my project in cnc by ((build your own cnc me chain)).The project was going good until I face mach3.i have breakout board 5v with rellay. I do the connection as the video and the book description
http://www.youtube.com/user/anajonesr?ob=5#p/u/11/0D2uYMVrglw. I think the motor is connect in proper way because when I do the test as the book show the motor lock when the motor is connect to the electricity and free when it disconnect. But when I do the config for the mach3 and connent the breakout boards to my computer it not working. i do the config. as the bearkout board munnal. I test the cable and all the pins are good. I think the problem is from cofig. because I see this video and it not the same http://www.youtube.com/watch?v=uglCm_qsojk . What does u think is the problem?
My computer operates with win7.
Pleas guys I need help I’m having a nightmare.

Pages: 1