To install the LabHSM toolkit:

1. Extract all the files preserving the folder structure into a temporary directory on a hard drive.
2. Place the "LabHSM Library" folder into the "<LabVIEW>\user.lib" folder. This will LabHSM to Functions/User Libraries palette.
3. Place "LabHSM - Loaded VIs.vi" and "LabHSM - Editor.llb" files into the "<LabVIEW>\project" folder. This will create two new options in the Tools pull-down menu called "LabHSM - Loaded VIs..." and "LabHSM - Editor..." respectively.
4. Place the Examples folder and the documentation wherever it is convenient for you. You can place them in the "<LabVIEW>\user.lib\LabHSM Library" folder if you want but their presence there is not neccessary for the toolkit to function normally.
5. (Optional) You may want to move or copy LabHSM - HSM Template.vit and LabHSM - HSM Template (no debug code).vit from the "LabHSM Library" folder to the "<LabVIEW>\templates\Frameworks" folder so that they will appear immediately when you select the "New..." on the File menu. If you do not move them, you can always use "Browse for Template..." to find them anyway. A new HSM VI can also be created using the merge vi LabHSM - HSM Template.vi or LabHSM - HSM Template (no debug code).vi, so the VIT is not really necessary at all.

To uninstall the LabHSM toolkit remove the LabHSM Library folder from the "<LabVIEW>\user.lib" folder and "LabHSM - Loaded VIs.vi" and "LabHSM - Editor.llb" from the "<LabVIEW>\project" folder. If you have moved or copied  LabHSM - HSM Template.vit and LabHSM - HSM Template (no debug code).vit, remove them as well.

Software Key

When you register your copy you will receive a personalized software key file. It needs to be placed in the "<LabVIEW>\user.lib\LabHSM Library" folder.
This will make the software stop displaying the nag messages and lift the limitation that the VIs based on the LabHSM template must have names starting with "Demo_". 

DO NOT DISTRIBUTE YOUR PERSONALIZED SOFTWARE KEY FILE WITH YOUR APPLICATIONS! THE RECIPIENTS OF YOUR APPLICATIONS MUST OBTAIN SEPARATE LICENSES FOR THE LABHSM TOOLKIT OR YOU MAY BUY ADDITIONAL LICENSES FOR THEM. Please see the Software License Agreement for details.

Getting Started

To create a new active object VI based on the HSM template:
1. Create a blank VI. Select "LabHSM - HSM Template.vi" from "Functions/User Libraries/LabHSM palette" and drop it on the block diagram. (Or choose the LabHSM - HSM Template.vit from the "File>>New..." menu.)
2. Save the VI under some name (It must start with "Demo_" if your LabHSM toolkit copy is not registered yet).
3. Launch the LabHSM Editor from the Tools menu.
4. Create a new HSM file in the LabHSM Editor by clicking on the New button or selecting New in the File menu.
5. Save the new HSM file under the same name and in the same folder as the VI you saved in step 2.

That's it! You already have a fully functional event-driven LabVIEW application. Well, it consists of only one active object so far and all it can do is exiting. However, it has all the plumbing code necessary to develop it further to any desirable functionality. While doing that you will work on a higher level of abstraction, thinking in terms of states, events and actions. The best part is that no matter how many times you add or change the functionality, no matter how complex the behavior becomes, the complexity of the code will not change much, because, basically, all that can change is the number of actions!

So, just add your states, events and actions in the LabHSM editor and completely define the behavior of your object there. Then (or at the same time if you wish) add the desired controls and indicators to the front panel and code for your actions into the respective cases of the Processing loop case structure. If you want to capture user events other than clicking on the Exit button and closing the front panel, modify the event structure to throw the necessary events in a way similar to the way it was done for the Exit button. 

You may also want to add some shift registers to the processing loop for your frequently accessed data or store (some of) it in external LV2 style globals. Use LabHSM template as a wrapper to give "life" and complex event-driven behavior to traditional GOOP objects! Just call their methods in the respective actions.

Turn on LabVIEW context help and hover the mouse over controls in the LabHSM Editor. Their descriptions will provide some additional detailed information on the options you have when describing desired HSM behavior.

Please check out the supplied examples and tutorials to learn how you can launch or even instantiate other active objects, post messages/events to self and send them between active objects on the same machine or over the network. You will also learn from the examples how to work with external timers which are just - you guessed right! - active objects too, which send messages to yours at the intervals you specify and can change at run time.

Using LabHSM with Application Builder

As you know, the dynamically called VIs must be explicitly included as source files in the Application builder. Therefore, any active object VIs you launch programmatically by using "LabHSM - Start VI.vi" must be explicitly listed as a source file. If you instantiate your active objects from a VIT template the way it's done in the Dining Philosophers example, the VIT file must be listed as a dynamic VI. Moreover, the Remove Panel setting on the VI Settings tab for it must be set to "No". Timer active objects are cloned from the "LabHSM - Timer.vit" file located in "<LabVIEW>\user.lib\LabHSM Library\LabHSM Library.llb". So,if you use timers the "LabHSM - Timer.vit" file must be included as a dynamic VI with the Remove Panel VI setting set to "No". If you utilize the "LabHSM - Enable Receiving Remote Messages.vi" to enable your active object to receive events across a network, you must also explicitly list as dynamic the following VIs from "<LabVIEW>\user.lib\LabHSM Library\LabHSM Library.llb": "LabHSM - Object message queue - Put message into.vi", "LabHSM - Object message queue - Obtain Wrapper.vi" and "LabHSM - Object message queue - Release Wrapper.vi".

