Page 1 of 1

About using Red Pitaya to generate signal

Posted: Wed Mar 13, 2024 11:16 am
by tttt3222
Hello!
When I using STEMlab 125-10 to generate signal, I find that the type of signal and the amplitude of output signal can't be set on the matlab. I would like to know if the code is wrong or some other reason. The code is the example given by you.
The following is the cut of the code:
%% GENERATION
writeline(RP,'SOUR1:FUNC SINE');
writeline(RP,'SOUR1:FREQ:FIX 1000000'); % Set frequency of output signal
writeline(RP,'SOUR1:VOLT 1'); % Set amplitude of output signal

writeline(RP,'SOUR1:BURS:STAT BURST'); % Set burst mode to BURST
writeline(RP,'SOUR1:BURS:NCYC 3'); % Set 3 pulses of sine wave
Looking forward to your reply.

Re: About using Red Pitaya to generate signal

Posted: Fri Mar 15, 2024 11:22 am
by redpitaya
Hello tttt3222,

Thank you for writing on the forum.
The provided code looks OK, but several lines of code, crucial for the correct functionality, are missing.
First of all, please note that you are generating a burst signal. Without proper settings on the oscilloscope, you will miss the signal. I would suggest first generating a continuous signal, and once that is working, moving on to burst signals.

Secondly, please check whether the signal is correctly triggered. You need both of the following commands to trigger the output:

Code: Select all

writeline(RP,'OUTPUT1:STATE ON');           % Set output to ON
writeline(RP,'SOUR1:TRIG:INT');             % Generate trigger
Also, here are working examples that you can use to jumpstart your programing:
https://redpitaya.readthedocs.io/en/lat ... l#examples

Re: About using Red Pitaya to generate signal

Posted: Fri Mar 15, 2024 11:23 am
by redpitaya
I am moving this to Software.