How To Save and Transfer a Screenshot from the 5 Series MSO


How do I save and transfer a screenshot from the 5 Series MSO oscilloscope to my PC via the remote command interface?


Screenshots (also known as hard copies) can be transferred from the Series 5 MSO oscilloscope via the remote programming interface using just a few simple commands.  For information on how to send commands to the instrument via the remote programming interface, please see the 5 Series MSO Programmer’s Manual.

To save and transfer a screenshot, send the following commands to the instrument:

SAVE:IMAGe “C:/Temp.png”


REM SAVE:IMAGE is an OPC generating command. Wait for instrument to finish writing the screenshot to disk by querying *OPC?

FILESystem:READFile “C:/Temp.png”

REM Read back the data sent from the instrument and write the data (un-altered) it to a .png file on your local system.

FILESystem:DELEte “C:/Temp.png”

Note: The REM command means remark and can be used for adding commands to command listings or .set files.  When the instrument encounters this command, the entire line is ignored by the command parser.

Avoiding Errors When Trying to Readback Image Data

If you send the SAVE:IMAGE command and then immediately send the FILESystem:READFile command, it is likely that you will get a timeout error or possibly a partial image when trying to read back the image data.  The reason for this is that you did not wait long enough after sending SAVE:IMAGe before sending FILESystem:READFile.  On the 5 Series MSO oscilloscopes the SAVE:IMAGE command is an OPC generating command therefore the *OPC? query command can be used to synchronize your program with the completion of the save operation.  After sending the SAVE:IMAGe command, send the *OPC? query command and wait for the response.  After you readback ‘1’ from the *OPC? query you can send the FILESystem:READFile command and readback the image data.

Python Example Code

The following example code written in Python can be used to transfer screenshots from the 5 Series MSO to your PC.  This code is written for Python 3 and the PyVISA library.


# Name:  Save Screenshot (Hard Copy) to PC for 5 Series MSO Oscilloscopes


# Purpose:  This example demonstrates how to save a screen shot (hard copy) image

#  from a 5 Series MSO oscilloscope to the PC.


# Development Environment: Python 3.6, PyVisa 1.8, NI-VISA 2017, Windows 10 x64


# Compatible Instruments: 5 Series MSO, MSO54, MSO56, MSO58


# Compatible Interfaces:  USB, Ethernet


# Tektronix provides the following example "AS IS" with no support or warranty.




from datetime import datetime # std library

import time # std library

import visa #


# Replace string with your instrument's VISA Resource Address

visaRsrcAddr = "MSO58"


rm = visa.ResourceManager()

scope = rm.open_resource(visaRsrcAddr)

print(scope.query('*IDN?'))  # Print instrument id to console window


# Save image to instrument's local disk

scope.write('SAVE:IMAGe \"C:/Temp.png\"')


# Generate a filename based on the current Date & Time

dt =

fileName = dt.strftime("MSO5_%Y%m%d_%H%M%S.png")


# Wait for instrument to finish writing image to disk



# Read image file from instrument

scope.write('FILESystem:READFile \"C:/Temp.png\"')

imgData = scope.read_raw(1024*1024)


# Save image data to local disk

file = open(fileName, "wb")




# Image data has been transferred to PC and saved. Delete image file from instrument's hard disk.

scope.write('FILESystem:DELEte \"C:/Temp.png\"')






This FAQ Applies to:

Product Series: 5 Series MSO

Product: MSO54, MSO56, MSO58

FAQ ID : 245436

View all FAQs »

Download Manuals, Datasheets, Software and more:

Go to top