Rod,

Again, I had the same experiance with trying to use Python for tool changer and 
went back to O code.  I know have a complete tool change program for a carousel 
style tool changer 
that raises the Z axis. Still in simulator, will be testing on real machine 
soon, but, it keeps track of everything, and uses the safety interlocks and 
prox switches etc..  What 
type of tool changer are you doing?

Thanks, Billy

On 04/01/2014 11:18 AM, Rod Fitzsimmons Frey wrote:
> Wow, this is frustrating. :)
>
> I can create HAL pins just fine, and wire them up with signals just-so.  I
> can watch them turn on and off at appropriate times with halscope, etc.
>
> BUT I can't access them anywhere from code! The remap code for M6 has the
> hal python component, but:
>
> 1. If I try to create the hal component (mine is called
> "hal_racktoolchange") it fails, since the constructor hal.component(name)
> CREATES the component.  The call fails in the remap because the component
> already exists
> 2. I can't simply ACCESS the component - only create it.
> 3. I can't access any pins without having a component - I've been through
> all the python and C++ code trying to find a way, but nadda.
> 4. I've tried bridging creation and access by using an intermediate python
> class that creates the pins and stores them as a global.  But when I access
> that class from the remapping code, it's entirely uninitialized - must be
> in a completely separate python interpreter.
>
> Without having a Hal "component" class instance, I'm basically hamstrung,
> and there is no way I can find to get an already-existing component.
>
> I really have to give up and fall back on the O codes.  But I'm left really
> not understanding why there is any Python interpreter available at all -
> you don't seem to be able to do anything with it, nothing that isn't
> trivial anyhow.
>
> Although I remain convinced there's a way - after all, the code that
> interprets the O code subroutines can do it with the #<_hal[HalItem]>
> syntax. I haven't been able to find the code that interprets those
> subroutines though.
>
>
>
>
> On Mon, Mar 31, 2014 at 5:40 PM, andy pugh <bodge...@gmail.com> wrote:
>
>> On 31 March 2014 22:13, Rod Fitzsimmons Frey <rodf...@gmail.com> wrote:
>>
>>> Everything's working great, I'm just getting hung up on communicating
>> with
>>> them from the python remap code. Looks like the suggestion of mapping to
>>> M64 commands is the way to go, although it seems a bit unsatisfying.  I
>> was
>>> really trying to do things in the most general way and the python
>> remapping
>>> seems like a wonderful avenue.
>> You can import "hal" into your Python and create HAL pins from your
>> code to connect to other HAL pins.
>>
>> It might even be possible to set hal pins from Python without
>> exporting pins, I can see a set_p function in help("hal")
>>
>> However, I think that exporting pins to HAL is the "right" way, rather
>> than hard-coding links in the software.
>>
>> --
>> atp
>> If you can't fix it, you don't own it.
>> http://www.ifixit.com/Manifesto
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Emc-users mailing list
>> Emc-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/emc-users
>>
> ------------------------------------------------------------------------------
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users

-- 
Billy Huddleston Inner Vision

*William Huddleston
Inner Vision Development Corp*
Office: 865.560.2752
Fax: 865.560.2703

http://www.ivdc.com
*Development and Consulting... Simplified.*

<http://www.facebook.com/pages/Inner-Vision-Development/120023721424> 
<http://twitter.com/ivdc> <http://www.linkedin.com/in/ivdccorp>

------------------------------------------------------------------------------
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to