LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Buttons not working when returned to early state in state machine.

Solved!
Go to solution

Hi,

 

I have uploaded a program which is used to back up data. I used a state machine with various states. The 1st state is intialization, from which it automatically moves to select state, which is used to select one of the remaining states to copy the data. The selection is done by resprective buttons. Once u pressed a button, it goes to that respective state and in that state when u press backup, the backup of data happens. Once the backup happens the program goes back into the select state. Until here it works fine. The problem comes next. Once it has gone back to the select state after copy has been performed, then none of the buttons are working. So when it goes back to select state and i tried to select a state, nothing is happening, not even the stop button is working. I dont know why is this happen. Please help me solve this problem. Thanking You in advance. 

Download All
0 Kudos
Message 1 of 5
(3,355 Views)

Sorry, my laptop is only 1080p and I cannot efficiently even look at your code.

If I have to scroll just to switch cases, I won't bother. 😞

0 Kudos
Message 2 of 5
(3,341 Views)
Solution
Accepted by topic author vindsan

You have many states where you have event structures ("All Data" "Data Older Than" "Data Younger Than" "Defined Data")  (Worse there are two of them in "Defined Data")

 

Each of those event structures are for a "Backup" Mouse Down event.  Now one oddity is why you are using a Mouse Down event on a button.  That should really be a value change event.  But that's not the big problem.

 

The big problem is all of those event structures are set to lock the front panel until the event case completes.  Well when you hit the mouse down on that button, all 4 of those event structures queue up that event.  If you are luckly, one of the event structures will execute and process the event.  The others you'll never execute because the state machine won't got through those cases.)

 

You should not have multiple event structures in you VI and certainly not buried in event cases.

 

Read Caveats and Recommendations when Using Events in LabVIEW

 

Then fix the architecture of your VI.  You should limit event structures to either a separate parallel loop, or to a single case of your state machine that your code will frequently go back to, without any other user interaction, in order to service the event structure.

Message 3 of 5
(3,328 Views)

I have an idea... Ctrl+drag should be banned, at least in framed structures.

0 Kudos
Message 4 of 5
(3,314 Views)

Hi 

 

0 Kudos
Message 5 of 5
(3,277 Views)