LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I can't save or load picture

Solved!
Go to solution

Hello. I have to make a state machine which paint. I have already managed to do it, but the problem appears when I want to save the created image or load new picture. Every time I have error number 1. Would someone be able to help me?

0 Kudos
Message 1 of 5
(2,238 Views)

Can you save your source to a previous LabVIEW version? Not many people have the latest version installed.

Lucian
CLA
0 Kudos
Message 2 of 5
(2,213 Views)

Here is latest version 🙂

Download All
0 Kudos
Message 3 of 5
(2,205 Views)
Solution
Accepted by topic author Martyna557

Seems that Write PNG File.vi returns error 1 if the image you want to save is empty. This can happen in your program if you never draw anything and save the image. Also, in your SAVE case you write the image shift register with default value (empty picture) which means that after saving, the image displayed in the picture control is not the same with what you have in memory and if you want to save again without adding anything new, you'll get error 1.

I suggest you use an event structure in your "Idle" case instead of the logic you have there and add a value change event for each button where you decide in which state to go. Buttons mechanical action can be changed to latching and you will no longer need the waiting function.

Lucian
CLA
0 Kudos
Message 4 of 5
(2,189 Views)

When you read the picture, you are converting the image data to a picture, but never use the output.

 

(Make sure you understand the difference between an input and an output!)

 

altenbach_0-1584899627448.png

 

Message 5 of 5
(2,156 Views)