LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exiting event structures

Solved!
Go to solution

Hi,

 

I need to select an exercise from a table (see attached).  Goto the front panel and select a row with a mouse click then hover over an exercise.   Can anyone suggest graceful way of exiting out of the event structure by hitting the enter key and passing the exercise you have selected to a string indicator?? 

 

Thanks!

0 Kudos
Message 1 of 10
(3,750 Views)

I need to reduce or elliminate the jitter you see when selecting an exercise also.  Thanks again,

0 Kudos
Message 2 of 10
(3,749 Views)
Solution
Accepted by topic author Newton2this

 


@Newton2this wrote:

I need to select an exercise from a table (see attached). 


Unfortunately, you are using a multicolumn listbox, not a table. In order to select individual cells, you need to use a table control.

 

Attached is a simple implementation, maybe it can give you some ideas. (I also assigned the enter key to the stop button).

Message 3 of 10
(3,718 Views)

Nicely done!  I will need to convert the string array to an I32 however.  I am trying to minimize the impact to the rest of the code I am modifying.  Thank you for the help.  John

0 Kudos
Message 4 of 10
(3,704 Views)

With a tiny little math you can easily covert the cell coordinates directly to a unique I32. 😉

0 Kudos
Message 5 of 10
(3,694 Views)

Actually, it is not the cell coords I am interested in.  I see you are using an invoke node.  I need to access the tables 'item names' but of course it doesn't have any!  Only a property node does.  The array that controls the rest of the program (the one I am modifying) uses I32.  Any other ideas??

0 Kudos
Message 6 of 10
(3,686 Views)

The item names for a table IS the table date. It is a 2D array of strings!

 

How does the table entry relate to the I32 number you are trying to get out?

0 Kudos
Message 7 of 10
(3,684 Views)

That could be a problem!  The string array as you say is a 2D of strings.  The array I am after is a 1D array of I32 - this is the reason I created an idex value for each row element in my original program!  If you change the value '8' to a '16' on the block diagram the exercise index will give you the correct index for each element in the table 0-32.  This unfortunately will cause more jitter when you switch between columns 0 and 1.  Any more ideas?

0 Kudos
Message 8 of 10
(3,681 Views)

The original program, the one I am modifying was written with LabVIEW v. 6?  My customer chose to use 1D arrays for his state machine unfortunately making any changes to it difficult.

0 Kudos
Message 9 of 10
(3,675 Views)

Start out with a 1D array of strings and reshape it to a 2D array for the table. Once the item is selected, search the original table for the index or do some simple math.

0 Kudos
Message 10 of 10
(3,671 Views)