LabVIEW: Simple event structure

I searched everywhere to get an example or some help of a simple event structure and a state machine working together. I have used state machines extensively and really like the way they work but never tried implementing an event structure into it.
Here is a very simple state machine which runs through an initialising state and then sits in a running state. The event structure is in the running state and monitors the two button for a state change and also the close window button. 
Initialise button: Takes the program back into the Initialising state.
Stop button: Takes the program into the Stop state and then stops the program.
Close Window: Show a message that the program must first be stopped before it can be closed. Then takes the program into the CloseWindow state and then back to the Running state.

I am sure there are much better ways to perform this task so if you have any tips please leave me a comment. As soon as I find a more efficient process, I will be sure to update this post and program.
To download the example VI, use this link.
Greg

LabVIEW: Sending an email to a gmail account

Logging to a database in a LabVIEW application has its uses, however sending test results as an email can also be very useful. Sending an email to a Google (gmail) account is relatively simple using .NET constructors.

By using the various constructors, an email can be sent using an existing gmail account. (Click here to get a gmail account.) The email can be sent to a recipient, carbon copied to a recipient and even have an attachment added. 
By using the VI as part of an application, any string can be written and sent as an email. I used this VI to email results for an automated test so that I could monitor its progress after each test was completed. Logging to a database is also very effective but sometimes it’s easier to access an email account over accessing a results database.
To download the example VI, use this link.
Greg

LabVIEW: Reinitialise all indicators

There are times in a LabVIEW program that where you need to reinitialise all the front panel indicators and controls to their respective default values. I like to do this as the first step before the VI is run so that I know that everything is in a default state.

This can be done by using a property node for each indicator or control. With large programs this can become very tedious and add a significant amount of unwanted clutter.

There is another, easy way to accomplish this and that is to use a reference to the current vi and an invoke node. 

By adding this VI at the start of your program, all the indicators and controls are initialised to their default values. 

To download the example VI, use this link.

Greg