Simple LED Question
13 May 2015 00:07 #58603
by rjshust
Simple LED Question was created by rjshust
My first post here, so please be gentle.
I recently finished up my cnc router (call it a blacktoe clone) for hobby work, and I have been busy playing with it.
I am now trying to figure out PyVCP with some success. I have buttons to jog the axis, go home, router/spindle power on/off.
I want to have an LED to show if the power is on or off to the router (pin 14 on my setup), but for some reason I am having no luck. I have built the LED in the panel, and given it a halpin name. I assume my problem is with the postgui.hal, but I don't know that for sure.
First question, do you think this is a problem with the postgui.hal, or am I on a wild goose chase?
Second question, if this is a problem with postgui.hal, then could someone give me a code example on how to wire this LED up?
Thanks for any ideas given,
Rob
I recently finished up my cnc router (call it a blacktoe clone) for hobby work, and I have been busy playing with it.
I am now trying to figure out PyVCP with some success. I have buttons to jog the axis, go home, router/spindle power on/off.
I want to have an LED to show if the power is on or off to the router (pin 14 on my setup), but for some reason I am having no luck. I have built the LED in the panel, and given it a halpin name. I assume my problem is with the postgui.hal, but I don't know that for sure.
First question, do you think this is a problem with the postgui.hal, or am I on a wild goose chase?
Second question, if this is a problem with postgui.hal, then could someone give me a code example on how to wire this LED up?
Thanks for any ideas given,
Rob
Please Log in or Create an account to join the conversation.
13 May 2015 13:24 #58619
by ArcEye
Replied by ArcEye on topic Simple LED Question
Hi
You will need to post your hal files and your xml file for the panel.
We cannot guess what is in them.
regards
You will need to post your hal files and your xml file for the panel.
We cannot guess what is in them.
regards
Please Log in or Create an account to join the conversation.
14 May 2015 03:39 #58656
by rjshust
Replied by rjshust on topic Simple LED Question
Files are attached. Let me know if there is anything else I can add.
Here is the custompanel xml for the button:
Rob
Here is the custompanel xml for the button:
<hbox>
<relief>FLAT</relief>
<bd>2</bd>
<label>
<text>"Router Power"</text>
<font>("Helvetica",16)</font>
</label>
<led>
<halpin>"Pin-14"</halpin>
<font>("Helvetica",25)</font>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</led>
</hbox>
Rob
Please Log in or Create an account to join the conversation.
14 May 2015 06:32 - 14 May 2015 06:34 #58659
by BigJohnT
Replied by BigJohnT on topic Simple LED Question
You have the line net spindle-on => pypvc.Pin-14 in the post gui hal file commented out so it will never work.
If you open up the Show Hal Configuration you can see the status of pins and signals.
JT
If you open up the Show Hal Configuration you can see the status of pins and signals.
JT
Last edit: 14 May 2015 06:34 by BigJohnT.
Please Log in or Create an account to join the conversation.
14 May 2015 11:48 #58662
by rjshust
Replied by rjshust on topic Simple LED Question
I get this error when that line is not commented out:
I can attach entire error message if needed.
Debug file information:
.
custom_postgui.hal:18: Pin 'pypvc.Pin-14' does not exist
4184
PID TTY STAT TIME COMMAND
4254
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components
I can attach entire error message if needed.
Please Log in or Create an account to join the conversation.
14 May 2015 13:27 #58664
by cmorley
Replied by cmorley on topic Simple LED Question
looks like you spelled the pin wrong :
pyvcp.Pin-14 not pypvc
Chris M
pyvcp.Pin-14 not pypvc
Chris M
The following user(s) said Thank You: rjshust
Please Log in or Create an account to join the conversation.
14 May 2015 21:55 #58689
by rjshust
Replied by rjshust on topic Simple LED Question
Thank you - Thank you - Thank you
I feel so stupid.
I spent hours trying to figure out how I was wiring it up wrong, and it was just a spelling error.
I feel so stupid.
I spent hours trying to figure out how I was wiring it up wrong, and it was just a spelling error.
Please Log in or Create an account to join the conversation.
22 May 2015 00:27 #58921
by rjshust
Replied by rjshust on topic Simple LED Question
Follow up question.
Is it possible to alternate between 2 images instead of 2 color for the on/off? If yes, could I get a quick code snippet?
I have no problem displaying a single image
I just don't know how to alternate between of/off like we do for colors
Rob
Is it possible to alternate between 2 images instead of 2 color for the on/off? If yes, could I get a quick code snippet?
I have no problem displaying a single image
<image name='stop' file='Stop.gif'/>
<vbox>
<image_bit halpin='selectimage' images='stop'/>
</vbox>
I just don't know how to alternate between of/off like we do for colors
<led>
<halpin>"Pin-14"</halpin>
<on_color>"green"</on_color>
<off_color>"red"</off_color>
</led>
Rob
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5008
- Thank you received: 1440
22 May 2015 10:16 #58928
by Todd Zuercher
Replied by Todd Zuercher on topic Simple LED Question
Yes it is possible, but a bit different. In fact it is possible to choose between multiple images. It has been quite a while since I did it my self (can't remember it all). Tomorrow I'll post a copy of the config I set up. It has 8 windows that describe the state of the 8 VFDs on an 8 spindle gang router. The indecators are different color boxes with text saying things like "RUN", "STOP", "FAULT", "ACCEL", "DECEL"...
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5008
- Thank you received: 1440
22 May 2015 10:30 #58929
by Todd Zuercher
Replied by Todd Zuercher on topic Simple LED Question
Here is the config
Please Log in or Create an account to join the conversation.
Time to create page: 0.092 seconds