Pulse mode: Infinite number of repeated bursts doesn't work

Applications, development tools, FPGA, C, WEB
Festo
Posts: 10
Joined: Tue May 24, 2016 1:16 pm
Location: Berlin

Pulse mode: Infinite number of repeated bursts doesn't work

Post by Festo » Tue May 31, 2016 11:13 am

I want to create a pulse generator with RP. So I tried to set the number of repeated bursts to INF, but it didn't work. When I tried to set it to a number like two, it works.
Does the SCPI command SOUR1:BURS:NOR INF works at all or do I make a mistake?

Here is the Matlab-code:

Code: Select all

%% Define Red Pitaya as TCP/IP object
clc
clear all			
close all
IP= '172.23.56.50';           % Input IP of your Red Pitaya...
port = 5000;                    % If you are using WiFi then IP is:              
tcpipObj=tcpip(IP, port);       % 192.168.128.1

fopen(tcpipObj);
tcpipObj.Terminator = 'CR/LF';

%% The example generate sine bursts every 0.5 seconds indefinety
fprintf(tcpipObj,'GEN:RST');

fprintf(tcpipObj,'SOUR1:FUNC sine');                                                 
fprintf(tcpipObj,'SOUR1:FREQ:FIX 1000');     % Set frequency of output signal
fprintf(tcpipObj,'SOUR1:VOLT 1');          % Set amplitude of output signal

fprintf(tcpipObj,'SOUR1:BURS:STAT ON');    % Set burst mode to ON
fprintf(tcpipObj,'SOUR1:BURS:NCYC 10');      
fprintf(tcpipObj,'SOUR1:BURS:NOR 5');    % It works, but not with INF
fprintf(tcpipObj,'SOUR1:BURS:INT:PER 5000'); 
fprintf(tcpipObj,'SOUR1:TRIG:IMM');          % Set generator trigger to immediately
fprintf(tcpipObj,'OUTPUT1:STATE ON');         % Set output to ON


%% Close connection with Red Pitaya

fclose(tcpipObj);

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Pulse mode: Infinite number of repeated bursts doesn't w

Post by Nils Roos » Tue May 31, 2016 8:38 pm

It looks like you found another inconsistency between the documentation of the scpi-server and its actual implementation.

The "SOUR#:BURS:NOR" command only parses numbers. Judging by the source code, -1 should be a viable substitute for INF.

To better see when the scpi-server could not parse your input, you should always examine the response to your commands. "SOUR1:BURS:NOR INF" was in all likelihood answered with an "ERR".
Last edited by Nils Roos on Tue May 31, 2016 8:40 pm, edited 1 time in total.
Reason: turns out you can't use 0 - edited to reflect that

lvillasen
Posts: 4
Joined: Thu Nov 26, 2015 9:13 pm

Re: Pulse mode: Infinite number of repeated bursts doesn't w

Post by lvillasen » Tue May 31, 2016 11:06 pm

Hello,

The attached C code exhibits the same inconsistency: it generates a sine wave of T=1 us every 5 us only a few times, while according to the documentation it should do it an infinite number.
I have noticed that for some combinations of parameters the INF option works.

Any solution?

Regards
You do not have the required permissions to view the files attached to this post.

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Pulse mode: Infinite number of repeated bursts doesn't w

Post by Nils Roos » Tue May 31, 2016 11:17 pm

The attached C code exhibits the same inconsistency
Not sure it's relevant, but there's a problem in your code: "rp_GenTrigger(1);" actually affects channel 2, this function expects an enum rp_channel_t as argument.

lvillasen
Posts: 4
Joined: Thu Nov 26, 2015 9:13 pm

Re: Pulse mode: Infinite number of repeated bursts doesn't w

Post by lvillasen » Tue May 31, 2016 11:33 pm

Not sure either but I would appreciate if you could show a code that actually works.
It looks that the lower the repetition rate the longer the train of pulses is generated.

Regards

lvillasen
Posts: 4
Joined: Thu Nov 26, 2015 9:13 pm

