Hi,
thank you all for you help.

> A pin created by a python userspace component can be linked to a signal
> with the "net" command, just like any other HAL pin.

I thought about that, but I could not find 'net' command.

Can this be done from the Python script without calling halcmd?

I just tried this and it worked very well:

    h=hal.component("mycomp")
    h.newpin("com-pos", hal.HAL_FLOAT, hal.HAL_IN)
    h.ready()
    msg=Popen('halcmd net emcmot.03.pos-cmd mycomp.com-pos', shell=True, 
stdout=PIPE).stdout.read()

    h['com-pos'] = newpos


It's fast and feels responsive. Nice. Real time is not a requirement.

However I have the feeling that that's not the nicest solution. I guess 
I should use the 'loadusr' hal coammnd in my .hal file to load the scrip 
and use the '-Wn mycom' parameter to wait for the creation of my 
component and than create the link between the signal and my pin in the 
.hal file.

See you
Florian

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

Reply via email to