raul.ionel Posted January 30, 2011 Report Share Posted January 30, 2011 Hello, I am a new user of Labview (2009) and implicitly of the JKI SM. I hope my question will be understood. I have developed a JKI SM based application which continuously reads data from a Labview simulated device (I created the Acquire case under “New Cathegory”) and displays it in a Chart. This state is triggered by a new button (Start Acquisition) placed in the Event structure, just like in the JKI SM presentation movie. In the Acquire state, by using a Select fed from another Front Panel button (Stop Acquisition) I can either go back to Idle (and Wait, Exit or restart the Acquire state) or continue executing the Acquire state. My problem is as follows. The order of my execution would be: Start Acquisition and display data. If I want I could return to Idle and wait, or keep on gathering data. However, if by mistake, during the acquisition state I press the Exit button found in JKI SM by default, the vi keeps on executing the Acquire state, displays data but all buttons on the front panel are “blocked”. If I push any of them nothing happens. Is there a way to solve this? I think the SM continuously executes the Acquire state (as it should) but due to a change in the state of the Exit button (which triggers the Idle State -> Macro:Exit) the front panel buttons do not respond to commands. Does my explanations make sense? Is there a way to solve this? Link to comment Share on other sites More sharing options...
Jim C Posted January 31, 2011 Report Share Posted January 31, 2011 I think the SM continuously executes the Acquire state (as it should) but due to a change in the state of the Exit button (which triggers the Idle State -> Macro:Exit) the front panel buttons do not respond to commands. You need to have your SM loop through the Idle state in order to respond to FP events. Something like: Start Acquisition, Display Data, Idle... Link to comment Share on other sites More sharing options...
raul.ionel Posted January 31, 2011 Author Report Share Posted January 31, 2011 Hello, I've managed to solve the problem by using Property Nodes-> Disable for the buttons. For example, when I am in the Acquire State, I Disable buttons which are not linked with this state. Then I can execute the state and as I exit the state, I use the same property node to re-enable all previously disabled buttons. I do not know if the idea is the best solution, but it does the job. Jim C., thank you for the answer. I will try to do that and see if it works. Thank you and if there are any other suggestions please let me know. Link to comment Share on other sites More sharing options...
Michael Aivaliotis Posted February 1, 2011 Report Share Posted February 1, 2011 Hello, I've managed to solve the problem by using Property Nodes-> Disable for the buttons. For example, when I am in the Acquire State, I Disable buttons which are not linked with this state. Then I can execute the state and as I exit the state, I use the same property node to re-enable all previously disabled buttons. I do not know if the idea is the best solution, but it does the job. Jim C., thank you for the answer. I will try to do that and see if it works. Thank you and if there are any other suggestions please let me know. Yes. This is the quickest way to solve this problem. You can either disable all front panel controls or display a modal dialog. Acquisition takes time and you're pretty much locked-in until it completes. If you must have control of the front panel while the acquisition is taking place, you could place your acquisition code in a parallel loop to the main state machine. Then send messages (via notifier or user event) to that code from the main loop. Hope this helps. Link to comment Share on other sites More sharing options...
raul.ionel Posted February 2, 2011 Author Report Share Posted February 2, 2011 Yes. This is the quickest way to solve this problem. You can either disable all front panel controls or display a modal dialog. Acquisition takes time and you're pretty much locked-in until it completes. If you must have control of the front panel while the acquisition is taking place, you could place your acquisition code in a parallel loop to the main state machine. Then send messages (via notifier or user event) to that code from the main loop. Hope this helps. Thank you for your answer and have a nice day. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.