11-12-2019 08:49 AM - edited 11-12-2019 08:49 AM
Hello gents, here i attach my first attempts with a state machine program, the steps i want to do are the following:
-read data
-see datas in the graph
-bonus state: if data are not correct click led button in the tab control and then click button to go back to state of see datas in graph, otherwise just click button to go to final state (fine)
- end (fine)
Here is my VI i can't quite figure what's the problem, can you help me?
Solved! Go to Solution.
11-12-2019 09:45 AM
Ugh. "Data" is the plural of "datum". No such thing as "Datas" (outside of STNG, I suppose). Sorry, you're the one millionth customer to make that mistake, so you get the grumpy reward. 😉
11-13-2019 02:05 AM
Hey, thanks very helpful... it was just a typing error because you can see I wrote it right the first time.
I studied latin so i know that.
Anyway you didn't answer to my question.
Quo usque tandem abutere, billko, patientia nostra?
11-13-2019 04:18 AM
There is at least a missing subvi in your code, I replaced it with a constant faking some data.
I never used the function Wait for front panel activity, but it does not seem to wait anything, as you would also see running the program with Highlight Execution on. Thus, the program runs through the various states and quickly reaches "Fine". Which is not fine, actually.
To solve this, you may stick to "Bonus wait" until either "Fine" or "Order data" become true, however you need to take care of some details, for example you should initialize all your controls (add an "Init" state to do so), put Wait nodes to prevent running too quick, reset booleans when needed and so on. Also try to keep the BD more ordered, it will help you to think better.
11-13-2019 05:52 AM
Yes thanks for the help, apparently the wait for front panel activity function doesn't seem to wait, i solved the issue putting in the inner case structure "0,Default" the state case Bonus Wait, so after a couple quick iterations the function Wait for front panel activity seems actually to wait.
But i think I'll have to chance approach to the problem in a different way because it won't be very handy in the future if i keep going with this approach to change/choose between states.