05-14-2025 03:57 AM
Hello,
I would like to create a grid of buttons that return a value when pressed. The button should later represent a channel number so that the user can select channels via the grid.
I think creating 100 buttons, arranging them and processing the data via 100 events is not really a good way. Does anyone have any ideas on how to implement this? Unfortunately, this requirement is quite strictly demanded by the user. Iam using LV 2025....
Best regards
Ole
Solved! Go to Solution.
05-14-2025 06:20 AM
I found a simple solution...
05-14-2025 06:22 AM
here is the vi:
05-14-2025 09:40 AM
It would help to do a "save for previous", (2020 0r below) before attaching. Most here (including me!) don't have LabVIEW 2025 installed.
What are the requirements?
05-14-2025 11:30 AM - edited 05-14-2025 11:32 AM
OK, I had a quick look at your VI and you only seem to allow one "kanal" to be active. (buttons are latch action)
Here's equivalent code:
You don't need the timeout event, it does nothing useful.
05-14-2025 12:29 PM
Use a radio button. No coding needed.
You can copy / paste buttons within radio button. So 2 buttons becomes 4, 4 becomes 8, ...
05-14-2025 01:40 PM
They already had the complete cluster.
I wish there was an easy way to directly convert a cluster of boolean controls to a radiobutton control...
05-14-2025 01:50 PM
@altenbach wrote:
They already had the complete cluster.
But re-create a radio button from scratch isn't that hard.
I wish there was an easy way to directly convert a cluster of boolean controls to a radiobutton control...
Just copy all the buttons in the cluster and paste to a radio button.
05-14-2025 05:22 PM - edited 05-15-2025 08:36 AM
Creating a cluster control (or radio button control) with 100s of individually named and labeled buttons is just way too tedious and inflexible.
As mentioned earlier an image would be much more scalable. All we need is a reusable subVI to create the "image" of a button array and now we have full control over size, #of rows/Columns, button labels, button and text colors, button sizes, fonts, etc. etc.
If the first click should instantly exit the subVI with the selection, the code would be even simpler! (not shown)
For a more general case, it would be easy to recreate the image with each mouse interaction, e.g. to toggle the color of the clicked "button". The possibilities are endless.
05-15-2025 01:34 AM
Hey guys! Thanks for the help. This was my first topic in this forum. @altenbach next time will try to stick to your suggestions regarding problem description! I marked the ButtonArray.vi as solution 🙂