LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from changing PNG File

Solved!
Go to solution

Hello everyone,

I wrote a python program that plots a graph and saves the figure every five seconds. My LabView VI can Access this png file if the python program is not running. If however the python program is overwriting the existing Image to save a newer Version of the figure, the Read from PNG VI gives out an error and the VI stops.

I think it is because the Read from PNG.vi is reading the png constantly and when it is overwritten by python the file the vi was reading is gone.

Any help with this?

Can I somehow Close the handle to the png in labview?

Thanks for help!

0 Kudos
Message 1 of 2
(2,128 Views)
Solution
Accepted by topic author EnzoC

Hi Enzo,

 

implement some simple error handling!

WHILE
  ReadPNG(png-file)
  IF error THEN Python script is working; Wait 500ms
WEND

You might also check the file timestamp and only read the file when it has changed.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 2
(2,121 Views)