10-09-2017 04:46 PM - edited 10-09-2017 05:12 PM
Hello all. I have a slight problem that I have not been able to pull it out, for just about a couple of months now... The executable of this VI, just
freezes randomly and I do not know why. I've tried many fixes in my code, and still the problem persists.
I attached some images instead of code, because I have many subVI's. I don't know if I upload the whole project, you are going to be able to
reproduce it. Funny thing when I'm debugging, this error (freeze) won't appear.
Basically my code is based on STATE-EVENT architecture. Inside two states I have and event on each state. In this two events I'm waiting
for a code to be scanned (control string receives code) and after this event is generate I exit the respective event and go to another state in the
state machine. So my guess is like this:
States Event Status
WAIT SnorkelDummy Yes OK
WRITE SnorkelDummy No OK
WAIT Blower Yes I'm guessing that here the error comes, and VI freezes
WRITE Blower No I think the problem is not produce here, because no
event is in this state.
Can someone PLEASE help me with this issue. I'm driving nuts here!!
Solved! Go to Solution.
10-09-2017 05:07 PM
With event structures, it is possible to lock the front panel until an event is handled. For instance, if you're not in the "Wait Blower" state but you change the "Blower WR" value, it could lock up your front panel until that event is handled, which may be never, locking your UI. If you edit the event structure you can see if "Lock panel" is checked or not.
In general, it is good to only have a single event structure to make it harder to run into this situation.
10-10-2017 07:47 AM - edited 10-10-2017 07:49 AM
Based on your statement, I still don't understand how can the Blower WR state change if:
So, I'm still wondering how does it activates (as you mention) and locks my UI.
Anyhow, just as one more test... I'm going to follow your advice to have only 1 'event structure' and see how this works. I attached a screenshot
of the part of the code I replaced with a while loop; just waiting for a 'value BLOWER WR' to happen.
Thanks for you reply.
10-10-2017 08:43 AM
You clearly have race condition and DATA FLOW problem.
Run your code with Execution highlight and it will be clear to you.
You are read the string control Blower WR when the loop starts, and just before your loop can iterate you clear the control again. You will alway read an empty string from the control.
10-10-2017 12:05 PM
I don't think it's race condition. Because inside event 'BLOWER value change' I save the new value in a cluster. When the event loop exits, I clear
the control value for next iteration.
also this issue I'm having just happens randomly. It could happen only once per day or it can even pass 3 days with no error, then at the 4th it appears. So weird. I'm going to testing first. Then evaluate and see the outcome. I'll be posting for any news.
Thanks for your answer by the way, I really appreciate it.