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.
Could someone help me with the issue?
Solved! Go to Solution.
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.
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.