![]() |
State machine in LabVIEW?
Hey,
So I have been wondering... I want to help students write in LabVIEW next year, but I really don't know it all that well myself yet. First off, last year I had, in C, a state machine for autonomous. It was an integer paired up with a giant switch/case; there were states for "moving forward", "turning left", "short segment moving forward", etc. It worked well. But it only worked well because there was a round robin method of execution--the arm control code got executed (feedback loops for the arm joints), the drivetrain control code got executed (feedback loops for the two crab drive mechanisms), and any other support code got called, once a loop. Now that we have LabVIEW, how do I implement a similar setup? I have seen a Case statement for LabVIEW, but does that exclude any other code that might need to be executing? I need my feedback loops in one spot, executing all the time. How are auton and teleop separated in LabVIEW? I am trying to write up something that will at least take user controls as input (instead of encoders and sensors) and output to "motors"--indicators. Is there a better method to learn LabVIEW? Thanks for your help...now that I am back to being a n00b...:D JBot EDIT: For that matter, how do I regulate a feedback loop to run exactly every X milliseconds? |
Re: State machine in LabVIEW?
Quote:
Quote:
Quote:
|
Re: State machine in LabVIEW?
Quote:
For the general case, a simple "Wait Until Next ms Multiple" VI will do the trick. It takes into account the time that the code in the loop takes to execute and should give you a consistent loop rate. -Joe |
Re: State machine in LabVIEW?
Thanks for the advice.
Quote:
I wish things weren't so fuzzy. Working on a beta team would have been so exciting! JBot |
| All times are GMT -5. The time now is 18:32. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi