Gravity Lab – LabView Design

The Gravity Lab user interface main software utilizes an event driven producer consumer state machine architecture.

Software Design

The Gravity Lab user interface software is written in LabView.  The centralized or main code for this software can be functionality described as an event driven Producer Consumer state machine.   This means that there are two while loops running in parallel as pictured.  The top loop is the “Producer” and handles user events such as button clicks.  When an event occurs the “Producer” enqueues one or multiple states to be handled by the “Consumer” loop.

Startup

On Startup the main screen is hidden, and a splash screen is launched asynchronously and shown for 10seconds or until the user clicks it, then the main screen is shown.

After the splash screen is launched, another asynchronous VI is launched that continuously logs all the states that are consumed by the consumer loop.

 

Gravity Lab
Starting Splash Window
Main Window Startup

Next, four states are consumed, named: “constants_and_indicators”, “init”, “set_paths”, and “wait_on_splash”.

In the “init” state all the front panel control references are obtained and updated from a configuration file if needed.  If the configuration file does not exist, then it is created with default control values. The control references are then sent up to the producer loop with an event register.

The “constants_and_indicators” state is used to set the standard “g” to 9.80665 and enables the radio button that prevents the user from running the “SETUP LAB”, “ALIGN LASER”, “TIMING” and “POWER & DROP” buttons at the same time.  This reduces any confusion about the settings being used for the ball drop. 

The “set_paths” sets up the folder for images being loaded or saved, and where to put the dropped data.  This state allows a super user to set a different default path from the configuration file if desired.

The “wait_on_splash” state waits for the starting splash window to close or the timeout of 10 seconds to occur before showing the main screen.

Error

If an error occurs in this main code, or any of the asynchronously launched user interfaces, the error is logged in a human readable text file, and a red banner is displayed at the top of the main screen describing the error and giving the user the choice to ignore it or explore it through right click options on the error. 

Shutdown

Shutdown is handled when the user pushes the X in the upper right corner of the main vi or when the user selects File|Quit from the title bar.

Closing this main VI will close all Asynchronously launched Vis by sending the shutdown command to their queues.

Get In Touch!

What service(s) are you interested in?
Where can I reach you?
What would you like to discuss?