Page 1 of 2

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

Posted: Tue May 31, 2016 11:13 am
by Festo
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);

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

Posted: Tue May 31, 2016 8:38 pm
by Nils Roos
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".

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

Posted: Tue May 31, 2016 11:06 pm
by lvillasen
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

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

Posted: Tue May 31, 2016 11:17 pm
by Nils Roos
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.

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

Posted: Tue May 31, 2016 11:33 pm
by lvillasen
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

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

Posted: Wed Jun 01, 2016 3:45 pm
by lvillasen
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

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

Posted: Mon Jul 04, 2016 1:49 pm
by Festo
-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);

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

Posted: Tue Jul 05, 2016 1:52 pm
by Nils Roos
It works if you do "SOUR#:BURS:NCYC" after "SOUR#:BURS:INT:PER".

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

Posted: Thu Jul 07, 2016 7:26 pm
by Laurent
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

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

Posted: Sat Jul 09, 2016 10:10 am
by Nils Roos
Well, I tried it before posting, and it did. Can you post your complete sequence of commands ?