From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

select 3 item from listbox using event structure, problems??

The program is for select three iterms from a listbox.

I have 5 buttons:

“Next”: select next item from listbox;

“Previous”: select previous item;

Those two buttons work good.

 

“Select”: I click any item in listbox, and then click this “select”, then “next”, all 3 selections will start from this selected one. It works good as well.

 

“select1”, intend to select anyone item from listbox

“select3” intends to select anyone item from listbox (different from select, and select 1).

Problem is from those select1 and select3. once I click select1, select3 changes its item to be the same as select. It is same for selct3, once clicked, select1 changes its item to be the same as select.

I use event structure to do this. I think I did not do it right for those events, but I can not find it. I remove a lot staff from my VI, try to show simple Vi for my problem. Please take a look, see if you can help. I spend too much time on this.

0 Kudos
Message 1 of 9
(2,652 Views)

Hi,

I am having trouble understanding the purpose of Select 1 and Select3. Can you plaese elaborate on their purpose and erroneous behavior  so I can better understand the issue and help you out?

Regards,

Ankita

0 Kudos
Message 2 of 9
(2,632 Views)
Select 1 and select3 are for selecting two item, which are not next to item for "selet". If I just use "select", select 1 and select 3 are automatically selected, they are item before and after select.
If I use next, the item for "select" will move step by step from up to bottom in listbox.
Do I make you understand?  
0 Kudos
Message 3 of 9
(2,627 Views)
Hi,

It might help if you described in general what you want to accomplish, rather than asking what exactly isn't working. I'm a little confused on what you want to accomplish, and I'm afraid most users of your application might not be able to figure out what to do with 5 different selection buttons.

Basicly, what do you want the user to be able to select? What information do you want to display or output to other parts of the program? I appreciate you stripping down your code to this point.

Jarrod S.
National Instruments
0 Kudos
Message 4 of 9
(2,612 Views)
all right. Let me make it even simple to just show my problem.
0 Kudos
Message 5 of 9
(2,606 Views)

Here I make a new VI. When you click "NEXT",  String select 1, select 2, and select 3 will display three adjecent items from listbox. For instance, 1,2,3; 2,3,4; 4,5,6....  which is what I want.

I want add more functions in this vi. When I select any item, this item can be displayed in select 1 string, but keep "select 2 and select 3" item unchange (keep as they were). Same for "select 3". I can select any item in listbox and diplay it in "select 3", but "select 2 and slect 1" should not change.

In my previouse VI, I use event structure to accomplish it. I had problems, which may be also confue you to understand my VI. Now I delete what I made, and see if you can add those functions for select 1 and select 3.

Thank you in advance

 

0 Kudos
Message 6 of 9
(2,604 Views)
Hi,

That seems to make more sense. I've attached an example which does what you want, I think. It uses all event cases, so that each button's functionality is similar to the others. That should help you avoid some confusion. Let me know what you think about it. It seems like it's what you want.
Jarrod S.
National Instruments
0 Kudos
Message 7 of 9
(2,595 Views)
You don't quite define what should happen if prev/next is pressed once you have non-adjacent items picked.
 
Should string 1 and 3 be again (a) string 2 +/-1, or should they (b) increment relative to their current position? I have implemented solution (a), but it would be easy to change to the (b) functionality, it just needs a few more range checks.
 
Attached is a simple example (LabVIEW 8.0), modified from your VI. 🙂
0 Kudos
Message 8 of 9
(2,588 Views)

Thank you a lot. It looks great and works like I want.

I will try to combine it to my main Vi. THank you again. 5 *****

0 Kudos
Message 9 of 9
(2,587 Views)