SCPI communication speed

Applications, development tools, FPGA, C, WEB
jdetlefs
Posts: 7
Joined: Wed Dec 22, 2021 10:01 pm

Re: SCPI communication speed

Post by jdetlefs » Wed Jan 26, 2022 3:43 pm

Hey All,

Figured out the issue. Turns out I am a moron. :D

Simply adding a while loop in LabVIEW didn't work.

You need to remove the reset-wave-generator vi, but also add in a wait time of around
100ms otherwise the Red Pitaya didn't have enough time to react to the commands.

Attached is a single channel function generator that works pretty decently now.

Once I get the oscilloscope portion working, then, I will likely need help figuring out
data speeds if they are an issue.

Thanks to everyone trying to help me overcome my stupidity.

Best wishes,
Jdetlefs

Marco23
Posts: 4
Joined: Mon Feb 14, 2022 4:10 pm

Re: SCPI communication speed

Post by Marco23 » Mon Feb 14, 2022 8:50 pm

dafa wrote:
Thu Jun 29, 2017 4:30 pm
Hi all,

I use SCPI commands to get the 125 MHz sampled data from the RedPitaya. As I noticed, the SCPI communication is quite slow. I have now measured the execution time of the API C functions with a C-program (Meas1) and a further measurement at the same settings from the PC with the SCPI commands in a Python-program (Meas2).

Meas1: Python-program ---> SCPI-server ---> API ---> FPGA
Meas2: C-program ---> API ---> FPGA

For example it takes 0.2 ms in the C-programm to get the data and in the Python-program it takes 600.2 ms. In the SCPI-server I lose about 600 ms, regardless of the amount of data I transfer from RedPitaya to my PC. Since I would like to acquire as much data as possible, this delay really limits my project.

Is the SCPI communication in general slow or where exactly lies the bottleneck?
Is there a possibility to make the SCPI communication faster?

Thanks a lot!

Can I ask you to provide me the code you use for reading fast inputs with c, please?
That program runs on the red pitaya or on you personal computer? If the latter, with which protocol did you connect to the board?

Thanks!

pavel
Posts: 790
Joined: Sat May 23, 2015 5:22 pm

Re: SCPI communication speed

Post by pavel » Mon Feb 14, 2022 9:38 pm

Marco23 wrote:
Mon Feb 14, 2022 8:50 pm
That program runs on the red pitaya or on you personal computer? If the latter, with which protocol did you connect to the board?
Sending and receiving raw binary data over TCP is relatively easy. You simply send the data using the send() function and receive the data using the recv() function. No particular protocol is required.

I use this approach in some of my projects and it works quite well for me.

Here is a link to an example of C code for a TCP server running on the Red Pitaya board and sending the data:
https://github.com/pavel-demin/red-pita ... t-server.c

Here is a link to an example of C code for a TCP client running on a personal computer and receiving the data:
https://github.com/pavel-demin/red-pita ... t-client.c

Marco23
Posts: 4
Joined: Mon Feb 14, 2022 4:10 pm

Re: SCPI communication speed

Post by Marco23 » Tue Feb 15, 2022 5:33 pm

Thanks for replying me

Before getting into it, this is only a continuous streaming or can you set settings like decimation and trigger level?

I'd need to get data on a particular trigger condition from both channels and i'd like to know if this solution is suitable for me

At the moment I have created this python script with (except for the ASCII format, which BIN would help me in saving space) does exactly what i need https://pastebin.com/VNrfkj8k, but it is slow (about 600ms dead time)

If with your help we can create something even in C that's not a problem for me.

I appreciate your help

werefkin
Posts: 7
Joined: Tue Jan 26, 2021 4:16 pm

Re: SCPI communication speed

Post by werefkin » Wed Apr 26, 2023 4:32 pm

pavel wrote:
Mon Feb 14, 2022 9:38 pm
Marco23 wrote:
Mon Feb 14, 2022 8:50 pm
That program runs on the red pitaya or on you personal computer? If the latter, with which protocol did you connect to the board?
Sending and receiving raw binary data over TCP is relatively easy. You simply send the data using the send() function and receive the data using the recv() function. No particular protocol is required.

I use this approach in some of my projects and it works quite well for me.

Here is a link to an example of C code for a TCP server running on the Red Pitaya board and sending the data:
https://github.com/pavel-demin/red-pita ... t-server.c

Here is a link to an example of C code for a TCP client running on a personal computer and receiving the data:
https://github.com/pavel-demin/red-pita ... t-client.c
Hi, is there an example of an on-trigger acquisition?

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 25 guests