led pyvpc

More
22 Mar 2012 20:44 #18714 by lorisdag
led pyvpc was created by lorisdag
good day, I would want to know if it is possible to bind together a led pyvpc with a codiceM, example if active m101 the led changes color

Please Log in or Create an account to join the conversation.

More
22 Mar 2012 21:55 #18721 by BigJohnT
Replied by BigJohnT on topic Re:led pyvpc
You can turn on and off pyvcp leds from the M1xx files, look at the M1xx examples in the manual.

John

Please Log in or Create an account to join the conversation.

More
24 Mar 2012 10:54 #18753 by lorisdag
Replied by lorisdag on topic Re:led pyvpc
Hello John, I read the manual but I can not, in my cnc
I turn on the vacuum pump with the code in the m120 and would like to gcode
axis in turn led to a monitor if it is turned on or not
thanks lorisdag

Please Log in or Create an account to join the conversation.

More
24 Mar 2012 11:59 #18755 by BigJohnT
Replied by BigJohnT on topic Re:led pyvpc
Can you post the code your having problems with and try and explain the problem in a bit more detail. I can't understand what your question is...

John

Please Log in or Create an account to join the conversation.

More
24 Mar 2012 15:02 - 24 Mar 2012 17:39 #18757 by ArcEye
Replied by ArcEye on topic Re:led pyvpc
Hi

I think I understand what you are asking, here is an example

Create a LED called say led1 in your pyvcp script ( normally custompanel.xml) with something like
<vbox>
          <hbox>
                    <label><text>"   red led  "</text><font>("Helvetica",8)</font></label>
                    <led>
                         <halpin>"led1"</halpin> 
                         <size>15</size> 
                         <on_color>"red"</on_color>
                         <off_color>"green"</off_color>
                    </led>

            </hbox>
   </vbox>

When your vacuum pump is active, from your M120 script call
halcmd setp pyvcp.led1 true (it will show red)

When the vacuum pump turns off again call
halcmd setp pyvcp.led1 false (it will show green)

led1 does not have to be connected to anything at all for this to work, but you may have to set its default state in your custom_postgui.hal file on startup.

regards
Last edit: 24 Mar 2012 17:39 by ArcEye.

Please Log in or Create an account to join the conversation.

More
24 Mar 2012 17:33 - 24 Mar 2012 17:40 #18761 by ArcEye
Replied by ArcEye on topic Re:led pyvpc
PS

A more normal way of activating LEDs is by linking pyvcp LEDs to signals, such as coolant activation.

For instance:

Using the same .xml to create a LED , pyvcp.led1

In the main .hal file, mist coolant relay is linked to iocontrol

net coolant-mist <= iocontrol.0.coolant-mist => parport.0.pin-17-out (pin 17 is coolant relay)

In the custom_postgui.hal file, the signal coolant-mist is linked to pyvcp.led1

net coolant-mist => pyvcp.led1

Then every time coolant-mist is active (TRUE) the LED turns red.

Hopefully between the 2 examples your query is answered

regards
Last edit: 24 Mar 2012 17:40 by ArcEye.

Please Log in or Create an account to join the conversation.

More
24 Mar 2012 19:32 #18762 by lorisdag
Replied by lorisdag on topic Re:led pyvpc
Hi guys, I feel tomorrow .. thank you very much
hello loris

Please Log in or Create an account to join the conversation.

More
26 Mar 2012 08:20 #18800 by lorisdag
Replied by lorisdag on topic Re:led pyvpc
hi, thanks for everything perfect collaboration
loris:) :) :) :) :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.150 seconds
Powered by Kunena Forum