TG Posted September 10, 2007 Report Share Posted September 10, 2007 Here is one I just recently designed for myself and am using a lot. It's an extremely powerful yet relatively simple state machine design. I'll put it into the code repository someday. http://forums.lavag.org/index.php?act=attach&type=post&id=6897 LV Version 8.2.1 It is based on techniques described in the reference below. It has a lot of useful features. 1) It uses an elegant technique for dealing with automated systems, where all attempts must be made to continue execution (if possible) before shutting down an application. 2) It is a LIFO (Last In First Out) Queued type state machine. Instead of an array of enumerated types or a Queue the machine uses a multi line string of text states. the new line char "\n" separates states. This really helps with read-ability, and portability at the possible expense of execution speed and more attention to mispellings, etc. However, most state machines do not need light speed execution over read-ability so this is in my opinion not a real problem for a queue size of 50 states or less. With this framework it is possible to handle errors within the VI or escalate the error upwards to the caller. The framework provides an elegant mechanism to check if the error was handled correctly. If the error is corrected the SM will retry the offending state and continue execution normally (without ever telling you In automation this means an error can be logged and handled privately to the SM while continuing execution of critical tasks. ref:LabVIEW Advanced Programming Techniques Second Edition by Rick Bitter, Taqi Mohiuddin and Matt Nawrocki Quote Link to comment
Sparkette Posted March 23, 2009 Report Share Posted March 23, 2009 This one takes in a number of points, and draws the polygon in an XY graph. It outputs the points in a cluster of X and Y arrays. Quote Link to comment
RAJKU Posted March 23, 2009 Report Share Posted March 23, 2009 Here is a small utility VI which helps to log the timing (total execution time) details. This VI can handle nesting of states I had also attached an example which illustrates the usecase of the VI. Thanks Raj Quote Link to comment
Sparkette Posted March 25, 2009 Report Share Posted March 25, 2009 Here's another one I made. It's basically just like a digital flip-flop. Don't know how useful it would be in a professional environment, but cool nonetheless. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.