Correct,  I did not modify any code for those signals, that was just the 
name I gave them.

As for the tool change, I am using Chris Morley's remap in python,

#   This is a component of LinuxCNC
#   Copyright 2014 Chris Morley
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 2 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
from stdglue import *

def index_fanuc_lathe_tool(self,**words):
     try:
         # check there is a tool number from the Gcode
         cblock = self.blocks[self.remap_level]
         if not cblock.t_flag:
             self.set_errormsg("T requires a tool number")
             return INTERP_ERROR
         tool_raw = int(cblock.t_number)

         # If it's less then 100 someone forgot to add the wear #, so we 
added it automatically
         # separate out tool number (tool) and wear number (wear), add 
10000 to wear number
         if tool_raw <100:
             tool_raw=tool_raw*100
         tool = int(tool_raw/100)
         wear = 10000 + tool_raw % 100

         # uncomment for debugging
         #print'***tool#',cblock.t_number,'toolraw:',tool_raw,'tool 
split:',tool,'wear split',wear

         # check for tool number entry in tool file
         (status, pocket) = self.find_tool_pocket(tool)
         if status != INTERP_OK:
             self.set_errormsg("T%d: tool entry not found" % (tool))
             return status

         # if there is a wear number, check for it in the tool file
         # For wear offset 00, we dont require a tool 10000 entry in the 
tool file - so we will skip this check
         if wear>10000:
             (status, pocket) = self.find_tool_pocket(wear)
             if status != INTERP_OK:
                 self.set_errormsg("T%d: wear entry not found" % (wear))
                 return status

         # index tool immediately to tool number
         # immediately add tool offset
         self.execute("m6 T%d"% tool)
         self.execute("g43 h%d"% tool)

         # if the wear offset is specified, immediately add it's offset
         if wear>10000:
             self.execute("g43.2 h%d"% wear)

         # all good
         return INTERP_OK
     except Exception, e:
         self.set_errormsg("T%d index_fanuc_lathe_tool: %s" % 
(int(words['t']), e))
         return INTERP_ERROR



Rick




On 7/15/2015 1:14 PM, Sebastian Kuzminsky wrote:
> On 7/15/15 10:59 AM, Rick Lair wrote:
>> I'm not trying to do anything special, or use any thing special, That
>> was just what I managed to cobble together to get those m-code functions
>> together, they worked, so I left them alone,
>>
>> All I am trying to accomplish is when the operator enters a M41 (or
>> whichever of my remapped codes ), it puts out a signal that I can then
>> use however I need, ( in classicladder, directly to my 7i71 as an
>> output,,,,,,)
> Your M-code scripts manipulate signals (nets) with names that begin with
> "motion.", which was confusing to me.  Can you confirm that you have not
> modified the source code to the motion controller, and that instead you
> just have some nets (signals) in HAL that you created with these names?
>
>
>> If there is more proper way to handle those remapped m-codes I'm all
>> ears, as I have always said, I know just enough to be dangerous :)
>>
>> As for the python task, same thing, it's been on every INI file from the
>> start of me doing these machines,  I pretty much copy and past sections
>> onto my new builds. It is way easier than using pncconfig to get things
>> going, because we always have options that aren't available thru the
>> config utility, Resolvers, 7i80HD cards for example.
>>
>> I will remove that straight away from what you are saying.
> I wonder if it's needed for the "fanuc" style T-word remapping that
> you're using.  Please post that script too.
>
>

-- 

Thanks


Rick Lair
Superior Roll & Turning LLC
399 East Center Street
Petersburg MI, 49270
PH: 734-279-1831
FAX: 734-279-1166
www.superiorroll.com


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to