Hello Guest it is July 06, 2020, 05:56:12 PM

Author Topic: Read external input  (Read 1334 times)

0 Members and 1 Guest are viewing this topic.

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!")
        wx.wxMessageBox("External input disabled!")

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