Jump to content
Sign in to follow this  
Mark Balla

Share your favorite User lib Vis

Recommended Posts

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.


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

Share this post

Link to post
Share on other sites

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.


Share this post

Link to post
Share on other sites

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.



Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.