Hello Guest it is December 12, 2019, 02:16:04 PM

Author Topic: Mach3 or Mach4 MDI Serial Input  (Read 1153 times)

0 Members and 1 Guest are viewing this topic.

Mach3 or Mach4 MDI Serial Input
« on: October 02, 2016, 12:39:41 AM »
Hello Everyone,

I am trying to find a way to send Mach 3 or Mach4 (Im Flexible) MDI commands threw a serial interface.

I have searched the forums but mostly find results for modbus.

Any ideas will be very much appreciated.

Thank You

-Adam
Re: Mach3 or Mach4 MDI Serial Input
« Reply #1 on: October 03, 2016, 06:32:28 AM »
Hi,
I'm not sure is the short answer.

The longer answer is I think its possible.

If you sent a text string corresponding to a Gcode line then Mach could execute that
line by line.

If using M3 then something like:

while(true)
   gcodeLine=(a text string from serial input device)
   if(gcodeline !='EOF')then
         code(gcodeLine)
   else
          break
   end
end

Please not my VB skill is absolute rubbish and the chances of that working as is nill but
the idea should work.

I have only recently bought a licence for Mach4 so can't say for sure that this will work
but there is a 'serial plugin' in M4 which sounds rather hopeful for what you wish to achieve.

Loop
Get some serial data from the plugin;
construct a Gcode line from that data;
mc.mcCntlGcodeExecute(inst,yourGcodeLine)
end loop.

The Lua scripting language in Mach4 is a bit baffling to start with but its ultimate flexibility
and power exceeds VB. If you're going to write scripts and so on I think Lua is where you
should invest the effort. Certainly that was the conclusion I came to. Whereas Mach3 is good
Mach4 is shaping up to being brilliant.

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach3 or Mach4 MDI Serial Input
« Reply #2 on: October 03, 2016, 01:30:17 PM »
Why do you need tp do MDI (Manual Data Input) by Serial interface?

Mach3 was not designed to use a Serial input format.