Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: mcardoso on April 06, 2021, 10:16:00 AM

Title: Mach 4/LUA Ethernet Explicit Messaging
Post by: mcardoso on April 06, 2021, 10:16:00 AM
Hi All,

I'm just curious for the time being if this is possible. I would like to interface Mach 4 to a servo drive which can communicate over Ethernet/IP. The motion control signals will be Step and Direction coming from an Ethernet Smoothstepper, however I can also pull diagnostic information over Ethernet *if* there is a way to form and transmit a generic ethernet packet using LUA in Mach 4.

I did something similar a few years back using the serial port to pull diagnostics out of a servo drive and that actually worked great, now I'd like to repeat the endeavour using a different servo drive and Ethernet/IP.

So the question is: does anyone know of a LUA function or library which supports read/write over Ethernet?

Thanks much,

Mike
 
Title: Re: Mach 4/LUA Ethernet Explicit Messaging
Post by: smurph on April 08, 2021, 12:24:21 AM
Mach4 comes with the LuaSockets module that can do what you want. 

http://w3.impa.br/~diego/software/luasocket/reference.html (http://w3.impa.br/~diego/software/luasocket/reference.html)

Warning: It isn't for the feint or heart.  :(  But it is possible.

Steve