LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading LabVIEW comments with external software

Is there a way to read comments in a LabVIEW block diagram from external program like C#, VB, etc...

 

This will be useful for documentation.

0 Kudos
Message 1 of 8
(2,966 Views)

What's the end-goal? It seems like this would be way easier to accomplish with LabVIEW scripting rather than going through a different language.

0 Kudos
Message 2 of 8
(2,929 Views)

Short answer: no.

 

Long answer: yes, but you might need to do some work.

 

The first option is simply to read the VI file. The problem with that is that a) it's compressed and b) you have to know the structure, which is not publicly documented.

 

The second option is to use the VI server properties to read the comments, but I'm fairly sure they're not exposed through LV's ActiveX interface.

 

Which brings you to the third option, which is to write a VI which will get a path to another VI and then use the VI server properties accessible by enabling scripting to return the text in the comments. You then compile that VI as a DLL function or a function in a .NET interop assembly and call it.

 

Note that this requires accessing properties which might not be available in the run-time engine, so you might have to actually do this through LV itself (e.g. by opening an ActiveX connection and running the VI in LabVIEW.


___________________
Try to take over the world!
0 Kudos
Message 3 of 8
(2,925 Views)
I want to extract the comments for documentation purposes
0 Kudos
Message 4 of 8
(2,917 Views)
I have used labview scripting before to generate front panels programmatically.

All I have is the basic version of labview I am not sure if I have access to vi server or not.

The third option sounds like the path that I should pursue but I have a lot to learn to do it.

Thanks for the advise.
0 Kudos
Message 5 of 8
(2,914 Views)

Thanks guys for all the help. I have much to learn but you have given me a great start.

0 Kudos
Message 6 of 8
(2,889 Views)

Note that the diagram is a hierarchy of elements, so your code will only return the comments which are in the top level of the diagram (i.e. not inside structures). If you enabled scripting, you should have a scripting palette inside the application control palette, which should have a traversal VI which will return all objects of a requested class. You can use that to get the comments.


___________________
Try to take over the world!
0 Kudos
Message 7 of 8
(2,885 Views)

This ofcourse assumes people have been good at writing comments and using the comments primitive, instead of simply placing string constants and whatnot as i've seen examples of? Do it extrace comments of front panel? Does it also extract vi-documentation, i often find that a better information source.

 

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 8
(2,849 Views)