From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Program challenge

Hello,
I have posted a small program with which I am quite confused and stuck!
The program is supposed to:

1) Let the user choose which cell of the array they will write to
2) Enter a value into the Value control
3) The value will automatically be allocated to the chosen control
4) 1-3 will continue until the user is satisfied (cell values are to be filled in any order and may be rewritten a few times)

I'd really appreciate if you could look at the program and make any suggestions! Thank-you!

Ivanka
0 Kudos
Message 1 of 7
(2,546 Views)
Not sure I entirely understand what you are trying to do.
A couple of questions:

1. You have two arrays, what is the purpose of each array?

2. How do you want the user to choose which cell of the array to write to? (i.e. click on that array cell, use a numeric control to select the array index, etc)?

3. Specifically, in what way is the program you posted different from what you want?

One basic suggestion is that if you want the value to change immediately after the user enters it into the text box, the easiest way to do this is by using an event structure.

Please provide some more information on how the program should work and maybe we can offer some further suggestions.

Regards,
Ryan K.
0 Kudos
Message 2 of 7
(2,521 Views)
Thanks Ryan,

1) One array is an indicator, just showing the variable names. The second array (the control) collects values for the variables.

2)I would like the user to click on the cell they would like to choose.

3) The program is different, because data must first be entered into the Value control and then the cell must be clicked. I want that order reversed. Enter value first, then choose cell.

I tried using event structures, but I am not familiar with them and thus had no success.

Thank-you for your response!

IBAHKA
0 Kudos
Message 3 of 7
(2,520 Views)
Ivanka,
I believe this will do as you ask.
Dirk
0 Kudos
Message 4 of 7
(2,517 Views)
Here is a version with events. It basically works in the same way as Dirk's version except it allows you to change the values without having to click an extra button. Also lets you do nice usability things like automatically switch focus to the text box after the user selects a location. The disadvantage is that it's a little harder to understand/program.

Let me know if you you have any questions.

Regards,
Ryan K.
0 Kudos
Message 5 of 7
(2,461 Views)
Thnak-you!
It's great!
Ivanka
0 Kudos
Message 6 of 7
(2,458 Views)
Thanks Dirk,
The program gave me a good start.
Ivanka
0 Kudos
Message 7 of 7
(2,457 Views)