09-11-2025 08:22 AM
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?
09-11-2025 08:40 AM
Is there a reason to crosspost from Reddit?
09-11-2025 08:40 AM
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)
09-11-2025 08:44 AM
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.