06-02-2008 02:16 PM
06-04-2008 12:23 AM
Hi Kenneth
Thank you for using our discussion forums.
It sounds like you are programming everything correctly. In order to get parallel execution you my employ parallel loops and sometimes this will lead to large block diagrams. One thing that can suggest is logically group chucks of code into subVIs. This will reduce the amount of code on the main calling VI’s block diagram. Please note that just grouping chucks of code into subVIs will not always result in identical operation because of the dataflow model that LabVIEW is based on. Remember that a subVI will not start executing until it has received all its inputs, and it will not output any data until it has totally finished executing. This could lead to problems if the subVI’s output is needed for another process, or if there is a while loop within the subVI. However with proper use you can have subVI operating in parallel.
Have a look at the following example on the DeveloperZone.
http://zone.ni.com/devzone/cda/epd/p/id/5891
This example employs multiple producer consumer loops all running in parallel. There are many things going on in the block diagram and it is too large to be placed on one screen of the block diagram, however it is logically orientated and easily readable.
Another thing I want to point you to is the templates that LabVIEW offers. If you go to File>>New you can browse through the From Template folder and see all the premade templates that are available. These include the State Machine (case structure inside a while loop that you mentioned in your post) to more sophisticated templates like the producer consumer parallel loop design.
Lastly I want to point you to a few very helpful links that I have come across regarding parallel design. I think you will find them interesting.
http://forums.ni.com/ni/board/message?board.id=170&message.id=276634&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=170&message.id=211149&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=170&message.id=223309&requireLogin=False
Chris_K