Skip to content

Commit

Permalink
December-update-1
Browse files Browse the repository at this point in the history
JupyterLab update, all C and Python API commands added to the list, reorganised the command list and example structure
  • Loading branch information
Lightsaver7 committed Dec 21, 2023
2 parents d7d5e41 + d9c0fec commit 4e9c11f
Show file tree
Hide file tree
Showing 14 changed files with 1,318 additions and 1,029 deletions.
2 changes: 1 addition & 1 deletion appsFeatures/applications/streaming/appXCStreaming.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _mch_streaming_top:
.. _x-ch_streaming:

#######################
X-Channel Streaming
Expand Down
14 changes: 0 additions & 14 deletions appsFeatures/examples/scpi_examples.rst

This file was deleted.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion appsFeatures/remoteControl/deepMemoryAcquisition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ By default, 2 MB of the DDR RAM are reserved for the Deep Memory Acquisition. Th
API functions
=================

Check the :ref:`DMA section under the SCPI commands <scpi_dma>`.
Check the :ref:`DMA section under the commands' list <commands_dma>`.


API Code Examples
Expand Down
31 changes: 31 additions & 0 deletions appsFeatures/remoteControl/examples_top.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. _examples:

=========
Examples
=========

In the list below you will find examples of remote control and C algorithms. These examples cover all basic Red Pitaya functionalities, such as:

- signal generation
- signal acquisition
- deep memory acquisition
- digital I/O control
- communication protocols

You can edit and change them according to your needs and develop customized programs and routines.

.. toctree::
:maxdepth: 1

../examples/digital/digital.rst
../examples/analog/analog.rst
../examples/generation/genRF.rst
../examples/acquisition/acqRF.rst
../examples/acquisition_generation/acq_genRF.rst
../examples/multiboard_sync/multiboard.rst
../examples/DMA/deepMemoryAcq.rst
../examples/communication_interfaces/digcomIF.rst



Additional examples: :ref:`ABCLED`
386 changes: 21 additions & 365 deletions appsFeatures/remoteControl/jupyter/Jupyter.rst

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions appsFeatures/remoteControl/remoteAndProg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ Programming and remote-control tools
####################################

.. toctree::
:maxdepth: 2
:maxdepth: 1

remoteControl
scpi
API_scripts
jupyter/Jupyter
deepMemoryAcquisition
command_list
examples_top
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _remoteControl:
.. _scpi_commands:

SCPI server (MATLAB, LabVIEW, Scilab or Python)
##################################################
Expand All @@ -9,7 +9,7 @@ SCPI server (MATLAB, LabVIEW, Scilab or Python)

|
The Red Pitaya board can be controlled remotely over a LAN or wireless interface using MATLAB, LabVIEW, Scilab, or Python via the Red Pitaya SCPI (Standard Commands for Programmable Instrumentation) list of commands. The SCPI interface/environment is commonly used to control T&M instruments for development, research, or test automation purposes. SCPI uses a set of SCPI commands that are recognised by the instruments to enable specific actions to be taken (e.g., acquiring data from fast analog inputs, generating signals, and controlling other peripheries of the Red Pitaya platform). The SCPI commands are extremely useful when complex signal analysis is required. An SW environment such as MATLAB provides powerful data analysis tools and SCPI commands simple access to raw data acquired on the Red Pitaya board.
The Red Pitaya board can be controlled remotely over a LAN or wireless interface using MATLAB, LabVIEW, Scilab, or Python via the Red Pitaya SCPI (Standard Commands for Programmable Instrumentation) list of commands. The SCPI interface/environment is commonly used to control T&M instruments for development, research, or test automation. SCPI uses a set of commands recognised by the instruments to enable specific actions (e.g., acquiring data from fast analog inputs, generating signals, and controlling other peripheries of the Red Pitaya platform). The SCPI commands are extremely useful when complex signal analysis is required. A SW environment such as MATLAB that provides powerful data analysis tools is a perfect combination for the SCPI commands' simple access to raw data acquired on the Red Pitaya board.

**Features**

Expand All @@ -20,25 +20,24 @@ The Red Pitaya board can be controlled remotely over a LAN or wireless interface
- Take quick measurements directly on your PC.

|
|

***********
Quick start
***********

Start the SCPI server. This is done simply by clicking on the SCPI server icon and starting the SCPI server. When the SCPI server is started, the IP address of your board will be shown. This IP address must be entered into your scripts. Starting the SCPI server can also be done manually via Terminal (see below).
To initiate the SCPI server, just click on the SCPI server icon. Once the SCPI server is operational, your board's IP address will be displayed. This IP address should be incorporated into your scripts. Alternatively, you can manually commence the SCPI server using the Terminal (refer to the instructions below).

To run an example, follow the instructions below:

#. Go to your Red Pitaya main page and select the SCPI server in the Development section.
#. Go to your Red Pitaya web interface and select the SCPI server in the *Development* section.

.. figure:: img/scpi-homepage.png

