I have a while loop inside a few casestatements. I think I isolated the problem down to the while loop. When the program enters the while loop, I am unable to use the exit 'stop' button, as well as the data field which the data is being received. This seems like a pretty simple problem, and maybe I'm over looking something, but I've tried a bunch of different configurations and no luck.
I tried changing the button mechanisms, I've tried changing the sampling rate of the while loop (giving the cpu more time to recognize a button depress), but still nothing. Setting the button to a false state before entering the loop will allow the program to run once, then loop back to the start of the case statement, where it waits for the user to choose whether or not to read (so I guess I know that the signals coming from the button work). The problem is simply having access to use the button.
Without the button, my program stays in reading state, reading data off the TCP connection. Honestly I have no idea why this won't work. I attached a picture of my diagram, highlighting the problematic areas.