06-09-2024 04:16 AM
Hello,
I have a issue with 2 event structures in the same VI, I think my approach is wrong but I do not know how to correct it.
Here is what I want to do:
With the 1st event structure, the user select data from a database and put the selected data in a table array, he should be able to do it several times in order to pick up all the desired data.
Then the 2nd event structure should be able to call the final data in the table array and treat it.
However, after the 1st event of the 1st event structure, the app is freezed and wait for action from the 2nd event structure. As I said this is not expected since the user should be able to make several events of the 1st event structure before triggering the 2nd event structure.
Both event strutcure are connected by a wire to pass the data.
I tried in options to unlock the panel but then the code inside the event structure does not work as it should.
The event is Mouse down which are may be not appropriate.
I am not so experienced in Labview, 1st time that I i use event structure.
Thanks for your help
Solved! Go to Solution.
06-09-2024 08:21 AM
From LabVIEW Fundamentals:
Avoid Placing Two Event Structures in One Loop:
"..NI recommends that you place only one Event structure in a loop. When an event occurs in this configuration, the Event structure handles the event, the loop iterates, and the Eventstructure waits for the next event to occur. If you place two Event structures in a single loop, the loop cannot iterate until both Event structures handle an event. If you have enabled front panel locking for the Event structures, the user interface of the VI can become unresponsive depending on how the user interacts with the front panel..."
06-09-2024 08:23 AM
Hi Thanks for your support,
Each event structure has its own while loop
I could fixed my issue with appropriate handling of each while loop stop condition.
06-09-2024 08:31 AM
To give you the most helpful responses, please do the following:
Bob Schor
06-09-2024 08:41 AM
Hello Bob,
Ok, here is what I have to do:
I want one button which allow to select one row of data from another array (database) and then fill another array with the selected data. The user should be able to repeat this action several times until he picked up all the desired data.
Then, I want that another button which call the array with selected data and treat it (means send via serial com to controller).
I hope it is now clear for you.
I choosed event structures which seems to be the most appropriate, but let me know if there better approach.
06-09-2024 09:07 AM
Hi MSIEV,
@MSIEV wrote:
I want one button which allow to select one row of data from another array (database) and then fill another array with the selected data. The user should be able to repeat this action several times until he picked up all the desired data.
Then, I want that another button which call the array with selected data and treat it (means send via serial com to controller).
Ok, there are two buttons on your frontpanel.
And you created two loops with two events structures to access the data of the very same array???
@MSIEV wrote:
I hope it is now clear for you.
No: why do you need two loops and two event structure to handle two buttons?
Whats' wrong wiht ONE loop containing ONE event structure with two (or more) event cases?
06-10-2024 02:05 AM
Hi
Quick update,
Finally I kept only 1 event structure in the VI for all the buttons.
It works as I expect.
Thanks