Test and Measurement Forum

Single shot arbitrary waveform

Post your C and C++ discussions here

Single shot arbitrary waveform

Postby ARC » Tue Jan 15, 2013 9:38 am

I am trying to send an arbitrary waveform to the picoscope so that the waveform is fired once from start of the file to end of the file and not repeated.
I am currently controlling arbitrary functions like this:
Code: Select all
status = ps2000aSetSigGenArbitrary(   unit.handle,
         offset,
         pktopk,
         (unsigned long) delta,
         (unsigned long) delta,
         0,
         0,
         arbitraryWaveform,
         waveformSize,
         PS2000A_UP,
         PS2000A_ES_OFF,
         PS2000A_SINGLE,
         0,
         1,
         PS2000A_SIGGEN_RISING,
         PS2000A_SIGGEN_NONE,
         0);

I have tried changing the sweeps and shots with and without changing the trigger source to SOFT_TRIG and type to GATE_HIGH. and neither of these combinations worked.

Has anyone been able to do this?

Thanks for looking :)
ARC
Newbie
 
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am

Re: Single shot arbitrary waveform

Postby Hitesh » Tue Jan 15, 2013 10:01 am

Hi ARC,

Please try the following:

  • Set the trigger source to PS2000A_SIGGEN_SOFT_TRIG
  • Call the ps2000aSigGenSoftwareControl function with the state parameter set to 0 or 1
  • You can use Gate High/Gate Low to turn the signal generator on or off

Hope this helps.
Hitesh

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

Re: Single shot arbitrary waveform

Postby ARC » Tue Jan 15, 2013 10:20 am

I can't find that function in the c console app form the SDK. I think im using version r10_4_1_6, does this make a difference?
I have taken the c console SDK and modified it for use as a DLL to my c# program.

Sorry should have explained that to begin with.

Thanks for the help :)
ARC
Newbie
 
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am

Re: Single shot arbitrary waveform

Postby Hitesh » Tue Jan 15, 2013 10:37 am

Hi ARC,

Please refer to section 2.11.55 in the Programmer's Guide (http://www.picotech.com/document/pdf/ps2000apg.en-3.pdf) - the function is supported by the dll but the Console Example does not show how to call all of our functions (this is something we will look to address).

Once you have called the ps2000aSetSigGenArbitrary() function, call the ps2000aSigGenSoftwareControl() function at the point at which you wish to trigger the signal generator.

Best wishes,
Hitesh

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

Re: Single shot arbitrary waveform

Postby ARC » Tue Jan 15, 2013 11:03 am

Ok i see.

So as a test if i put the softwarecontrol call after the setsigen call it should work as before? but only output the waveform once not continuously?

status = SetSignalGenerator(unit,frequency,waveform,filename,offset,pktopk, channelbtrig);
status = ps2000aSigGenSoftwareControl(unit.handle,0);

the above outputs a constant voltage at what ever pktopk is set at but if i change state parameter to 1 it outputs the waveform continuously as before:

status = SetSignalGenerator(unit,frequency,waveform,filename,offset,pktopk, channelbtrig);
status = ps2000aSigGenSoftwareControl(unit.handle,1);

Thanks for the help.
ARC
Newbie
 
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am

Re: Single shot arbitrary waveform

Postby Hitesh » Tue Jan 15, 2013 3:07 pm

Hi ARC,

If you set the trigger type to PS2000A_SIGGEN_FALLING, then if you set the state to 0, the signal generator should output the waveform.

Conversely, if you set the trigger type to PS2000A_SIGGEN_RISING, then if you set the state to 1, the signal generator should output the waveform.

I've just run a test and can output a single sine wave - below are the relevant function calls:

Code: Select all
status = ps2000aSetSigGenArbitrary(   unit.handle, 0, 2000000, (unsigned long)delta, (unsigned long)delta, 0, 0, arbitraryWaveform, waveformSize, (PS2000A_SWEEP_TYPE) 0,  (PS2000A_EXTRA_OPERATIONS) 0, PS2000A_SINGLE, 1, 0, PS2000A_SIGGEN_RISING, PS2000A_SIGGEN_SOFT_TRIG, 0);

Sleep(5000);

status = ps2000aSigGenSoftwareControl(unit.handle, 1);


I've also attached an example arbitrary waveform file I used.

sine_wave_4096_2.txt
Sine wave example - 4096 samples
(29.12 KiB) Downloaded 119 times


Hope this helps.
Last edited by Hitesh on Tue Jan 15, 2013 5:34 pm, edited 2 times in total.
Reason: Aligning arbitrary waveform function call
Hitesh

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

Re: Single shot arbitrary waveform

Postby ARC » Tue Jan 15, 2013 3:31 pm

Yep great that works now. Thank you so much for your help.
My issue was putting the siggensoftcontrol outside of the siggen function.

Thanks so much! :)
ARC
Newbie
 
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am


Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests