07-16-2012 05:01 PM
I am trying to acquire a screen capture from a Tektronix MSO4104B oscilloscope using LabVIEW. I currently am able to collect data from the device, and have a waveform displayed on my VI front panel. However for various reasons, our preference is to capture the actual screen shot from the scope.
I have reviewed the programmers reference for this device, and have made countless searches on Google for an answer, but haven't been able to find a solution. It appears that a few people have been able to accomplish this on OTHER Tek scopes by sending a hardcopy through the communications port (GPIB, USB, Ethernet, etc...) however according to the programmers reference for this particular device, it appears that it will only send a hard copy to an installed printer, rather than simply as a data stream to the port that can be read using VISA commands.
The other solution I have seen is to save the screen shot to a flash drive, then copy the file through the port to the PC. However, neither of these solutions seem to be available on this device...this is one of the most advanced scopes that Tek makes...I can't believe this is so difficult!? Please help!
Solved! Go to Solution.
07-17-2012 07:12 AM
R.Gibson,
I don't have this particular model but I would think that SAVe:IMAGe would be the place to start to save the screen to say a .png file.
After that, I'd take a look at FILESystem:READFile for the file transfer.
07-17-2012 08:49 AM
Since the SAVe:IMAGe command can save a capture of the screen image into a specified file including network storage, you might want to create a local network between the PC running the test program and the scope.
07-17-2012 01:44 PM
Wayne, I think you may have nailed it, I hadn't seen the FILESystem:READFile command yet, it sounds like that might do it!
One thing that is unclear to me from the programmers manual is that it reads the file to "the specified interface," but that command does not seem to offer the "specified interface" argument, nor do I see another USBTMC style command that specifies this...does it just assume that the specified interface is whichever interface is currently connected (USB, or Ethernet)? I don't like to assume anything in my code...
07-17-2012 01:47 PM - edited 07-17-2012 01:48 PM
R.Gibson wrote:
One thing that is unclear to me from the programmers manual is that it reads the file to "the specified interface," but that command does not seem to offer the "specified interface" argument, nor do I see another USBTMC style command that specifies this...does it just assume that the specified interface is whichever interface is currently connected (USB, or Ethernet)? I don't like to assume anything in my code...
That's how I read it. A quick call to TI would probably get the best answer.
07-17-2012 01:52 PM
NYC, I had considered that option as well, however would prefer a single-wire interface, and we are using USB. However, I think that is probably a valid option if the READFile command doesn't work.
Thanks for your help guys. I'll try to post the solution when when I get it working.
-Ryan
07-17-2012 02:08 PM
I just got off Tek tech support, and they agreed that the SAVe:IMAGe and FILESystem:READFile commands should work, but will require an external flash drive to temporarily store the screen capture (which may or may not be a bad thing). Also, the "specified port" text is probably a carryover from a previous manual on an older scope, the newer scope should be smart enough to know which port to send it to apparently.
However he also suggested using the "HARDCopy START" command (which also allows use of the inksaver option), and said that it should write the image file to the current port as well. The programmers manual does not indicate this functionality, so I'll give it a shot and see what happens.
07-17-2012 03:23 PM - edited 07-17-2012 03:23 PM
I used a TDS3000 series scope from Tek and had success using the Hardcopy command. Note that I used the GPIB. Here are the commands I used.
HARDC:PORT GPIB; HARDC:INKS ON; HARDC:FORM PNG; HARDC START
I also had fun because I had to recieve the data in chunks since an entire png file could not be transfered in one chunk due to buffer limitations.
07-17-2012 07:20 PM
Thanks for all the help guys. Attached is a screenshot of the code I generated for capturing the screenshots, it works great. Hopefully it will help someone else in the same situation at some point! 🙂
07-18-2012 06:59 AM
Glad to see it worked for you. You might want to concider using a PNG format as it will make the file size smaller.