11-03-2009 04:38 PM
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
Solved! Go to Solution.
11-04-2009 01:01 PM
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
11-04-2009 01:16 PM
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)
11-04-2009 02:17 PM - edited 11-04-2009 02:17 PM
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.
11-04-2009 02:27 PM - edited 11-04-2009 02:28 PM
Darin.K wrote:...
![]()
![]()
Nice!
You follow directions well*.
The next time you are looking for work, make sure you send a resume my way ( if are you a US citizen).
Ben
* I am sure you would have figured that out with my notes.
11-04-2009 02:46 PM
Ben wrote:Nice!
You follow directions well*.
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.
11-04-2009 03:31 PM
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
11-04-2009 03:47 PM
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.