LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Image corruption

I used Ni Visa to receive an image from a ESP32 With cam, image raw data ("string bytes") and save it in file.txt and convert it to jpg, when i convert it I found that the data is corrupted and also image is corrupted as shown  i will attach the vi and the file.txt in which i saved the received data Photo-1 - Copy.jpgfigure 

0 Kudos
Message 1 of 6
(904 Views)

Hi Mohamed,

 

without looking at your VI: did you switch off EOL conversion when using WriteText (or switch off size prepending at WriteBinary) function?

You need to handle binary data correctly...

Best regards,
GerdW


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

Hi Mohamed,

 

could you please downconvert your VI? (Save for previous)

Not all of us use the most recent LabVIEW versions…

(I prefer LV2019.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(842 Views)

how to switch off EOL ? 

the image string bytes that I received look like that. 

Image.png

0 Kudos
Message 4 of 6
(830 Views)

here a 2019 version 

0 Kudos
Message 5 of 6
(826 Views)

Hi Mohamed,

 


@Mohamed_Eid wrote:

how to switch off EOL ? 


Read the LabVIEW help for both WriteFile functions in your VI. The help explains all the details:

You also should think about automatic TermChar handling for your serial communication: this may influence your algorithm, too. (Again: read the help for the ConfigureSerialPort function!)

Watch this video to learn about proper/correct serial communication with LabVIEW…

 

Why do you open/close the file in each iteration of your loop? Those functions belong before/after the loop, the same way as VISAOpen/Close!

What's the point of setting a VISA timeout of 10M ms = 10k s ~= 2.75 h???

Best regards,
GerdW


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