LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

auto creation of flow diagrams

Does LabVIEW or any of the NI software have the ability to auto generate flow diagrams from the LabVIEW code which has been written?
0 Kudos
Message 1 of 22
(7,223 Views)

Assuming you mean a flow chart, the answer would be no. LV code is multi-dimensional and can be very complicated, since each programmer uses a different style.

NI does have tools for going the other way, though. For example, they've been selling the state diagram toolkit for a long time and recently they announced a beta for a statechart module.

If you are refering to data flow diagrams, that's essentially what subVIs are.


___________________
Try to take over the world!
0 Kudos
Message 2 of 22
(7,217 Views)
Basically I have written all the LabVIEW code and it is all working fine, I have now being given the task of writing the flow diagram to go with it so that someone else can understand the code. I am currently using Microsoft Visio and was just hopeing NI might have a far better tool that could auto generate my diagrams.
 
 
0 Kudos
Message 3 of 22
(7,213 Views)

LabVIEW does have tools for reading the code hierarchy, but they were never officially released and are still incomplete unstable.

Even if someone was to write an application which would use these tools to analyze LV code, that LV code would have to follow very strict guidelines for the application to be able to understand it. In short, the answer is no and your basic process is reversed - you're supposed to design the basic algorithms before coding, not after.


___________________
Try to take over the world!
0 Kudos
Message 4 of 22
(7,209 Views)
code was designed before just noone wants to go through the hard work of doing to documentation properly on a flow program as takes so long. was just after a faster solution from NI that might show the flow in far more detail and auto generate it from the code you are using. dont see why it would be so difficult to an application that does it. will be waiting.
0 Kudos
Message 5 of 22
(7,199 Views)
 
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 22
(7,190 Views)


@nistudent wrote:
code was designed before just noone wants to go through the hard work of doing to documentation properly on a flow program as takes so long. was just after a faster solution from NI that might show the flow in far more detail and auto generate it from the code you are using. dont see why it would be so difficult to an application that does it. will be waiting.

It would be difficult because a flowchart contains domain knowledge that is not apparent in the written code. It is there but not in a way that can easily be determinded. As tst alrady said you are trying to reverse the development model.

Proper software development means designing the software algorithme first through flowdiagram, SDL, NassySchneiderman or whatever means and AFTER that start implementing it, not the other side around. All an automated tool could do is create a 1:1 analogy between what the LabVIEW diagram is and that perverts the purpose of such documentation which should be to show a more concise way of what your program is supposed to do (contrary to what it is doing 😉

Rolf Kalbermatter

Message Edited by rolfk on 06-29-2007 02:41 PM

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 7 of 22
(7,192 Views)
An equally significant problem is that it might not even be able to represent a LV program as a flow chart. The reason for this is that flowcharts were born in a world of linear code (think BASIC or C) execution where the program's structure was viewed in relation to the flow of time. Basically, program execution started at the top of the page and proceeded until it got to the bottom of the page, at which point the program stopped. Flowcharts are very good at this sort of structure.

However, as things progressed people began to realize in the early '70s that using flowcharts created problems. For instance they saw that starting a design project with a flowchart is almost always wrong. Moreover, as programs got more complex the essentially 1D representation of a program wasn't up to the task of describing the highly-parallel, hierarchical nature of large well-written programs.

...and this is the problem with flowchart in relation to LabVIEW. A well-designed LV program's structure consists of a set of manipulations that are performed on data. Some of these manipulations are dependent upon one another and so happen sequentially. Sometimes that are independent in which case they proceed in parallel. Likewise, any non-trivial LV application has a pronounced hierarchical structure. Therefore trying to do a flowchart of a non-trivial LV application is like trying to accurately describe a sphere in 2 dimensions. Distortions invariably arise - distortions which defeat the purpose of having the document in the first place.

WARNING Rant Alert!

That is a studied, logical, professional, academic discussion of the issue of flowcharts as they relate to LV applications. In terms of the broader issue of program documentation I tend to be less studied, logical, professional and academic. I prefer blunt. So to the people who want to write code, but not document it I would say: "Stop whining and get on with the rest of your job!" These people cry and lament for want of documentation when they're stuck working on code they didn't create, but they would rather eat meadow muffins than document the code they produce. I'm sorry but you can't have it both ways.

Nobody writes code that is so logical, intuitive and bug-free that it doesn't need to be documented. Which reminds me, in my experience there are few things I can do after-the-fact to improve the quality of the code I write more than document it. I can't tell you how many thousands of bugs I have caught through the process of documenting what I had done. If you write code but are the only one who knows how it works you haven't finished the job.

There... I feel much better... Smiley Happy

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 8 of 22
(7,169 Views)
surely that is rubbish, labview follows a data flow, if you label your variables in a manner which makes the task obvious then surely it is possible to generate a tool that allows the automatic generation of a flow diagram at least for each of the loops in the program, hence saving me the annoying and time wasting task of documenting all this code, which shouldnt have to be part of the job.
0 Kudos
Message 9 of 22
(7,102 Views)
First, LV doesn't have named variables - it has wires. To enforce the creation of some arbitrary and superfluous naming scheme runs contradictory to what LV is. But more to the point, flowchart were never a good way of describing the operation of non-trivial code. So why waste time (even with an automated tool) turning out documentation that is worthless.

Second, if you don't think documenting code that you created is part of the job you need to do the world of software development a favor and get a job at McDonalds -- and if the complaint is documenting someone else's code you have three choices:

a) talk to the people who wrote the code and get them to do the rest of their job

b) suck it up, document the code and use the experience as a learning opportunity

c) follow the above job recommendation.

Mike...

Message Edited by mikeporter on 07-04-2007 12:59 PM


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 10 of 22
(7,094 Views)