LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems creating a BMP file

Hello,
 
 
    I am getting screen shot data from various instruments with the VISA read command, which outputs a string of data.  How do I convert this to a 2d array so that I create a BMP file?
 
Regards,
 
Kaspar
Regards,


Kaspar
0 Kudos
Message 1 of 20
(4,559 Views)
Well, that depends on the format of the 2D data, and what the 2D data represents. This should be documented in the instrument's manual, which we don't have.
Message 2 of 20
(4,554 Views)
Hello,
 
   I am getting BMP data from 2 differenet manufacturers. I will contact them to get the format. So once I get the format  how would I convert the output of the VISA read (which is string data) to the input that the Write BMP File vi needs which is image data?
 
Regards,
 
Kaspar
Regards,


Kaspar
0 Kudos
Message 3 of 20
(4,549 Views)

Hi Kaspar,

i think your "string" data is a binary byte stream. If you know the format you can convert your data to an array of U8 and build your picture of it.

Hope it helps.
Mike

Message 4 of 20
(4,544 Views)

Hello,

 

  Yes your are correct this is a binary data string from the instrument. I will try what you suggested. thank you!

Regards,

 

Kaspar

 

 

Regards,


Kaspar
0 Kudos
Message 5 of 20
(4,535 Views)
And have you tried simply saving the data directly to disk?
Message 6 of 20
(4,529 Views)

Hello,

   Yes I have tried writing the data directly to a file and have looked at it with binary file viewers. The file created does not have the BMP header info, it appears to just have the bitmap data. So it looks like I have to figure out how to convert  from the output of the VISA read, which is the binary data to image data, which is what the Write BMP file needs for a input.

Regards,

 

Kaspar

 

 

  

Regards,


Kaspar
0 Kudos
Message 7 of 20
(4,524 Views)
Something like the vi attached is probably what you need.
You will need to modify it according to the specifics of your data.
 
Jon D
Certified LabVIEW Developer.
Message 8 of 20
(4,514 Views)

Hello,

 

  I am using Labview 8.2, the vi you attached is in 8.5. Could you PLEASE (I have used the magic word) save the vi in 8.2 and post it?

Regards,

 

Kaspar

Regards,


Kaspar
0 Kudos
Message 9 of 20
(4,509 Views)
I think an easier solution is to use the Flatten Pixmap function to generate that cluster. You just need to know what bit-depth you're dealing with so you wire to the appropriate input.
Message 10 of 20
(4,506 Views)