12-16-2009 04:08 AM
A quick question for those that know!
I have written a small queue manager VI for using with QSMs. The Q manager has a type defined enum for STATES and a type defined 'state cluster' which is just a cluster of the state enum and variant data for passing between states.
Currently when I use this Q manager in a new state machine (Say.. AppCtrl) I save a copy of it and the type defs with a new name eg. QMGR_AppCtrl, State_AppCtrl and StateClstr_AppCtrl.
It seems there must be a better way than this? Are libraries the way to go? Could I somehow create a template I can put on the pallete such that when I drag a Q manager onto a VI it automatically adds a new type defd state enum and cluster to the project?
Many Thanks,
Steve.
12-17-2009 05:15 AM
12-17-2009 05:54 AM
You already mentioned the keyword 'template'. Those have the file extensions *.vit and *.ctt. You can create a template from the New.. dialog and select VI Template or Control Template.
If you place the vit inside your template folder, you can access it via the same New.. dialog (but this is not working with controls). But you can have the ctt's (and other vit's)placed inside your vit (you need to try around how to place it as templates, those are shown with a big blue T on the diagram)
You can also place it on your palette to drop it on the BD of your project.
My knownledge is limited to LV 7.1, where this wasn't smooth and it was improved in later versions. I found out most by trial-and-error, as the behaviour is a bit different if you browse for the ctt/vit from the palette browse option, drop it from a user palette or drag-and-drop it from the explorer (Win). Furthermore, the behaviour also seems to be dependent wether you edit a vi or vi-template. Also there are some options available if you edit the palette (right click on the vi/vit).
Felix