Scripting Tutorial

General Introduction

As mentioned before, the idea of scripts is to automate particular steps in a given measurement sequence or even to handle the whole measurement procedure.

SignalShark supports this by its “nardascripting API” that gives an easy access to SignalSharks comprehensive SCPI remote command interface in Python via TCP connection.

The graphical user interface Narda Script Launcher enables an convenient way to select and start a script. Thus the script itself can be kept very simple. Nevertheless it is also possible to cover complex measurement scenarios.

Narda Script Launcher Structure

Python Basics

This section provides some basic knowledge about Python in general and can be skipped if Python is already known.
On the Internet there are a lot of good and detailed tutorials for Python. Since this chapter can only touch on many topics, it is recommended to use such a tutorial especially for beginners.

Cheat Sheet (Copy & Paste)

This page contains a collection of useful templates and code snippets.

Example 1: Writing a Simple Script

This example explains how to create a simple script for SignalShark based on the template tmpusrscript.py.

Example 2: Writing a Threading Based Script

This example explains how to create a multithreading script for SignalShark based on the template tmpusrscriptmthread.py.

Example 3: Writing Your Own Dialog Script

This example explains how to create a simple dialog script for SignalShark with wxFormBuilder and use it with the multithreading template tmpusrscriptmthread.py.

Example 4: Writing Your Own Plot-Based Dialog Script

This example explains how to create a plot-based dialog script for SignalShark with wxFormBuilder and use it with the multithreading template tmpusrscriptmthread.py.

Integrating matplotlib with wxPython Dialogs

This chapter provides a quick overview of how to use matplotlib with the graphical dialogs created by wxPython and use it for SignalShark scripting.