Re: Pulse mode: Infinite number of repeated bursts doesn't w

Post by lvillasen » Wed Jun 01, 2016 3:45 pm

Hello,

A workaround solution which sacrifices granularity in the burst-pulse definition is to fit all the burst pulses in the AWG buffer of size 16384.

An example is shown in the attached C code that generates 1-3 negative exponential pulses separated by an arbitrary delta-time with an arbitrary decay time and an arbitrary repetition rate. For example the command
./PMT_Sim_Continuous 3 1 400 100 10000
produces 3 exponential pulses with a negative amplitude of 1 V, separated by 400 ns with a decay time of 100 ns at a repetition rate of 10 KHz. The 3 exponential pulses have different overlapping structure on purpose to make them different for test purposes. The attached figure is a screenshot of the result.
Regards
lvillasen
PMT_Sim_Continuous.c
You do not have the required permissions to view the files attached to this post.

Festo
Posts: 10
Joined: Tue May 24, 2016 1:16 pm
Location: Berlin

Re: Pulse mode: Infinite number of repeated bursts doesn't w

Post by Festo » Mon Jul 04, 2016 1:49 pm

-1 works correctly. Now there ist another problem. When the burst time is short like 10 us, the signal output stops very quick. But it should run for infinite time. Is there a way to let it run an infinite time. Here is my matlab code.

Code: Select all

%% Define Red Pitaya as TCP/IP object
clc
clear all
close all
IP= '172.23.56.50';           % Input IP of your Red Pitaya...
port = 5000;                    % If you are using WiFi then IP is:              
tcpipObj=tcpip(IP, port);       % 192.168.128.1

fopen(tcpipObj);
tcpipObj.Terminator = 'CR/LF';

%% The example generate sine bursts every 0.5 seconds indefinety
%fprintf(tcpipObj,'GEN:RST');

fprintf(tcpipObj,'SOUR2:FUNC square');                                                 
fprintf(tcpipObj,'SOUR2:FREQ:FIX 13000000');     % Set frequency of output signal
fprintf(tcpipObj,'SOUR2:VOLT 1');          % Set amplitude of output signal

fprintf(tcpipObj,'SOUR2:BURS:STAT ON');    % Set burst mode to ON
fprintf(tcpipObj,'SOUR2:BURS:NCYC 100000');       % Set 1 pulses of sine wave
fprintf(tcpipObj,'SOUR2:BURS:NOR -1');    % Infinity number of sine wave pulses
fprintf(tcpipObj,'SOUR2:BURS:INT:PER 10000'); % Set time of burst period in microseconds = 5 * 1/Frequency * 1000000
fprintf(tcpipObj,'SOUR2:TRIG:IMM');          % Set generator trigger to immediately
fprintf(tcpipObj,'OUTPUT2:STATE ON');         % Set output to ON


%% Close connection with Red Pitaya

fclose(tcpipObj);

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Pulse mode: Infinite number of repeated bursts doesn't w

Post by Nils Roos » Tue Jul 05, 2016 1:52 pm

It works if you do "SOUR#:BURS:NCYC" after "SOUR#:BURS:INT:PER".

Laurent
Posts: 18
Joined: Mon Jun 23, 2014 6:38 pm
Location: Paris

Re: Pulse mode: Infinite number of repeated bursts doesn't w

Post by Laurent » Thu Jul 07, 2016 7:26 pm

doesnt work with any order combination of:

Code: Select all

fprintf(tcpipObj,'SOUR1:BURS:INT:PER 100'); % Set time of burst period in microseconds = 5 * 1/Frequency * 1000000
fprintf(tcpipObj,'SOUR1:BURS:NOR -1');    % Infinity number of sine wave pulses
fprintf(tcpipObj,'SOUR1:BURS:NCYC 1');       % Set 1 pulses of sine wave

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Pulse mode: Infinite number of repeated bursts doesn't w

Post by Nils Roos » Sat Jul 09, 2016 10:10 am

Well, I tried it before posting, and it did. Can you post your complete sequence of commands ?

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 22 guests