Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: adamj12b 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
-
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
-
Why do you need tp do MDI (Manual Data Input) by Serial interface?
Mach3 was not designed to use a Serial input format.