LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Queued State Machine as Parellel Process Enabler

Hi nrp:

For the typedef and variant cluster, you need to right click the cluster border and choose autosizing >> align horizontally. Unfortunately you must do this each time you create the constant data packet, otherwise LabVIEW will always stack them vertically. Make sure you add the typedef first and then the variant data in to the cluster.



Anthony L.



Message 11 of 37
(4,326 Views)
OK, pretty good... I have a couple of comments:
  1. You make a mention under the section of "A High Level Layout of QSM-PC Architecture", you mention the  looking up the queue by name in a sub-vi.  This should be caveated, as continually opening references by name (without closing them), will cause a serious memory leak.  This should be specifically mentioned! 
  2. A "copy case" case should be  created if you are going to have  so many wires running through each case, so you can use duplicate case.
  3. There needs to be made a mention of using this architecture recursively.  IE, a sub-vi running this archtitecture needs to insure that different names are used for each queue.  otherwise you will have a queue created race condition. 
That is the bulk of my comments.  Feel free to look in my samples at my single loop implementation.  This is the base of my current code, which now natively handles multiple loops as well as parameter passing (although this is not in my 'free'; example, but you will see a couple implementations that you may wish to include (or not) to further simplify creation of the queue msg handler architecture. 
Of course opinions are like buttholes, everyone has them... and they all stink... 🙂

Paul
Message 12 of 37
(4,309 Views)
Thanks Anthony, nice tip. That is easier than manually rearranging the cluster.
0 Kudos
Message 13 of 37
(4,301 Views)
Stradis:

Your comments are appreciated. I am revising the article and will definitely include the material. I have yet to install LabVIEW 8.5 but once I do I will review your examples. I also spotted an interesting LAVA thread on this same topic which questions whether the Days of the Queued State Machine are now behind us.  I will include a link to that discussion as well. Regarding that specific thread, I think  the queued state machine is still important because it can be adapted to take advantage of LabVIEW upgrades and features such as LV Classes and hyperthreading.

Anthony L.
0 Kudos
Message 14 of 37
(4,281 Views)
Instead of using the constants, I prefer using a subVI which outputs the cluster and nothing else. That means the constant size on your BD never changes regardless of what you do to the cluster (e.g. add a long name to the enum). This is also relevant with other typedef clusters.

This is usually not needed for the shift register cluster (which usually does not need to be a typedef either), but if it's used in a subVI, or if it will be very big, I usually to prefer to do both.

I have a template for this, and have a piece of code which can copy and rename the template (there are all kinds of versions around), so if you need a new one, you just run that code and get a new copy of the template with the relevant subVIs and typedefs. The template includes wrapper subVIs for enqueuing (they have separate inputs for the enum and the variant) and for enqueuing several elements (similar, but you need to index the variant array in case it's empty).

___________________
Try to take over the world!
Message 15 of 37
(4,254 Views)
Hi tst:

Perhaps it would helpful to post a BD snapshot of your VI example that replaces the 'constants'. Otherwise, I was not able to grasp what you really meant by this.

Anthony
0 Kudos
Message 16 of 37
(4,239 Views)
tst,

This sounds like interesting code!

I have to be very careful whenever I try and clone one of my LV2 style (functional globalsm, action engines, or whatever we are calling them these days) by copying the VI directory structure the typedefs as otherwise its so easy to accidently click save and mess up the linking within the VI.

nrp
0 Kudos
Message 17 of 37
(4,228 Views)

Anthony wrote "... helpful to post a BD snapshot ..."

This image

comes from my typedef Nugget were I talk about encapsulating constants and documenting same.

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 18 of 37
(4,221 Views)

Anthony,

I have to tell you; your article is one of the best ones I have ever read concerning useful implementation of LabVIEW QSM.

 I have totally digested it and am greatful to you for sharing such important tricks of the trade so readily. 

Your style is excellent and the explanations are clear and vivid. ( Proof being I totally get it !)

If this particular breed of QSM is what the biggies are using then I would say please let us little pple also get some of these tremendously

useful example architectures into our hands so we can also be productive with LV.

Thank You!

 

 

0 Kudos
Message 19 of 37
(3,961 Views)
Hi NJG88_T:

Thanks for the encouraging comments.

One reason why I wrote that article is indeed because the QSM-PC architecture was one of the most empowering techniques that I have ever learned in LabVIEW. And this was after 4 years programming in LabVIEW using other not-so-good methods! I had read articles on the same but I was only able to capture the technnique after working one-on-one with other experienced developers. Following this experience, I felt that I had to write a comprehensive articles to give others a chance to come onboard.

I look forward to writting more articles in the near future.

Anthony


0 Kudos
Message 20 of 37
(3,942 Views)