LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure

Hi Guys..

            I have a very simple question.. but some how I can’t get my head around it.

            I have two types of buttons. 

                        A push on Type A button will sent number 123 to the next module

                        A push on Type B button will sent number 987 to the next module

                        Both type of buttons exits on one tab (same case structure)  

There are total of 8 tabs.

                        There are 50 Type A buttons, gets pushed all the time.

                        Only 2 Type B button ( type B is a dial), Type B button hardly every get pushed.  Only once a while..

 

           

Here is how I did it.. but I think its very inefficient!!

 

            In the Tab ( same case structure ), I placed a event structure. 

                        Event1 type A button pushed, sent 123 out to case structure, through case structure, goes out to next module.

                        Event 2 type B button pushed, sent 987 out to case structure, through case structure, goes to next module.

           

Problem

            Then adding a new event, I have to manually add 50 buttons to that one event… and this is just painful!!  And I think its dump way to do it.. in C all I have to do is,

            If (type B ==push)

                        {out = 987;

                        }

            else {

                        out = 123}

see.. 5 lines.. not even..

 

Pelase help

0 Kudos
Message 1 of 3
(2,798 Views)
Please attach your program.
 
Do you possibly have multiple event structures, one for each tab case? That's not good. Maybe I misunderstand?
 
Instead of individual buttons, use a 2D array of buttons (or a cluster of buttons). Now all you need is an event for the array value change. If needed you can add some code to determine which button was pressed.
0 Kudos
Message 2 of 3
(2,794 Views)

I will try using a cluster  but.. I thought if I use a 2nd array then I can't have different buttons..  that is all the buttons has to have the same caption.

0 Kudos
Message 3 of 3
(2,772 Views)