Hello Guest it is March 29, 2024, 06:42:07 AM

Author Topic: Lua script for feeding OEE  (Read 703 times)

0 Members and 1 Guest are viewing this topic.

Offline wz2b

*
  •  12 12
    • View Profile
Lua script for feeding OEE
« on: September 22, 2021, 12:14:35 PM »
I would like to get some basic operating state data (run state, is it estopped, maybe calculate cycle counts + cycles that ended in success or error) and get them out on to the network somehow, maybe via a socket.  Is Lua an appropriate way to do that?  It's Mach 4 Industrial build 2259.

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Lua script for feeding OEE
« Reply #1 on: September 22, 2021, 03:48:51 PM »
Yes, LUA has access to the Mach API.  See the API documentations in the doc folder.  And Luasockets is provided in the modules directory.  Will it be easy?  Probably not unless you are a seasoned programmer.  You will have to learn a few things, be able to handle a fair amount of frustration, and be willing to read a lot of very dry programming manuals (the LUA manuals).

Steve

Offline wz2b

*
  •  12 12
    • View Profile
Re: Lua script for feeding OEE
« Reply #2 on: September 22, 2021, 05:07:06 PM »
Thanks, Steve!  Part of the reason I was confused was the Docs folder was for some reason EMPTY.  I don't want to screw up the real installation so I installed Hobbyist just to get the Docs folder and it looks pretty understandable.

At one point in time, was there also a .DLL interface you could just attach to?  Or was that only a Mach 3 SDK thing?

(I'm a very experienced developer, but not so much in lua- though I have written quite a bit of network analysis code in Lua because it's built into Wireshark.  So I don't think that part should really be too bad).
Re: Lua script for feeding OEE
« Reply #3 on: September 22, 2021, 10:00:41 PM »
Hi,
the file you are looking for is Mach4API.chm.

You can chose it from the <Help Docs ?> button of the FileOps tab OR open it from Windows:
Mach4Hobby/Docs/Mach4API.chm.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'