LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to keep value of a selected cell in a table?

Solved!
Go to solution

Hi Application engineers,

 

I would like to confirm my selection for keeping the value of my selected cell in a table. The value is selected using mouse click down, The indicator, Element 1, updates the cell's value as soon as mouse is clicked down as shown in the top loop.  for a comparison, I added a OK button in the bottom loop to confirm my selection in case I make a wrong click, I like the value to update only when I click the OK button to trig the event,  However, the indicator, Element 2, does not update at all,  and the cell position changes to (-2,-2) as soon as mouse moves out of the selected cell.  See attached vi. 

edmonton_0-1642564091799.png

 

 

Could someone help me with the issue?

 

Thanks,

Gu

 

 

0 Kudos
Message 1 of 4
(279 Views)
Solution
Accepted by edmonton

You are not using dataflow and event structures properly. In the lower loop, for example, execution is paused until you click Ok. This makes difficult to terminate the vi, besides not doing what you want.

Here is an example of what you can do instead, in a single loop.

When you click on a cell, the cell content is put in a shift register, which is a temporary storage where you can retrieve the selected value by pressing Ok. Remark that I changed the Stop behaviour to Latch when released.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019
Message 2 of 4
(244 Views)
Solution
Accepted by edmonton

Hello,

 

Your upper loop updates at least each 100ms.

Your lower loop updates Element2 at each click on OK button (or other hidden event) & 100ms has elapsed, then updates the Table Control and wait for the next event so the data on element2 are always linked to the last state after an event has occured.

 

By looking at your description and VI it seems all your worries will be solved with creating a producer/consumer architecture and a queue.

 

Message 3 of 4
(243 Views)

Hi  pincpanter,

 

Thank you very much.

 

Gu

0 Kudos
Message 4 of 4
(212 Views)