From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving jpg data captured using GPIB to a file

Hi

 

I am taking a screenshot of the 86100a spectrum analyzer in jpg format using the command : :DISPLAY:DATA? JPG, SCR

 

I read back the data use the save to text file vi to save it to a file such as test.jpg. 

 

The file appears to be about the right size in kB but it does not show a picture when opened.

 

I looked at the Write JPEG File but it requires a lot of information that I should not require as the complete jpg information is (supposed to be) sent back. 

 

Is anyone familiar with saving jpg data sent via GPIB?

 

Sean

0 Kudos
Message 1 of 3
(2,398 Views)

@SeanJ wrote:

 

I am taking a screenshot of the 86100a spectrum analyzer in jpg format using the command : :DISPLAY:DATA? JPG, SCR

I read back the data use the save to text file vi to save it to a file such as test.jpg. 

 


Why are you saving the data as a text file?  If the SA is indeed sending you the jpg image, it is probably a binary file.

 

You may have 2 choices.  1) To first save the image to the SA and transfer the image file.  This might be inconvenient if you transfer many images, because you would need to do some house cleaning.  Or you could always save to the same name and overwrite the last image, but you have to be careful not to loose past images.

2) If that model supports the feature, transfer the binary data for the image and save it on the PC.  Which is most likely what you are trying to do.

 

I will check to see if I have a code example somewhere...

 

 


 

 

0 Kudos
Message 2 of 3
(2,394 Views)

Couldn't edit my message above..

 

Ignore my first line.  I checked what I did with a R&S SA from a long time ago and I di write to a text file. Which surprised me because I do recall doing something similar and writing to a binary file...  Regardless,  what was done for R&S was to remove some unnecessary header info that the SA was sending.  In that case it was a # character.. 

 

I do not recall the SA model that you mentionned in your post, but it looks like an Agilent model number.  They may be doing something similar.  Try copying over a saved image from the SA and compare the two files.  For some reason, I still think that Agilent sends the binary data...  I may be wrong.  I would have to dig in some very old archives (old backups) to find what I did with the Agilent SA...  Over 5 years ago..

0 Kudos
Message 3 of 3
(2,388 Views)