12-21-2020 11:14 PM
Hi,
Hope you are all keeping well,
I am struggling with an even structure coding in which I am looking for to cancel the entry in string if am at String 1 and cancel the entry in String & String1 when I am at String 2. Basically what I designed is after triggering START, string will allow to feed, once it is done it will allow to feed in string1 , and then string 2. If I would like to cancel any entry at any point of time by triggering cancel button. Attached is coding I am trying with which I am not successful so far.
Any help much will be much appreciated.
Solved! Go to Solution.
12-21-2020
11:30 PM
- last edited on
06-17-2025
12:25 PM
by
Content Cleaner
I DO NOT recommend that you have so many event structures in a single VI. That you have event structures trapped inside of case structures is going to cause a lot of problems.
Read Caveats and Recommendations when Using Events in LabVIEW - LabVIEW 2016 Help
I don't know what you mean exactly by "cancel" an entry or what you are doing with your "allow to feed". And once you progress through your VI, what do you with all this data you entered into these strings?
You should flatten your VI a bit. Have a single while loop. Set up a state machine so you know what part of your process you are in. Have a single event structure that acts on every event in a "wait for user input" state. Decide what to do next based on your current state and what event the user triggered.
12-22-2020 12:10 AM
Hi,
Thanks for your quick reply,
By saying "cancel" I mean if you made any entry in string ( in the front panel) and you want to cancel that entry , then I had given a cancel button to remove the entry in the string and to allow a new entry and same if I found entry in the string 2 found wrong then I would like to cancel both entry in string & string 1 and to allow new entry. Hope you got my requirement.
As you said going with a state machine will be able to do what I want , but I wonder why it is not working with an Event structure
Thanks for the link on events, I hope I will get something from that.
12-22-2020 04:15 PM - edited 12-22-2020 04:55 PM
I agree that your code makes very little sense and there are all these silly little things.
12-22-2020 04:53 PM
12-29-2020 08:30 PM
Hi,
it was nice to see a perfect solution which I was looking for before I went for holidays even though I made my application run as I want in a cumbersome way of coding.
Thanks for your time and effort for this solution.