|
.. figure:: img/scpi-development.png

|

#. Start the SCPI server by selecting the RUN button. Please note the IP of your Red Pitaya (192.168.178.100) board as it will be needed to connect to your board.

Expand All @@ -48,13 +47,12 @@ To run an example, follow the instructions below:
.. figure:: img/scpi-app-stop.png

|

#. Follow the instructions below suitable for your environment.

.. note::

It is not possible to run SCPI commands or programs in parallel with web applications.
Please refrain from running the SCPI server in parallel with other web applications like the Oscilloscope as it may result in undefined behaviour of both the application and the SCPI program.

.. contents::
:local:
Expand Down Expand Up @@ -151,7 +149,6 @@ To install them, do:
.. figure:: img/scpi-example-cli.png

|

More examples of how to control Red Pitaya from MATLAB can be found :ref:`here <examples>`.

Expand Down Expand Up @@ -198,7 +195,6 @@ To use the SCPI commands, you will need to set up Scilab sockets. The procedure
#. Go to the socket_toolbox folder.
#. Open loader.sce with your Scilab and press RUN (grey run button on SCILAB editor GUI).

|

These last two steps must be executed each time you start Scilab. To install, you must have an internet connection. Running the examples is the same as on MATLAB.

Expand All @@ -221,58 +217,31 @@ Different code examples can be found :ref:`here <examples>`.
Communicating with an SCPI server and working with web-based instruments at the same time can diminish the performance of your Red Pitaya. This is because the same resource is used for both tasks.

|
|
*****************************
Starting SCPI server manually
*****************************

Assuming you have successfully connected to your Red Pitaya board using :ref:`these instructions <faqConnected>` these instructions, remotely connect using Putty on Windows machines or with :ref:`SSH <ssh>` using Terminal on UNIX (macOSX/Linux) machines.
1. Connect to your Red Pitaya through :ref:`SSH <ssh>`.

Connect to your Red Pitaya board via the terminal on a Linux machine and start the SCPI server with the following command:
2. Start the SCPI server with the following command:

.. code-block:: shell-session
.. code-block:: shell-session
systemctl start redpitaya_scpi &
systemctl start redpitaya_scpi &
.. figure:: img/scpi-ssh.png
.. figure:: img/scpi-ssh.png

.. note::

In ecosystem versions 2-23 and higher. You can run directly without the service. This will allow you to see the server logs when executing commands.
Please make sure that the "default" *v0.94* FPGA image is loaded. With OS versions 2.00-23 or higher, exectue the following command:

.. figure:: scpi-run2.png

The logs are enabled with the command:
To see the server logs when executing commands:

.. code-block::
RP:LOGmode CONSOLE
.. include:: SCPI_commands.inc


.. _examples:

********
Examples
********


In the list below you will find examples of remote control and C algorithms. These examples cover all basic Red Pitaya functionalities, such as:

- signal generation
- signal acquisition
- digital I/O control
- communication protocols

You can edit and change them according to your needs and develop customized programs and routines.

.. toctree::
:maxdepth: 2

../examples/scpi_examples


Additional examples: :ref:`ABCLED`
2 changes: 1 addition & 1 deletion developerGuide/hardware/125-14/fastIO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Bandwidth
| Bandwidth | 50 MHz (3 dB) |
+---------------------------------+-----------------------------------------------+

In the picture below, the Frequency Response - Bandwidth of fast analog inputs is shown. Measurements are taken using an |Agilent 33250A| signal generator as a reference. The measured signal is acquired using :ref:`remote control (SCPI commands) <scpi_command_list>`. An amplitude voltage is extracted from the acquired signal and compared to the reference signal amplitude.
In the picture below, the Frequency Response - Bandwidth of fast analog inputs is shown. Measurements are taken using an |Agilent 33250A| signal generator as a reference. The measured signal is acquired using :ref:`remote control commands <command_list>`. An amplitude voltage is extracted from the acquired signal and compared to the reference signal amplitude.

.. figure:: img/measurements/Bandwidth_of_Fast_Analog_Inputs.png

Expand Down
2 changes: 1 addition & 1 deletion developerGuide/hardware/125-14_MULTI/top.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ X-Channel STEMlab 125-14 system consists of:

For detailed hardware specifications for Low-Noise STEMlab 125-14 devices used in the STEMlab 125-14 X-Channel System, please refer to the :ref:`STEMlab 125-14 standard specs <top_125_14>`.

For more information about the software, please refer to: :ref:`X-Channel streaming <mch_streaming_top>`.
For more information about the software, please refer to: :ref:`X-Channel streaming <x-ch_streaming>`.


Pinout
Expand Down
1 change: 1 addition & 0 deletions developerGuide/hardware/ext_modules/sensor_ext.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.. _sensor_extension_module:

#########################
Sensor extension module
Expand Down
4 changes: 2 additions & 2 deletions developerGuide/software/build/C_and_Python_API.inc
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ but we do recommend using the **"Home" ("/root")** directory for code storeage.
C and Python API all available commands
========================================

