Hello Guest it is March 28, 2024, 06:17:28 AM

Author Topic: Preload-Tool Macro  (Read 5418 times)

0 Members and 1 Guest are viewing this topic.

Re: Preload-Tool Macro
« Reply #10 on: February 25, 2017, 03:37:40 AM »
Of course, I understand that. But it seems like nobody has done it before. And those who did, dont really refer to something I can learn from. It's just tough to get into that, especially when you only have time on the weekends.

The PLC I am using is a Controllino Maxi PLC. You can program it for example with standard arduino IDE or others. Here's the link: https://controllino.biz

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Preload-Tool Macro
« Reply #11 on: February 25, 2017, 04:07:27 PM »
No modbus on that thing at all.  I see where someone is working on Modbus integration, but nothing more.  I'm not sure how one would communicate with that PLC at all at the moment.  I can assure you, there will be NO threads about how to hook Mach 4 to that one.  So you are own you own.  Nothing like being the first to try and do something!!  :)

We do have serial comms via LUA.  http://lua-users.org/lists/lua-l/2012-09/msg00554.html  That may be what you have to do.  

For the price (in fact, cheaper), the Automation Direct Click PLCs are comparable and a LOT more powerful.  Stackable.  Need more I/O in the future, no problem.  https://www.automationdirect.com/adc/Shopping/Catalog/Programmable_Controllers/CLICK_Series_PLCs_(Stackable_Micro_Brick)/PLC_Units

Steve
Re: Preload-Tool Macro
« Reply #12 on: February 26, 2017, 06:02:02 AM »
+1 on the Click.
I have one just to play with and the software is pretty good.
Looks like lots of people are using them for Mach3 and 4.

Mike
We never have the time or money to do it right the first time, but we somehow manage to do it twice and then spend the money to get it right.
Re: Preload-Tool Macro
« Reply #13 on: March 03, 2017, 11:54:52 AM »
+1 more for the Click
I'm using the Click for the tool changer on a mill here at the shop, as well as 90% of my I/O.  Easy to use and easy to setup modbus with Mach4.  I'm using the ethernet click for the speed on the I/O.
Chad Byrd
Re: Preload-Tool Macro
« Reply #14 on: March 03, 2017, 05:17:49 PM »
Steve, I've been wanting to add the Preload function to our mill for weeks now, today I finally jumped in and did it, it took all of 5 minutes with your "T" macro you posted on this topic.  It works great.
I'm talking to the Click PLC via Modbus Register.  Here is the code I'm using, hopefully someone else can get some use out of it.  =)

--Hurco Pocket Preload
function t(tool)

local inst = mc.mcGetInstance()
local Requested = mc.mcToolGetSelected(inst)
local Current = mc.mcToolGetCurrent(inst)

local tonumber ToolNum = Requested
local Pocket = mc.mcToolGetData (inst, mc.MTOOL_MILL_POCKET, ToolNum)
local DS2 = mc.mcRegGetHandle(inst,"Click/Requested Car Pos")
mc.mcRegSetValue(DS2,Pocket)

mc.mcCntlSetLastError(inst, "Preload Complete.")

end --t

if (mc.mcInEditor() == 1) then
 t()
end

Thanks again Steve!
Chad Byrd
Re: Preload-Tool Macro
« Reply #15 on: March 03, 2017, 06:23:10 PM »
Videos are fun.  Here is the end of the tool change and the start of the next tool.  Shows the prechanger working great. 

https://youtu.be/8Bj_U1tUhTo

ENJOY!
Chad Byrd

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Preload-Tool Macro
« Reply #16 on: March 03, 2017, 06:35:27 PM »
Nice!!!  I love it when a plan comes together.  Can you feel the powah?!?!  :)

You gotta love those Hurcos! 

Steve
« Last Edit: March 03, 2017, 06:37:10 PM by smurph »
Re: Preload-Tool Macro
« Reply #17 on: March 03, 2017, 07:40:06 PM »
Yes!   It's great!  =)  This is an older Hurco, but man it's heavy duty!!
Chad Byrd