Hello Guest it is March 29, 2024, 03:17:28 AM

Author Topic: Lua Gcode calls and screenLoadScript sigLib communication help...  (Read 6794 times)

0 Members and 1 Guest are viewing this topic.

Re: Lua Gcode calls and screenLoadScript sigLib communication help...
« Reply #10 on: May 28, 2015, 07:46:19 AM »
Hi Dan.

yah, I've dove into it. It is a wonderful insight on how we can create user tables, save and clear current data -> execute our tool change at our own defined position -> recall our work offset position, G54, axis coord, etc prior to tool change data, and begin working again, etc. Same familiar concept; just in a new language. The code is fast. I mean really fast and with Lua we get an easy & customizable user interface that we can tailor to our liking or program for our specific requirements. (Now, think of industry...requirements generation, the specific knowledge to comprehend, understand, and program cnc machines to achieve those results. I am not talking video games now. I am talking about physical material being manipulated into what is required for a specific function for a capability for the masses. What Mach4 allows us is a base / core / platform to create a package for industry that is tailored to their specific needs. They had to do this because of competitive markets, competition, and not to mention it is just a smart move in order to grab a market share of industry. That is the beauty of it! For the hobby user, the hobbyist can write a macro or two and sell it for $1-$5 maybe to the general public through paypal and instant download. "Hey Mach 3 had this function, I like this function. Where is this function? What...? I need to learn coding? Forget that. I can afford $3 to get my function back"...So now Mach 4 has given opportunity to hobbyists to offer their time and effort for programming CNC functions...that through the Mach4 platform and motion control devices should give you exceptionally better real time response. Does this matter to the hobbyist? Maybe, maybe not. Hey I like it. But for industry, this is huge. This is not Haas and proprietary software. Mach4 is a platform tailored to execute several axes of machines, at the same time, in different coordinate planes to reduce time and cost and improve efficiencies that is truly affordable. You know what's funny? We are talking about Lua wx libraries for user interfaces that were created in 2002, Lua which has been a popular user interface programming language for a decade, and a CNC software platform that has been in Beta testing for three years.

(Scripting manual...that is pretty cool, gotta read line by line very carefully. It really is about merging Gcode and Lua together, basically the same thing as Mach3 did with Visual Basic)

(see Mach 4 customization manual...ya, where is that? ...and the appendices? lol! The dog must of ate Art and Brian's homework. I think the customization manual is just referring to the wx library that is C++ and GUI, hence wxLua or a lot f the screen calls (user interface object like programming...think point and click vs. cmd line entry; for example wx.wxMessageBox "enter your text here" and a dialog box appears which data that you want to see for step debugging variables or processes with fast response)

my hardware...Its small. haha! now that's funny  :D I just have benchtop mill that I put together along with making the controller box from scratch. just a project like I think many of us do as hobbyists with a thirst for "How is that made?" "How do they do that?" ...and then, the potential in which you start doing what you love to do and your hobby starts to provide financial income and stability. Hat's off to those who have made it happen. I'm jealous.
« Last Edit: May 28, 2015, 07:49:53 AM by 20,000 Axes »
Re: Lua Gcode calls and screenLoadScript sigLib communication help...
« Reply #11 on: May 28, 2015, 07:35:39 PM »
nutz...MachGUI locks up when written into a button script. It compiles and runs fine in mcLUA and I am able to initiate movement and stop movement on tne tool setter but the GUI locks up when the motion is complete. any ideas?

Even tried this loop. Compiles and works in mcLua, works in button script but GUI just doesn't like it. Even adjusted PLC rate to 100....

while mc.mcSignalGetState (hSig) ~= 1 do
    mc.mcCntlSetLastError (inst, "Approaching tool setter")     
    if mc.mcSignalGetState (hSig) == 1 then
    break
    end
end
Re: Lua Gcode calls and screenLoadScript sigLib communication help...
« Reply #12 on: May 29, 2015, 12:32:12 AM »
Can functions be defined in the PLC scripts and arguments be passed back to them from button scripts? or do I need to build a module? But I would just be asking if I can use it in the PLC...

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Lua Gcode calls and screenLoadScript sigLib communication help...
« Reply #13 on: May 31, 2015, 08:16:37 AM »
1). Yes
2). you can also use a module.
3). the module can also be used in the PLC

Another option is to put your func's in the load screen, and your calls in the PLC.
If you have a lot of funcs, it might just be easier to put it in a module to reduce clutter.

Scott
fun times
Re: Lua Gcode calls and screenLoadScript sigLib communication help...
« Reply #14 on: June 02, 2015, 12:30:13 AM »
Thanx for answering! I appreciate it...load screen, plc...but what about the signal script? Is the signal script only created to handle external IO events by passing them to/from the load screen? I put a signal reference table into the plc and the signal script didn't like that at all....it started crying :o) So I put the signal reference table back into the load screen and the signal script did not give a nil error. Just curious, that's all. I think the plc's job is to monitor internal signals and functions calls (am I close?). Btw, I have been through the toolbox like 1000 times and it is really starting to click. Thanx for sharing and educating all of us!

--josh
« Last Edit: June 02, 2015, 12:32:20 AM by Screwie Louie »

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: Lua Gcode calls and screenLoadScript sigLib communication help...
« Reply #15 on: June 02, 2015, 12:55:03 AM »
poppa bear and YaNvNo and secret helper plus the other boys have done a shed load of good stuff, what I think is good they don't always give answers just good pointers to the answer.