Trying to add buttons, and led's to a custom panel
- Kiddekanin
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 3
23 Aug 2019 10:46 #142938
by Kiddekanin
Trying to add buttons, and led's to a custom panel was created 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 )
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:
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 )
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:
Please Log in or Create an account to join the conversation.
- Kiddekanin
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 3
23 Aug 2019 11:37 #142944
by Kiddekanin
Replied by Kiddekanin on topic Trying to add buttons, and led's to a custom panel
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
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
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19410
- Thank you received: 6507
23 Aug 2019 12:59 #142949
by tommylight
Replied by tommylight on topic Trying to add buttons, and led's to a custom panel
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
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.
- pl7i92
- Offline
- Platinum Member
Less
More
- Posts: 1890
- Thank you received: 356
23 Aug 2019 14:21 #142954
by pl7i92
Replied by pl7i92 on topic Trying to add buttons, and led's to a custom panel
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
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: newbynobi, HansU
Time to create page: 0.071 seconds