LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best Method to analyze a VI

Hi all,

i'm trying to study a VI with more than 20 SubVIs and DLLs so it's confusing sometimes .

so any suggestions or steps to make it more easier 

Thanks 

0 Kudos
Message 1 of 4
(2,209 Views)

Hi ahmed,

 

the "best" method is to read the well-written documentation for this program… 😄

 

Best regards,
GerdW


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

@ahmedkochbati92 wrote:

i'm trying to study a VI with more than 20 SubVIs and DLLs so it's confusing sometimes .

so any suggestions or steps to make it more easier 

Thanks 


Steps to make it easier:

 

1) do some courses.

2) get years of experience.

 

Seriously, inheriting code is not always easy. 20 VI isn't that much., if they are good VI's... If they all contain 400 nodes in 12 nested structures, you have a problem...

 

Start by grouping things might help (e.g. put all the dll calls in class methods). Start by removing\refactoring silliness.

 

Since you're asking a general question, it's all general advice you'll get.

 

If you post the code we can give specific comments.

0 Kudos
Message 3 of 4
(2,193 Views)

Are the 20 VIs easily recognized on the Block Diagram, or do they all have the Generic LabVIEW Sub-VI Icon?  It helps a lot when you can look at the Top Level VI and see VIs labeled "Init DAQ", "Get Sample", "Save to Disk", "Do FFT", etc..  Note that the names suggest that the sub-VI does one thing (which, in turn, may have more steps) -- this is the "S" element of SOLID, a set of Software Guidelines that are often discussed with Object Oriented Programming.  [S is the only one I really remember -- the Single Responsibility Principle, or "Do One Thing, and Do It Well"].

 

If you are lucky (ha!), you'll be able to figure out what the Lower Level VIs do, and can ensure that they have an easily-recognized Icon that you can spot when you see them in higher-level Routines.  [Note -- you can use the Icon Editor to make an empty Box and put an up-to-4-short-lines Name in, like "Do FFT" (which only takes 1 line)].

 

It often helps to have a partner when tackling projects like this.  It is best if you are both knowledgable about LabVIEW, but if only one is (and it should be you, of course), but the other person knows C, Java, Python or even Matlab, they should be able to "catch on" to Loops, Sub-VIs, and Wires pretty quickly.

 

Bob Schor

 

P.S. -- do you know how to print out the Block Diagram of a VI?  Oooh, what if it is the VI that Ate Chicago?  You need a Block Diagram that fits on a screen for this suggestion to be practical, but finding a "good view" (i.e. having the Case Statements all on an "interesting" Case) and then printing the Block Diagram (without showing Hidden Frames) will give you something to scribble notes on as you examine the code.  You may or may not want to print the Front Panel ... 

0 Kudos
Message 4 of 4
(2,153 Views)