element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Test & Tools
  • Technologies
  • More
Test & Tools
Forum How to transfer data from a Keysight Spectrum analyser N9020B to my local control PC
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Test & Tools to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 10 replies
  • Subscribers 352 subscribers
  • Views 4848 views
  • Users 0 members are here
  • python
  • analyzer
  • instruments
  • spectrum analyser
  • file transfer
Related

How to transfer data from a Keysight Spectrum analyser N9020B to my local control PC

Matteogala
Matteogala over 1 year ago

Hello All,

I am fairly new to using, yet alone automating test equipment. Although I am trying to use the latter to automate a standard tests we do when releasing new software that produces RF frequencies.

I created a python script to connect to the spectrum analyser and I can set it up correctly for the tests I need to do through SCPI commands.

I also save the data as screenshots through the command " :MMEM:STOR:SCR <filename.png>"

I now want to transfer these screenshots to my local PC and I am struggling to understand which command to use. I have attempted to use the :MMEM:COPY:DEV  command although it fails.

This seems to be as I am only connected to the Spectrum analyser through port 5025 (SCPI port) and this does not allow file transfer? How would I then use the above command to achieve what I want?

Does anyone have more experience with this test equipment and could give me some hints where to look?

Thank you in advance for your responses!

(Spectrum Analyser I am using is a N9020B)

  • Sign in to reply
  • Cancel

Top Replies

  • shabaz
    shabaz over 1 year ago +2
    Hi, I don't have that instrument. However, it's described on page 179 of the PDF user manual . Regardless of physical connection method (Ethernet, USB. etc) you can use a unified method called VISA.…
  • baldengineer
    baldengineer over 1 year ago +1 verified
    It looks like the :MMEM:COPY:DEV command copies files local to the instrument. For example, it would be used to copy files from its internal storage to a USB drive. It is not for transferring files via…
  • shabaz
    shabaz over 1 year ago in reply to baldengineer +1
    Hi James, It's badly formatted in the user manual, but it's here (page 179 onward): @ OP: In a nutshell, the command varies (greatly) from instrument to instrument, and so you'd need to get close…
  • shabaz
    0 shabaz over 1 year ago

    Hi,

    I don't have that instrument. However, it's described on page 179 of the PDF user manual. Regardless of physical connection method (Ethernet, USB. etc) you can use a unified method called VISA. It eliminates messing about with TCP or UDP sockets, which is really not the way to work. For instance, if you're using Python then the library would be pyvisa. You could also use LabVIEW (either the graphical method, which is popular with automating tests, or using LabWindows/CVI if you're good at C programming. You could also consider MATLAB (it's a bit of an acquired taste), it has an Instrument Control Toolbox, and you can download the driver for your instrument from the Keysight website.

    It's highly recommended not to connect anything at the front end of that equipment unless you're really sure what you're doing (i.e. get someone experienced to set that up for you, or at least for them to specify what you should be connecting there) because it's easy to damage spectrum analyzer inputs, and that equipment is pricey.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • baldengineer
    +1 baldengineer over 1 year ago

    It looks like the :MMEM:COPY:DEV command copies files local to the instrument. For example, it would be used to copy files from its internal storage to a USB drive. It is not for transferring files via SCPI.

    This online reference has an example:
    https://rfmw.em.keysight.com/spdhelpfiles/33500/webhelp/US/Content/__I_SCPI/MMEMory_Subsystem.htm#MMEMory_COPY

    MMEMory:COPY <file1>,<file2>
    
    Copy the state file MyFreqMeas.sta from the root directory to the folder "Backup" on the internal flash file system.
    MMEM:COPY "INT:\MySetup.sta","INT:\Backup"
    
    If you do not have a USB drive change "USB:\" to "INT:\" to use the instrument's internal flash drive instead.

    If you can connect a network drive (via Windows) on the instrument, then maybe you could use that as the "local" file path.

    The website above mentions these commands to transfer binary files over SCPI. But I do not see them in the programming manual for that model. So, I am not sure if these will work:, it does look like the instrument might support SCPI commands for transferring binary files.

    MMEMory:DOWNload:FNAMe <filename>
    then
    MMEMory:UPLoad? <filename>
    
    The following command uploads the contents of the state file "Myfile.sta" in the root directory of the internal flash file system to the host computer:
    MMEM:UPL? "INT:\Myfile.sta"

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • shabaz
    0 shabaz over 1 year ago in reply to baldengineer

    Hi James,

    It's badly formatted in the user manual, but it's here (page 179 onward):

    image

    @ OP: In a nutshell, the command varies (greatly) from instrument to instrument, and so you'd need to get close to the user/programming manual.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 1 year ago

    Matteogala how come you have not marked the correct answer correct?!

    I wouldn't care, but if you have gone to the effort of marking it, then I'd like to know why you didn't bother acknowledging the people who helped?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • baldengineer
    0 baldengineer over 1 year ago in reply to shabaz

    Those commands transfer the actual measurement data.

    I think Matteogala was asking how to transfer the screenshots.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Matteogala
    0 Matteogala over 1 year ago in reply to shabaz

    Hello shabaz and baldengineer 

    Thank you so much guys for your help!

    I am already using the pyVISA module and correct driver and is working well. I did not notice the command on page 179 I will try it as soon as I get a chance and let you know if I manage to achieve the intended behaviour.

     shabaz  Apologies if I did not mark your answer as correct I believe they both are and have both valid points. I will keep trying and update this question when I find a solution to this problem.

    Thanks again both for your collaboration, it is very much appreciated, much more than a simple "Accept Valid Answer" button could ever give.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Matteogala
    0 Matteogala over 1 year ago in reply to baldengineer

    Hello baldengineer you are right! I will mark your reply as the correct one for this specific issue and confirm once I have tested this to confirm.

     shabaz I will eventually also need to transfer measurement in the test I am automating so this command will still be helpful for the future.

    Thanks both for your help!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 1 year ago in reply to baldengineer

    Ah, I see it now. I had read the title, and missed the the screenshot requirement. 

    I am sorry about that Matteogala ! In that case, baldengineer answer is indeed correct, mine was not : (

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • shabaz
    0 shabaz over 1 year ago in reply to shabaz

    My mistake : ( corrected above.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Matteogala
    0 Matteogala over 1 year ago in reply to shabaz

     shabaz  No problem, you still helped and your input was very welcome, thank you for sharing your knowledge!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube