LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hex string to 2D picture control

Solved!
Go to solution

Hi, I'm trying to get a screen capture from an HP8563EC spectrum analyzer with a GPIB-USB-HS interface. I was able to get the data from the spectrum analyzer but I can't figure out how to rebuilt the screenshot from the downloaded data (string of hex). Also, I would like to be able to format the screen shot to bmp or png. I compared the data with what I captured with NI-Spy while using benchlink and the amount and kind of data look similar. I was not able to find information on the analyzer display resolution in pixels, the only available information available is that the screen is the display is approximately 9.6 cm (V) X 13 cm (H). Note that the benchlink screen shot size may add more information (667Kb when bmp type).

 

I attached two attempts VIs (LabVIEW 2009) and a benchlink screen capture. I saved the string controls with the actual downloaded data as default value.

 

Hopefully somebody have done something similar before.

 

Thanks,

 

Ben

Download All
0 Kudos
Message 1 of 8
(4,958 Views)

Hello,

 

Have you tried contacting HP for more information on the string that is returned? You need to know the bit depth and resolution in order to know how you will proceed with converting.

 

-Zach

0 Kudos
Message 2 of 8
(4,922 Views)

You may want to start by just writing the data to file and rename it as "bmp", "jpg" or "png" to see if it is already in one of those formats. 

 

I'm trapped behind a barbed wire fence with LV 8.2 so Ican't look at your code, but since this

 

 

looks like black and white I would start looking closly at your data for zero and non-zero values. After you figure out what part is your data (maybe a header ?) then try converting it to booleans and reshabe your dat and display it in a 2d array (ofe very small booleans) to figure what the geometery is (array of X by Y and need to figure out X and Y). At that point then push into a picture indciator and ...

 

That's the best I can do with th info provided.

 

Ben

 

(yes there is another one) 

 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 8
(4,916 Views)
Solution
Accepted by topic author ben64

One tidbit from my VIOTD threads is that booleans in arrays were once stored as single bits, which makes operations like this a piece of cake.  A little trial and error for the values, which are probably encoded somewhere, but probably won't change.

 

HP Picture.png

 

HP Picture Snippet.png

 

 

 

Message Edited by Darin.K on 11-04-2009 02:17 PM
Message 4 of 8
(4,900 Views)

Darin.K wrote:

...

 

HP Picture.png

 

HP Picture Snippet.png

 

 

 


Nice!

 

You follow directions well*. Smiley Wink

 

The next time you are looking for work, make sure you send a resume my way (  if are you a US citizen).

 

Smiley Very Happy

 

Ben

 

* I am sure you would have figured that out with my notes.

 

 

Message Edited by Ben on 11-04-2009 02:28 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 8
(4,894 Views)

Ben wrote:

Nice!

 

You follow directions well*. Smiley Wink


 


Try telling that to my wife.

 

Your notes were pretty much spot on (no surprise), I mostly wanted to toss out the sneaky Type Cast trick.

Message 6 of 8
(4,884 Views)

Thanks to all, I was finally able to solve this this morning althought my solution doesn't look as nice as Darin's one (I attached a picture of what I have done, there is a control reference because I'm using the code in a subVI). I will try to find some time to try Darin solution.

 

Thanks again,

 

Ben

0 Kudos
Message 7 of 8
(4,867 Views)

Ben64

 

I was able to duplicate what Darin K did. It was fun making it figure out all of the things taht I need to know but I did get it. Here is my code with all of the default values. You should be able to make it save to any format from here.

 

If you are interested. If not it was fun to figure out.

Tim
GHSP
Message 8 of 8
(4,853 Views)