Trying to add buttons, and led's to a custom panel

More
23 Aug 2019 10:46 #142938 by Kiddekanin
Hi.

In the events of trying to understand hal pins outputs and so on, I am currently trying to add a button that can light a led signal.

My starting point was to copy the tool_sensor files and trying to duplicate the whole thing, just with a button that should light a led

Im pretty shure that it is some naming that I have wrong ( I can't quite destinguis between a name tool_sensor and a function or element tool_name) It might also just be the chain of events that I dont understand:

Here is what i currently have:

1:The tool_sensor is embedded in gmoccapy and the botton toogles the probe led (so loong so good... (bad danish translation :P)
2: I oppened glade and made a new led and new button "beacon_light"
this shows up in gmoccapy
I then went to the tool_sensor.hal file and tried to mimic the input (here is where I might have failed in regards to a name and a "function".)
#tool.sensor.hal input lines
net tool_sensor tool_sensor.btn_tool_sensor
net tool_sensor motion.probe-input
net tool_sensor tool_sensor.led_tool_sensor

#this is the inputs Made. replaced the tool.sensor with beacon_light
net beacon_light tool_sensor.btn_beacon_light
net beacon_light estop-ext
net beacon_light tool_sensor.led_beacon_light

If i # the 3 lines out, gmoccapy shows the panel just fine, but if I un# them the panel wont show in gmoccapy.


Ini entry:
#USERTABS
EMBED_TAB_NAME = OSCO tooling
EMBED_TAB_LOCATION = box_right
EMBED_TAB_COMMAND = gladevcp -x {XID} -H tool_sensor.hal tool_sensor.glade
#hal files
[HAL]
HALUI = halui
HALFILE = OSCO.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal
The tool_sensor.hal is not mentioned here... but it is called in the tabs ?

view from glade editor:
Attachments:

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

More
23 Aug 2019 11:37 #142944 by Kiddekanin
Yihaw. Trial and error....

I got the led to blink:
_____________________________________
net beacon_light tool_sensor.btn_beacon_light
#net beacon_light motion.probe-input
net beacon_light tool_sensor.led_beacon_light
_____________________________________

so it would seem that it is my "real sensor" that is making the troubles.


Should'nt I be able to net ie. the function from the limit switch to the beacon light. and hereby trigger the led light by either the button or the breakout board :S

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

More
23 Aug 2019 12:59 #142949 by tommylight
RodW has a nice thread here about lights and how to wire them in hal for machine ready, machine working, or machine needs attention, with 3 lights in diferent colors. He has buttons added for those functions also, so it might be beter suited to what you need.

forum.linuxcnc.org/24-hal-components/321...ghts-red-amber-green
The following user(s) said Thank You: Kiddekanin

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

More
23 Aug 2019 14:21 #142954 by pl7i92
Hi
you shoudt have started your tread on what system you are on What GUI you are using
so many views no answer
means most dont know the system you are working on
its not pyvcp ;-) and no axis

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

Moderators: newbynobiHansU
Time to create page: 0.147 seconds
Powered by Kunena Forum