LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deciding which vi template is best

I've been developing LabVIEW programs for a long time but have not actively used this site.  So, this is my first post and hopefully not my last!  I started using LabVIEW with version 3.1 and have seen a bunch of great improvements.  I have a suggestion (unless it's already been done and I don't know about it -- a very real possibility!).  The templates that you can select from when creating a new vi are a very handy tool and since I took the advanced class I received some additional templates that were packaged on a cd that came with the class, this gives me a nice variety of templates to start from.  My problem is, I struggle to decide which is the most appropriate template to use when starting a project.  I have developed a whole project completely from one template then when things got very difficult switched to a different scheme and found the program to write and perform much better. 
 
Question:  Is there or could there be a guideline or flow chart that could pinpoint the strongest design template for a given project?  Included in this would be what are the most important criteria to consider in your project when choosing the right design?
 
I know I am late to the party --- but better late than never!  Please, let me know if this is something that has been completed or is being considered.  Thanks.
 
Tom Haggerty
Message 1 of 9
(3,552 Views)

I would be very interested in this as well as someone who is not sure exactly which template to use.

 

-- Matt

Message 2 of 9
(3,524 Views)

Hi Tom,

If you are using LabVIEW 8.0 or later, the templates give a description of which types of applications can best utilize these structures.  Outside of this, there is nothing that has been created that helps pinpoint exactly what template to use.

Please let me know if you have any further questions.  Best of luck on your application, and have a great day!!

Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
Message 3 of 9
(3,513 Views)

OK,

Thanks Ching.  I looked more closely at the descriptions for the design patterns after I read your note.  They are good but intuitive -- they don't tell you anything more than can be deduced right from the name!  I think it may be worth it to include a "This design pattern is better suited to X application  when timing is critical but that design pattern is better if timing is not critical...."  or if file management, test sequencing or any other key criteria is the most important, do a same sort of comparison. 

Obviously each application and each programmer is different so there is no "right answer" as to the correct design pattern but I know some templates work better than others in different situations -- the queued message handler worked much better for me when designing a diagnostic CAN tool to send and receive specifically requested data from an ECU than the standard state machine.  Although, I started designing with the standard state machine and didn't switch to the queued message handler until the code got to be very unmanageable!  I could have finished it with the standard state machine -- but forget anyone else being able to figure out what was going on (the cases to go from state to state were getting very complicated).  With the queued message handler and the ability to insert or add multiple next steps, the code became much easier to follow.

In the intermediate class, I was given a flow chart that served as a guide to how we chose our design pattern for our project but it was specific to the task for the class, something broader but similar could maybe serve as a good guide.

0 Kudos
Message 4 of 9
(3,487 Views)

Hi Tom,

If you think that having a list of appropriate applications for a specific template would be useful, you can submit a product suggestion here.

For more information on the different templates, please take a look at this presentation.

Since LabVIEW is used by a variety of industries, it is difficult to have examples specific to each industry.  That is why the descriptions are currently so generic.

Please let me know if you have any further questions?

Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
Message 5 of 9
(3,458 Views)

Thanks Ching,

The presentation you linked to is what I was looking for.  I agree with you that it would be hard to specify design patterns for applications because of the diversity of programs that are written.  i think the presentation does an excellent job in showing the pros and cons of each pattern.

0 Kudos
Message 6 of 9
(3,439 Views)
Extreme kudos to you Ching for posting that! That is an extremely informative presentation! Good timing too, because I am attempting to code my very first state machine.
 
I do have a question maybe you or somebody else can answer. In the .zip file there is a state machine (BuckRogersFolder.llb), and under the "Check Status" state there is a type cast that feeds input to a case structure. I've attached a picture of it below.
 
 I for the life of me, cannot figure out how the type cast works in this case. How is that able to trigger a particular case?  I understand you can convert letters to numbers with a typecast...but how is this typecast able to select a case to run?
 
Thanks guys!
 
-- Matt
 
 
Edit: Now with attachy goodness!

Message Edited by LabViewNubie on 03-01-2007 12:22 PM

0 Kudos
Message 7 of 9
(3,430 Views)

When a state has more than one transision it can take and the condition required to take more than one of those transisions is true, we need a way to establish a priority for one over the other (Hmm Herman Melville would be proud of that sentance Smiley Very Happy ).

By type casting the increment to each of the transistions the first "true" causes the while loop to terminate and the state transition occurs.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 9
(3,421 Views)

Thank you Ishmael...I mean, Ben! 😉

These state machines are pretty slick. Now only if my application was firing a ray gun...I would be set.

 

-- Matt

0 Kudos
Message 9 of 9
(3,415 Views)