[Redirected to the emc-users mailing list -- please use public forums
when requesting help with emc]

When I followed your directions, emc displayed the following error:
    postgui.hal:1: Signal 'led' can not add OUT pin 'pyvcp.my-checkbutton'
This is because your 'net' command does not make sense.  When emc
rejects your hal configuration, read and understand the message, because
it is the key to resolving the problem.

Here is why it does not make sense:  A signal can have one "writer", but
my-button and my-checkbutton are both "writers".

When I revised the 'net' line to read
    net led pyvcp.my-led pyvcp.my-checkbutton
the state of the LED follows the state of the checkbutton.

If you want to have either of these sources affect the button, then you
have to add "something else" which controls how the two information
sources interact.  Perhaps it is an 'or2' component.  'or2' works like
a 2-input OR gate in electronics.  Assuming that you do not already
otherwise use the 'or2' component, the lines for your postgui.hal file
would be something like this:
    loadrt or2 count=1
    addf or2.0 servo-thread

    net b1  pyvcp.my-button => or2.0.in0
    net b2  pyvcp.my-checkbutton => or2.0.in1
    net led or2.0.out => pyvcp.my-led

Jeff


Original message follows for the benefit of emc-users:
On Sat, Sep 06, 2008 at 02:32:58PM -0700, Olusegun A. wrote:
> I have a problem with using my CHECKBUTTON or BUTTON to switch ON my LED.
> I have tried the following.
>  
> IN THE HAL section of my ini file I created POST_HALFILE = postgui.hal
>  
> then,
> I created a postgui.hal file that is: net led pyvcp.my-led pyvcp.my-button 
> pyvcp.my-checkbutton
>  
> already;
> I have added this to my test.xml file:
> <pyvcp>
> <checkbutton>
> <halpin>"my-checkbutton"</halpin>
> </checkbutton>
> <led>
> <halpin>"my-led"</halpin>
> <size>50</size>
> <on_color>"blue"</on_color>
> <off_color>"black"</off_color>
> </led>
> <button>
> <halpin>"my-button"</halpin>
> <text>"ON"</text>
> </button>
> </pyvcp> 
>  
> WHAT DO I DO TO MAKE THIS WORK, I WANT THE BUTTON OR CHECK BUTTON TO 
> SWITCH-ON MY-LED.
>  
> Thank you
>  
> 
> Olusegun Abode 
> +234 8037045535 
> Email:[EMAIL PROTECTED]
> 
> 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to