Test and Measurement Forum

AWG - Output Shots

Post your MATLAB discussions here

AWG - Output Shots

Postby Carleton » Thu Jul 28, 2016 10:44 pm

Hello,

I'm trying to create an arbitrary waveform shot/burst but I only get a periodic signal. I'm using the example file 'PS3000A_IC_Generic_Driver_Sig_Gen.m' but I still don't get a shot/burst. I'm not sure what the input parameters should be or what is an acceptable range/values of the input parameters - currently I'm just using the parameters defined in the example code, see below:
Code: Select all
%% Arbitrary Waveform Generator - Output Shots
[status.setSigGenArbitrary] = invoke(sigGenGroupObj, 'setSigGenArbitrary', 0, 1, y, 0, 0, 2, 0, 0, 4, 0);

% Trigger the AWG

% State : 1
[status.sigGenSoftwareControl] = invoke(sigGenGroupObj, 'ps3000aSigGenSoftwareControl', 1);


Any help would be greatly appreciated, thanks!
Carleton
Newbie
 
Posts: 0
Joined: Thu Jul 28, 2016 10:24 pm

Re: AWG - Output Shots

Postby Hitesh » Fri Jul 29, 2016 7:49 am

Hi Carleton,

The code below from the example script should output 2 cycles of the defined waveform, y, when the ps3000aSigGenSoftwareControl function is called:

Code: Select all
%% Arbitrary Waveform Generator - Output Shots

% Increment      : 0 (Hz)
% Dwell Time     : 1 (s)
% Arb. Waveform  : y (defined above)
% Sweep Type     : 0 (ps3000aEnuminfo.enPS3000ASweepType.PS3000A_UP)
% Operation      : 0 (ps3000aEnuminfo.enPS3000AExtraOperations.PS3000A_ES_OFF)
% Shots          : 2
% Sweeps         : 0
% Trigger Type   : 0 (ps3000aEnuminfo.enPS3000ASigGenTrigType.PS3000A_SIGGEN_RISING)
% Trigger Source : 4 (ps3000aEnuminfo.enPS3000ASigGenTrigSource.PS3000A_SIGGEN_SOFT_TRIG)
% Ext. Threshold : 0
[status.setSigGenArbitrary] = invoke(sigGenGroupObj, 'setSigGenArbitrary', 0, 1, y, 0, 0, 0, 2, 0, 0, 4, 0);

% Trigger the AWG

% State : 1
[status.sigGenSoftwareControl] = invoke(sigGenGroupObj, 'ps3000aSigGenSoftwareControl', 1);

How are you viewing the resulting output signal? Under what conditions do you need to output your signal, and how many cycles do you need to output on each trigger event?

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: AWG - Output Shots

Postby Carleton » Fri Jul 29, 2016 7:04 pm

Thank-you, I had one less parameter which I think was causing the problem. It's working now!

At this stage, I'm using a separate oscilloscope to view the output signal. Is it possible to generate and receive an AWG signal with a single Picoscope device (i.e. 3000 series) using the Matlab code/driver? For example, can I combine the "PS3000A_IC_Generic_Driver_Sig_Gen.m" and "PS3000A_IC_Generic_Driver_Streaming.m" example code?

My output signal is at a constant 100kHz with 5 cycles on each trigger event. I'm not trying to sweep or increment frequencies. I'm not sure if I need to set a dwell time where I'm not sweeping frequencies. I set the trigger source to 4 because I get an error if I change it.

Thanks for the help!
Carleton
Newbie
 
Posts: 0
Joined: Thu Jul 28, 2016 10:24 pm

Re: AWG - Output Shots

Postby Hitesh » Mon Aug 01, 2016 9:00 am

Hi Carleton,

You can generate and receive a signal with a single PicoScope - copy and paste the relevant portion of code from the signal generator example into the streaming example if you wish.

Please note that the call to setup the signal generator should be before the call to start the actual data collection.

If you are outputting a waveform with a constant frequency, then you do not need to set a dwell time.

What is the error code output if you change the trigger source from 4 (this corresponds to the enumeration value enPS3000ASigGenTrigSource.PS3000A_SIGGEN_SOFT_TRIG)

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: AWG - Output Shots

Postby Carleton » Wed Aug 03, 2016 2:31 pm

Thank-you very much for the help! I'm able to use Matlab to create and capture the Picoscope signal with only one device. But, I did need to make sure the lines of code for generating the signal and streaming the data collection were very close to each other in my Matlab program. Apparently, the time it takes to read the lines of Matlab code can cause a high frequency signal burst to be missed??

[status.sigGenSoftwareControl] = invoke(sigGenGroupObj, 'ps3000aSigGenSoftwareControl', 1);
status.getStreamingLatestValues = invoke(streamingGroupObj, 'getStreamingLatestValues');

The error I get when I change the trigger source is below, what is the range of correct parameters?

Error using icgroup/invoke (line 92)
setSigGenArbitrary: Incorrect parameter passed to the signal generator.

Error in PS3000A_IC_Generic_Driver_Sig_Gen_SBMod (line 235)
[status.setSigGenArbitrary] = invoke(sigGenGroupObj, 'setSigGenArbitrary', 0, 0, fivecycle, 0, 0, 0, 1, 0, 0,
2, 0);

Thanks again for all the help, it's been great.
Carleton
Newbie
 
Posts: 0
Joined: Thu Jul 28, 2016 10:24 pm

Re: AWG - Output Shots

Postby Hitesh » Thu Aug 04, 2016 10:14 am

Hi Carleton,

Setting the trigger source to 2 (enPS3000ASigGenTrigSource.PS3000A_SIGGEN_AUX_IN from the ps3000aEnuminfo struct) would not be supported by the driver.

I would suggest using one of the following values:

  • 1 (enPS3000ASigGenTrigSource.PS3000A_SIGGEN_SCOPE_TRIG) if you want to use only of the input channels to trigger the signal generator.
  • 3 (enPS3000ASigGenTrigSource.PS3000A_SIGGEN_EXT_IN) if you want to use the external trigger input.
  • 4 (enPS3000ASigGenTrigSource.PS3000A_SIGGEN_SOFT_TRIG) if you want to use the software trigger.
If you wish to use the software trigger to cause the signal generator to output a number of shots/sweeps with streaming mode data collection, try implenting code similar to the stopButton code to set a flag on which the ps3000aSigGenSoftwareControl function call can be called..

Triggering the signal generator before starting the data collection by calling ps3000aSigGenSoftwareControl will result in some or potentially all of the waveform being missed.

Hope this helps,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2058
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to MATLAB

Who is online

Users browsing this forum: No registered users and 0 guests