Hello Guest it is April 26, 2024, 03:40:24 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.


Topics - wildu

Pages: 1
1
Mach4 Toolbox / Read external input
« on: August 05, 2017, 07:42:56 PM »


Hello everyone, I'm new working with Mach 4 and I have the following problem:

I made a M Code (M110) to read an external input and depending on its state show a text. The problem is that running the M110 from the MDI does not read the input and I do not know if I have to activate something or I have to do it another way.

Thanks for the help...

Test code:

function m110()

   local inst = mc.mcGetInstance()
   hReg = mc.mcIoGetHandle(inst, mc.ISIG_INPUT1)
   
   if hReg == 1 then
        wx.wxMessageBox("External input activated!")
    else
        wx.wxMessageBox("External input disabled!")
    end
end

if (mc.mcInEditor() == 1) then
 m110()
end

2
General Mach Discussion / Read external input
« on: August 04, 2017, 11:04:30 PM »
Hello everyone, I'm new working with Mach 4 and I have the following problem:

I made a M Code (M110) to read an external input and depending on its state show a text. The problem is that running the M110 from the MDI does not read the input and I do not know if I have to activate something or I have to do it another way.

Thanks for the help...

Test code:

function m110()

   local inst = mc.mcGetInstance()
   hReg = mc.mcIoGetHandle(inst, mc.ISIG_INPUT1)
   
   if hReg == 1 then
        wx.wxMessageBox("External input activated!")
    else
        wx.wxMessageBox("External input disabled!")
    end
end

if (mc.mcInEditor() == 1) then
 m110()
end






Pages: 1