Single shot arbitrary waveform

Post your C and C++ discussions here
Post Reply
ARC
Newbie
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am

Single shot arbitrary waveform

Post by ARC »

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 :)

Hitesh

Re: Single shot arbitrary waveform

Post by Hitesh »

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.

ARC
Newbie
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am

Re: Single shot arbitrary waveform

Post by ARC »

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 :)

Hitesh

Re: Single shot arbitrary waveform

Post by Hitesh »

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,

ARC
Newbie
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am

Re: Single shot arbitrary waveform

Post by ARC »

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.

Hitesh

Re: Single shot arbitrary waveform

Post by Hitesh »

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 617 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

ARC
Newbie
Posts: 0
Joined: Wed Aug 08, 2012 8:38 am

Re: Single shot arbitrary waveform

Post by ARC »

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! :)

Post Reply