03-19-2015 03:04 PM
In my new-to-LV adventures I feel like I'm spinning my wheels to revinvent the wheel.
My project has modest complexity and it was advised to be a state machine architecture.
Can you post an example of a well-made state machine that of low to medium complexity?
I think If I could study several good examples, I could answer most of my questions.
Please post if you would like to share.
03-19-2015
03:10 PM
- last edited on
05-13-2025
03:37 PM
by
Content Cleaner
Hi Carmen,
create a new VI by selecting "Create project" from GettingStartedWindow. Then a dialog with several options will open - one of them is a simple statemachine!
(Atleast when you use LV2014…)
It's all described in the LabVIEW help!
03-19-2015 03:17 PM
I would also recommend reading Effective LabVIEW Programming. There are some really good concepts in ther for state machines.
03-19-2015 03:21 PM
My issue is going beyond the empty stock.
I hope to see some examples where people have dealt with some issues like:
getting data or tasks into an out of a shift register.
enabling and disabling loops of the state machine
decision making in the state machine
time stamp
file saving/opening
+ many other issues
So if you have a good state machine, I'd love to see it.
Thanks.
03-19-2015 03:24 PM
Hi Carmen,
getting data or tasks into an out of a shift register.
Well, use wires to do so!
enabling and disabling loops of the state machine
What "loops"? There is just one loop surrounding the state machine…
decision making in the state machine
That's up to you and depends on your task. You need to define those decisions before even starting to program…
time stamp
??? Is there any relation to a state machine?
file saving/opening
??? Is there any relation to a state machine?
+ many other issues
Which ones?
03-19-2015 03:34 PM
Do a search for JKI State Machine. I like it for the most part. I have modified it to remove the event structure because i didn't want the processing of the events to be delayed by the state machine. My app would run a series of states back to back and I had to inject an IDLE state to check for events, which wasn't ideal for me. May be okay for you however.
03-19-2015 04:20 PM
Please I'm trying to get a focused reponse.
vi's only. Thank you for your suggestions. I do appreciate your helping thoughts.
Please limit this conversation to posts of vi's and comments about why a particular state machine is a good one.
03-19-2015
04:29 PM
- last edited on
05-13-2025
03:38 PM
by
Content Cleaner
http://www.ni.com/white-paper/7604/en/
http://k12lab-support-pages.s3.amazonaws.com/lvadvancedhome4.html
https://www.youtube.com/watch?v=vtw6HMwaTIQ
This lot took me at least 8 seconds to find with Google. Invest a little more time and you could probably do even better 😉
(there really is a lot of stuff out there!)
EDIT - okay so this crossed with your last post, and is probably a tad sarcastic and looks even worse following your last reply. But you will do well with a bit of searching because, like you want to not re-invent the wheel, neither does everyone else when there are already so many good examples out there.
EDIT - for a little more complexity, check out the Continuous Measurement and Logging sample project template - althogh a slightly different architecture it has all the elements you listed and more.
03-19-2015 05:02 PM
You could also look at the CLD sample exams. The solutions are almost guaranteed to use a State Machine architecture and should have all of the elements it sounds like you are looking for.
03-19-2015 11:16 PM
@crossrulz wrote:
You could also look at the CLD sample exams. The solutions are almost guaranteed to use a State Machine architecture and should have all of the elements it sounds like you are looking for.
This is what I thought as well. Click the CLD Sample Exams link to download four sample exams each with a solution.
http://www.ni.com/gate/gb/GB_EKITCLDEXMPRP/US
Make sure to at least read the full prompt and think about how you might go about solving this before looking at the solution. If you can, take the time to try and program one yourself. You think you will learn a lot by just looking at the solution but you will learn a lot more by actually trying it yourself, struggling a bit, then seeing how you can avoid the problems that you were running into.