The API functions/commands are written together with the :ref:`Available SCPI commands' list <scpi_command_list>`.
The API functions/commands are written in the :ref:`available commands' list <command_list>`.
As of now the list does not include all possible options. If you want to check out all available API commands they are available here:

- C - Check the |rp-api| section of the GitHub repository (|RP_H|).
Expand All @@ -352,4 +352,4 @@ As of now the list does not include all possible options. If you want to check o
C and Python API examples
===========================

The examples are available :ref:`here <examples>`. They are presented together with the SCPI example code.
The examples are available :ref:`here <examples>`.
2 changes: 1 addition & 1 deletion developerGuide/software/other_info/spi/spi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ After that, you need to rebuild the tree and restart the board

.. note::

You can also switch the driver mode through the settings. See commands from :ref:`hw api<scpi_command_list>`:
You can also switch the driver mode through the settings. See commands from :ref:`hw api <command_list>`:

* rp_SPI_GetCSMode
* rp_SPI_SetCSMode
6 changes: 3 additions & 3 deletions quickStart/troubleshooting/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ How can I acquire data with Red Pitaya?

There are multiple approaches to acquiring data with Red Pitaya. Here is a quick description of each possiblity:
- **Oscilloscope application** – The data is acquired at full speed, but all the limitations of a standard oscilloscope apply (currently, the data can only be extracted upon user request via the application. Remote data collection is currently impossible). More info :ref:`here <osc_app>`.
- **SCPI data acquisition (Python, MATLAB, LabVIEW)** – Triggered data acquisition. The data is acquired in 16384 sample-long buffers. The code is executed on a computer, and string commands are sent to the Red Pitaya via |socket communication|. Data is acquired on the Red Pitaya and then sent back as a string that can be converted to a floating-point format. Trigger can be set to either IN1, IN2, or External (also IN3 and IN4 for STEMlab 125-14 4-Input). Trigger level can be specified. The acquisition must be restarted before a new “data buffer” can be acquired. There is a dead time between capturing two consecutive buffers where data is not saved. More details :ref:`here <remoteControl>`.
- **SCPI data acquisition (Python, MATLAB, LabVIEW)** – Triggered data acquisition. The data is acquired in 16384 sample-long buffers. The code is executed on a computer, and string commands are sent to the Red Pitaya via |socket communication|. Data is acquired on the Red Pitaya and then sent back as a string that can be converted to a floating-point format. Trigger can be set to either IN1, IN2, or External (also IN3 and IN4 for STEMlab 125-14 4-Input). Trigger level can be specified. The acquisition must be restarted before a new “data buffer” can be acquired. There is a dead time between capturing two consecutive buffers where data is not saved. More details :ref:`here <scpi_commands>`.
- **API commands (C, Python)** – Functions exactly the same as SCPI data acquisition, but it is faster since everything is running on the Red Pitaya board itself (the code is executed on the board). More info :ref:`here <API_commands>`.
- **Streaming application** – Continuous data acquisition. The data is streamed from one or both inputs directly to a file on a computer. The data can be acquired indefinitely, but there are speed limitations.
The total data flow at the inputs (IN1 and IN2) must not exceed 20 MB/s when streaming directly to a computer or 10 MB/s when streaming to the SD card. More details on the limitations are available :ref:`here <streaming_top>`.
Expand All @@ -339,15 +339,15 @@ How can I generate data with Red Pitaya?

Here are all possible generation options on the Red Pitaya (please be aware of AC coupling limitations on SDRlab 122-16):
- **Oscilloscope application** - basic waveform generation. More info :ref:`here <osc_app>`.
- **SCPI commands (Python, MATLAB, LabVIEW)**, remote control from computer - can generate basic waveforms as well as custom/arbitrary waveforms (defined in a 16384 sample-long buffer which represents one period of the signal - the frequency is calculated for the whole buffer). More details :ref:`here <remoteControl>`.
- **SCPI commands (Python, MATLAB, LabVIEW)**, remote control from computer - can generate basic waveforms as well as custom/arbitrary waveforms (defined in a 16384 sample-long buffer which represents one period of the signal - the frequency is calculated for the whole buffer). More details :ref:`here <scpi_commands>`.
- **API commands (C, Python)**, on-board program - same functionality as standard SCPI commands, but generally faster and includes the benefit of possible direct communication with the FPGA. More info :ref:`here <API_commands>`.
- **Custom/user-defined (FPGA reprogramming)** - Red Pitaya is open-source, so anyone has the option of reprogramming the FPGA image to customise the functionality.


How to control Red Pitaya remotely using LabVIEW, MATLAB, and Python?
-----------------------------------------------------------------------

* :ref:`Remote control <remoteControl>`
* :ref:`Remote control <scpi_commands>`


Where can I find the ecosystem, software, and FPGA images?
Expand Down

0 comments on commit 4e9c11f

Please sign in to comment.