Skip to content

Python Example USB RFE6GEN

Julian edited this page Aug 30, 2021 · 9 revisions

This is a example of using RF Explorer Signal Generator RFE6GEN, based on generator part of python example 1

We recommend the following examples python example 1 and python example 2 to use with RF Explorer Signal Generator Combo.

What it does

This code generate a frequency SWEEP and CW signal.

The example begins requesting the default configuration and calibration data of the generator.

Then sets frequency sweep setting; start:400, stop:450MHz, steps:25 and delay between them:200ms and generates frequency sweep during 5 seconds.

Finally, sets CW setting; CW:500MHz, High power switch off and power level:3 and generates CW signal during a further 5 seconds.

How to run it

  • Install Python 3.5 or later, for more details visit www.python.org - there is no need to uninstall other versions of python, as several python versions can live together as long as you call the right one for the examples.
  • Install pySerial
  • Install RFExplorer for Python library
  • Depending on your OS version, you may need to install Silabs CP210x drivers. Most modern Linux distro and Windows version come with it installed, but Mac need specific install. Check Windows and MacOS driver troubleshooting articles.
  • Download the example from GITHUB repository link

Open a terminal or command line in your OS and run

python3.5 RFE6GEN_Example_USB.py

Expected results

As depicted below (using Windows as example), you will get automatic connection to the USB device using a specific COM port name. Other OS will return different port names.

  • Firmware version of the connected RF Explorer device

  • Active connection at 500,000 baud

  • Some information may depend on the specific device connected and firmware version installed

  • Generating first a frequency sweep and then a CW signal during some seconds with specific power and frequency. Note: you should always run this examples with a 50 ohms load into the active RF connector.

Detailed source code description

Initialization details and basic structure is the same as Example 1 and Example 2.

However, the main difference is that there is no control over kind of Signal Generator connected; RFE6GEN or Combo. Although you can use Signal Generator Combo, this example is designed to use with RFE6GEN.

Clone this wiki locally