13

I have a file containing a LabView program and need to understand what it does. Of course it can not be executed without LabView. But is it possible to read a LabView program without Labview?

paugier
  • 1,838
  • 2
  • 20
  • 39

4 Answers4

17

But is it possible to read a LabView program without Labview?

I presume you're asking, "Can I open a *.vi file and look at its source code (which is called the "Block Diagram"), without using LabVIEW?"

If that's your question then the answer is "No", not directly. Officially, you need LabVIEW to read, edit, and execute a *.vi file.

Third party support to view VIs without LabVIEW

You can get a third party to convert the VI for you:

  • If you know someone else who has LabVIEW, you can ask them to open the VI for you and save the Block Diagram as a picture file for you (preferable in the form of a Snippet).
  • There are unofficial 3rd-party tools (like the one in @mefistotelis's answer) which can convert VIs without LabVIEW.

Installing LabVIEW without purchasing

(NOTE: In April 2020, LabVIEW Community Edition was released. It is free for home use.)

If you are willing to download and install LabVIEW, you can open the VI file. This link lets you select the Community Edition for home use or the 7-day evaluation for commercial/academic use.

JKSH
  • 2,658
  • 15
  • 33
  • 3
    If the LabVIEW code contains any case structures or similar, the picture file will only show you the one that was visible when it was created; however if you print the block diagram (which could be to a pdf file using Acrobat or e.g. CutePDF) you get to see the contents of all the cases - though this is not necessarily easy to read if there are lots. Also if you're willing to give National Instruments your contact details you can extend the evaluation period to (I think) 30 days. – nekomatic May 09 '16 at 11:24
  • 1
    You can save LabVIEW code to an HTML file providing you an easy screenshot of your code. But you have to have LabVIEW to do this – max Dec 15 '19 at 11:38
  • 1
    @max This suffers from the case structure problem that *nekomatic* notes. Ie, the HTML will only generate the block diagram for the active case. – artless noise Mar 08 '22 at 20:45
11

The parser I made can read VIs, and convert most of the content to XML (including Block Diagram, Front Panel and type definitions used for connectors): https://github.com/mefistotelis/pylabview

It is open-source, and in no way related to NI.

The XML form you get isn't really easy to read, but with the data exported to XML, it should be possible to write a tool which parses it and displays as a diagram, or at least creates an SVG.

mefistotelis
  • 170
  • 1
  • 5
5

As @JKSH already stated the answer is "No".

If you think a Labview Viewer could be useful give a Kudo to this Labview Idea and try to convince National Instruments to provide one.

In the comments to the idea there's a link to a software, VIpreVIEW - Interactive VI preview, making a Flash-enabled HTML page for viewing the code (I've never tried it).

MarcoM
  • 1,093
  • 9
  • 25
-2

I have an Yes answer to this question. There is an option to export the block diagram as snippets as said by @JKSH.

I have created a POC - Export VI as images.vi here in github which can help you to export the VI you want to read as images. Then you can easily open the images in any image viewer and read that LabVIEW code. You need to feed it this POC with VI you want to export and image saving locations for the front Panel and the block diagram.

If the person who has given you the code has LabVIEW installed with his PC, s/he can export the code as images easily using this POC.

Ref: https://github.com/digiajay/ExportLabVIEWfilesAsImages/tree/master/POC

Thanks, Ajay.

Ajay
  • 33
  • 1
  • 5
  • 1
    This does not answer Yes to the question. – CivFan Jul 29 '19 at 23:25
  • How on earth does this github link help with exporting a VI file? It only contains 2 .vi flies and 2 images. No code/script/application at all :-( – wovano Jan 20 '22 at 08:37