LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate Block Diagram Images from Command Line?

I have a Linux server that hosts our git repository, and allows for custom hooks to render different file formats.

 

For example, it can render .docx files by running them through pandoc, which converts the docx to HTML.

 

I'd like to do the same for our LabVIEW VIs, and the natural idea is to convert the block diagrams to PNGs. I know it's possible to do this *programmatically in the runtime*, but LabVIEW doesn't really play well with headless environments in my experience.

 

Are there any Linux/Windows CLI tools which can take LabVIEW VIs and output a PNG of their block diagrams?

 

Thanks!

0 Kudos
Message 1 of 5
(1,234 Views)

Hi math,

 


@ijustlovemath wrote:

Are there any Linux/Windows CLI tools which can take LabVIEW VIs and output a PNG of their block diagrams?


  1. You can create a VI to read two arguments from command line: which VI to convert and the target PNG path.
  2. Have your VI create the PNG image of the block diagram of the given VI.
  3. Then create an executable from your VI.

Now you have a command line tool based on your requirements…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(1,219 Views)

@GerdW wrote:

Hi math,

 


@ijustlovemath wrote:

Are there any Linux/Windows CLI tools which can take LabVIEW VIs and output a PNG of their block diagrams?


  1. You can create a VI to read two arguments from command line: which VI to convert and the target PNG path.
  2. Have your VI create the PNG image of the block diagram of the given VI.
  3. Then create an executable from your VI.

Now you have a command line tool based on your requirements…


Would the exe still have the method to create an image from a block diagram?

 

wiebeCARYA_0-1677492766332.png

 

The documentation says no, but sometimes it still works.

 

Loading the VI can be tricky in the exe, as subVIs might be missing. You'd still get an image, but subVI icons will be missing, and the VI will be broken.

 

I think you need the development system installed. If you need an exe, you should be able to use VI Server to let the exe make an application reference to the development system and invoke the methods there. I think that should be possible, but I gave up on trying.

0 Kudos
Message 3 of 5
(1,076 Views)

Nice tips, Wiebe! With the addition of an applicaion ref it seems to work.

ExportVItest.png

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 5
(1,053 Views)

@Yamaeda wrote:

Nice tips, Wiebe! With the addition of an applicaion ref it seems to work.

ExportVItest.png


I never got it working, but maybe I didn't try it this exact way.

 

I think the development environment VI server settings need to be setup properly?

0 Kudos
Message 5 of 5
(1,015 Views)