LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Include non-visible area in Web Publishing tool screenshot / Run VI from command line

Hello everyone,

 

I am trying to host a periodically updating screenshot of my VI for hosting it on a local web server. I have tried the Web Publishing Tool but the screenshot only includes the visible area and the rest of my front panel gets cropped. I have tried to see if I can get past this but I have had no luck so far as there are very few settings regarding this. Can someone please let me know if this is a limitation in the Web Publishing tool or if there are options to include the non visible area?

 

Alternatively, I have also found a VI from one of the knowledge articles for a VI which generates a jpg screenshot of my VI and it captures my remote panel completely. I intend to run this VI externally from a command line / script but the only article I have found so far asks me to run "labview.exe filename.vi" and this only open my VI in a LabView window. Is there a way to execute the contents of the VI from the command line and pass a few parameters?

 

Thank you!

0 Kudos
Message 1 of 8
(1,300 Views)

You can compile the VI into EXE and Pass Command Line Arguments to a LabVIEW Executable

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 8
(1,287 Views)

Thank you very much for the response. I tried what you said and added the cmd line args as inputs to my fields in the VI and built it into an executable. There is one thing that confuses me, the VI that I am working on takes the filepath of another VI and takes a screenshot of the external VI. When I open the VI and provide the path the screenshot captured includes the current state of the VI (i.e., the state of the front panel when the VI is running) but when I pass the same path through the command line I only get a static front panel image. Is there something I am missing?

 

0 Kudos
Message 3 of 8
(1,245 Views)

I can't imagine the issue with only the statement.

Would you mind uploading some code so that we can reproduce the issue on our side?

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 4 of 8
(1,237 Views)

Sure, I can provide more details. I have 3 VIs attached below, they do the following:

1. take_front_panel_screenshot.vi -> This vi implements the suggestions for using cli and needs to be compiled into an exe for usage.

2. upgraded.vi -> Consider this as the base VI for which I try to take the screenshot. Opening and starting it generates a waveform that continuously changes.

3. ss_autostart.vi -> This is the original vi which takes 2 filepaths (one for an image output and the other for a VI path) and running it in LabView directly generates a screenshot with the current state of the chosen VI.

4. image.jpg -> the output that I see when I run this setup from the exe provided.

 

The 1st arg for the binary is the path to the VI and the second path is the path to an image file for generating an output. I used absolute paths since relative paths were not being resolved correctly.

 

As it can be seen I do get an image of the front panel but it does not show the current running state of the VI (although I have it running and the ss_autostart.vi captures this perfectly).

 

Please let me know if any further details can be useful.

 

PS: I could not upload the binary due to content restrictions.

 

Thank you.

0 Kudos
Message 5 of 8
(1,233 Views)

What do you mean by "current state of the chosen VI"?

I run the ss_autostart.vi in LabVIEW ADE and it gave me the exact image as the one you attached. I don't see any part of that VI has properties related to VI state.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 6 of 8
(1,203 Views)

By the current state of the VI I refer to the actual readings on the front panel.

 

The image I have attached only shows the empty graph panel even when the VI is generating a wave form. This can be captured if the screenshot VI is not run as an executable and is run by opening the desktop application.

 

Is this capability of capturing live state of front panel of a different VI not supported when compiled as an executable?

0 Kudos
Message 7 of 8
(1,194 Views)

To be fully clear here are the steps that I am trying to do:

Experiment 1:

1. Open the waveform VI (upgraded.vi) in a LabView Desktop Application window.

2. Hit run and observe that the waveform indicator on the front panel shows a continuous waveform.

3. Open another LabView desktop application window and open the VI for taking a screenshot (take_front_panel_screenshot.vi)

4. Give a path for the image and the VI path as the path where the first vi (upgraded.vi) is located on the disk.

5. Hit run to generate a image of the front panel.

6. Open the image to confirm that waveform is captured and there is no blank wave indicator image.

 

Experiment 2:

1. Perform steps #1 & #2 from above.

2. Open the VI (ss_autostart.vi) in another LabView desktop application window and in the 'Tools' menu choose create an executable.

3. In the executable choose the option to send the cmd line args and auto-run on start.

4. After the exe is generated run it and also pass 2 cmd line arguments. First is the path to the VI (the absolute path to the place where upgraded.vi is stored on the disk) and second is the absolute path to an image file for storage.

5. Run the exe to ensure that a image is created.

6. Open the image to observe that the front panel is capture but the wave itself is missing from the indicator as posted in the previous screenshot.

 

The only difference between ss_autostart.vi & take_front_panel_screenshot.vi is that the Path selection dialogs are replaced by cmd line parser for getting the filepaths from command line and sending them over in the same way as done before.

 

My objective is to produce the same output from the exe as from Experiment 1.

 

Please let me know if I have missed something.

 
0 Kudos
Message 8 of 8
(1,191 Views)