LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program structuring – newbie question

I've used LabVIEW off and on since 2011 college days (mechanical engineer). I would not consider myself experienced though. But lately I'm needing to use it more for work (test program). One thing I've always struggled with when starting from scratch, how to structure a program from the big picture standpoint. If I'm writing a program in Python or VBA for example it seems a lot easier, you go line by line, it's easy to add things, build things out, etc. With LabVIEW I've always struggled to see that same logical structure. It's always seemed very unintuitive what to do and where. Do you start from top down, or bottom up?

0 Kudos
Message 1 of 4
(154 Views)

Is there a reason to crosspost from Reddit?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(134 Views)

Program structuring – newbie question : r/LabVIEW

 

So i'll answer as there:

Help -> Find Examples, search for State Machine Fundamentals

Or

File -> New... -> From Template -> Producer/Consumer (Events)

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 4
(133 Views)

From my experience, I will start with a big picture, defining functionalities, interfaces, components, etc. Drafting a state machine diagram to have an idea what areas need to be developed.

Then, usually using a framework (for example Queue Message Handler/Producer Consumer) to create a prototype, to test the logic, in parallel I begin getting the components to make use of the program, for ex Daq, instrument, graphic analysis, Storage, DB). 

One thing that always help to start with  is to create a "Manual Mode" for ex if your system involves daq, instrument, can, etc, you make one single vi that contains all the components, so you can learn how to interface with every component of your code, and they run in parallel all together. WIth this, helps you plan to develop the routines that will be used in your final application, understandin APIs, etc. 

 

Then define the subvis, routines, find patterns that can be packages as sub-routines. 

 Then pack everything together and test . Voi-la. 

 

When start programing right away withtout any planning usually leads to spagetty code, that is hard to mantain, difficult to replicate and troubleshoot becomes a nighmare. 

 

 

0 Kudos
Message 4 of 4
(125 Views)