LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading bmp file from instrument and saving on computer

Solved!
Go to solution

Hi,

I am trying to read a screen dump from a Keysight 34461A multimeter but I am having issues with saving the data on the computer as I don't really know what VI's/settings to use as I have not worked with image files this way before.

 

The code I am using is shown below (Fig. 1a and 1b). In this example I am reading the BMP data as a text string and it seems to work as I get a very long string (100K+) with strange characters (binary). But how do I instead save this data so I get a proper .bmp file on the computer? The code in Fig. 1b produces a .bmp file but my computer can't open it (MacOS). Tried the various endian options but no luck. Any help is appreciated! Thank you!

 

BMP capture.png

Fig. 1a. Reading it as a string.

 

 

BinaryWrite.png

Fig. 1b. Reading it as a string and writing as a binary file. File can't be opened on computer (MacOS).

0 Kudos
Message 1 of 2
(1,617 Views)
Solution
Accepted by topic author Mikael_Garcia

After some digging around here I found an old post from 2018 that contains the key to the solution!!! Here is the solution to that thread:

 

https://forums.ni.com/t5/LabVIEW/Convert-string-data-to-image-data/m-p/3812250#M1076599

 

With that in mind, I changed my code and now it works!! Here is my code now:

 

Code for solution.png

 

And here is the a screen dump bmp file that got saved onto my computer by using the code above:

 

TestBMPDumpTest.bmp

 

For some reason the instrument does not like the PNG format even though the manual says that it can use either BMP or PNG in the command. Oh well, BMP is better than nothing!!

 

0 Kudos
Message 2 of 2
(1,563 Views)