Page 2 of 2

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

Posted: Mon Jul 11, 2016 8:38 am
by Festo
I tried it, but nothing changed. After 70 seconds the oscilloscope didn't show me a signal. I used an external oscilloscope, not the RP oscilloscope. Here is my 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 sine');                                                 
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:NOR -1');    % Infinity number of sine wave pulses
fprintf(tcpipObj,'SOUR2:BURS:INT:PER 1000'); % Set time of burst period in microseconds = 5 * 1/Frequency * 1000000
fprintf(tcpipObj,'SOUR2:BURS:NCYC 1000');       % Set 1 pulses of sine wave

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: Mon Jul 11, 2016 9:11 pm
by Nils Roos
My bad, I didn't wait long enough. With your first set of instructions, it stopped pretty quickly, and when it didn't stop after half a minute with the changed sequence, I assumed it would be alright. *Sigh* I'll have to dig a little deeper then...

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

Posted: Tue Jul 12, 2016 10:28 am
by Laurent
Hi Nils,
here is the non working code.
Any help highly appreciated :)
Laurent
BTW do you know how to activate scpi debug (log is included in the code but not activated as far as i understand).

Code: Select all

%% Define Red Pitaya as TCP/IP object
clc
clear all
close all
IP= '125.40.41.97';           % Input IP of your Red Pitaya...
port = 5000;
tcpipObj=tcpip(IP, port);

tcpipObj.InputBufferSize = 16384*64;
tcpipObj.OutputBufferSize = 16384*64;
flushinput(tcpipObj)
flushoutput(tcpipObj)

%% Open connection with your Red Pitaya and close previous
x=instrfind;
fclose(x);
fopen(tcpipObj);
tcpipObj.Terminator = 'CR/LF';

%% ARBITRARY
% Calcualte arbitrary waveform with 16384 samples
% Values of arbitrary waveform must be in range from -1 to 1.
N=16383;
t=0:(2*pi)/N:2*pi;
x=ones(size(t));x(1)=0;x(end)=0;
% plot(t,x)
% grid on

% Convert waveforms to string with 5 decimal places accuracy
waveform_ch_1_0 =num2str(x,'%1.5f,');
% latest are empty spaces  “,”.
waveform_ch_1 =waveform_ch_1_0(1,1:length(waveform_ch_1_0)-3);

%%

fprintf(tcpipObj,'GEN:RST')                     % Reset to default settings
fprintf(tcpipObj,'SOUR1:FUNC ARBITRARY');       % Set function of output signal
fprintf(tcpipObj,['SOUR1:TRAC:DATA:DATA ' waveform_ch_1])  % Send waveforms to Red Pitya
fprintf(tcpipObj,'SOUR1:VOLT 0.7');             % Set amplitude of output signal
fprintf(tcpipObj,'SOUR1:FREQ:FIX 5000000');        % Set frequency of output signal

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

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

Posted: Tue Jul 12, 2016 10:44 am
by Festo
I tried it and I could recognize the Signal. So it works on my RP.

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

Posted: Tue Jul 12, 2016 2:28 pm
by Laurent
Well it works for 5 seconds (50000/10kHz). Then it stops. I use redpitaya 0.95.
maybe you have another version?

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

Posted: Mon Jul 18, 2016 8:11 am
by Festo
Sorry. I thought you have another problem. The problem with to early ending process is also in my programm. Till now nowbody could found a solution.

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

Posted: Mon Jul 25, 2016 10:40 am
by Festo
Did anyone find something out to fix this problem?

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

Posted: Mon Oct 17, 2016 12:58 pm
by Festo
Did anyone find a solution yet? Is it a hardware or a software problem?

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

Posted: Mon Jul 29, 2019 4:04 pm
by hugoralf
I didn't find the solution yet. Did anyone find the solution for such problem in matlab code?