I am working with a Rohde & Schwarz signal generator (SMC100A). I am remotely programming this instrument using SCPI through matlab. I need to generate a sequence of pulses where each pulse is swept over time from 100MHz-300MHz so the pulse transmits each frequency for roughly 50us. In other words each pulse transmits a signal at 100MHz for 50us, then 101 MHz for 50us until finally reaching 300MHz for 50us. Then, since this is the end of pulse, we wait 1ms until transmitting another pulse.
I am reading my pulse generation using an oscilloscope, which is how I know the pulse sequence generation is incorrect.
For now, I am just trying to generate one pulse after another (two pulses total) in order to make sure I understand the process of sequential commands.
I am able to generate a single pulse fine, as that is a simple sawtooth frequency sweep. My problem comes in when trying to generate another pulse after the first one.
I believe the issue to be my misunderstanding of the "*OPC?" Query Command but I am not sure where my misunderstanding lies.
Currently I am performing these steps in the code:
1) Initialize the hardware
2) Setup the frequency sweep
3) Execute the first pulse
4) Send the "*OPC?" command to the instrument
5) Send another pulse
6) Send the "*OPC?" command to the instrument
7) Turn off the RF signal generation
What I expect to happen is one pulse transmits, a second pulse transmits and then the RF signal is turned off completely.
What is actually happening is one frequency of one pulse is sent, the RF power is turned off, and the signal generator is still sweeping through all frequencies of the pulse.
This leads me to believe "*OPC?" does not operate the way I believed but I do not know how to fix it.
My code is below. "SMC100A" refers to the VISA_Instrument object instantiated.
Is there a straightforward way for me to properly time the equipment to make this pulse sequence possible?
Thank you.
pulseCenter = 200e6;
pulseDelta = 100e6;
pulseStep = 1e6;
dwellTime = .01;
powerLevel__dBm = (-30);
startFREQ = num2str(pulseCenter - pulseDelta);
stopFREQ = num2str(pulseCenter + pulseDelta);
stepFREQ = num2str(pulseStep);
dwellTIME = num2str(dwellTime);
powerLevel_dBm = num2str(powerLevel__dBm);
Device_IP = '000000000';
SMC100A = VISA_Instrument(strcat('TCPIP::',Device_IP,'::INSTR'));
SMC100A.ClearStatus();
systemResponse = SMC100A.QueryString('*IDN?');
fprintf('\nInstrument Identification string: %s\n', systemResponse);
SMC100A.Write('*RST;*CLS');
SMC100A.Write('INIT:CONT OFF');
SMC100A.Write('SYST:DISP:UPD ON');
SMC100A.ErrorChecking();
SMC100A.Write('OUTP ON');
SMC100A.Write('TRIG:FSWeep:SOUR SING');
SMC100A.Write('SOUR:SWE:FREQ:SHAP SAWT');
SMC100A.Write('SOUR:FREQ:MODE SWE')
SMC100A.ErrorChecking();
SMC100A.Write(strcat(['POW' ' ' powerLevel_dBm]));
SMC100A.Write(strcat(['SWE:STEP:LIN' ' ' stepFREQ]));
SMC100A.Write(strcat(['SWE:DWEL' ' ' dwellTIME]));
SMC100A.Write(strcat(['FREQ:STAR' ' ' startFREQ]));
SMC100A.Write(strcat(['FREQ:STOP' ' ' stopFREQ]));
SMC100A.ErrorChecking();
SMC100A.Write('*WAI');
SMC100A.Write('SOUR:SWE:FREQ:EXEC');
buffer = SMC100A.QueryInteger('*OPC?');
SMC100A.ErrorChecking();
SMC100A.Write('SOUR:SWE:FREQ:EXEC');
buffer = SMC100A.QueryInteger('*OPC?');
SMC100A.ErrorChecking();
SMC100A.Write('OUTP OFF');
SMC100A.ErrorChecking();
0 Comments
Sign in to comment.