AWG triggering

Post your C and C++ discussions here
Post Reply
vmjb
Newbie
Posts: 0
Joined: Fri Sep 20, 2013 11:23 am

AWG triggering

Post by vmjb »

I'm using the ps4227 and trying to get the software trigger on the AWG working for single shot. I have read the posts from people doing similar things but can't get mine to work. When I call ps4000SigGenSoftwareControl(unit.handle, 1) I get an error 0x3F from the programmers guide is "PICO_NOT_USED. The function is not available."

Any ideas what I'm doing wrong?

Code: Select all

	delta = ((1.0 * frequency * waveformSize) / AWGFileSize) * (4294967296.0 * UCVal);		
	
	status = ps4000SetSigGenArbitrary(	unit.handle, 
																				0,												// offset voltage
																				pkpk,											// PkToPk in microvolts. Max = 4uV  +2v to -2V
																				(unsigned long)delta,			// start delta
																				(unsigned long)delta,			// stop delta
																				0, // delta phase increment
																				0, // dwellCount for phase increment
																				arbitraryWaveform, 
																				waveformSize, 
																				(SWEEP_TYPE)0, 
																				0, 
																				SINGLE, //index mode - single sweep through arb waveform buffer
																				1, // shots
																				0, //sweeps
																				SIGGEN_GATE_HIGH,
																				SIGGEN_SOFT_TRIG, 
																				0);

	printf(status?"\nps4000SetSigGenArbitrary: Status Error 0x%x \n":"", (unsigned int)status);		// If status != 0, show the error

	status = ps4000SigGenSoftwareControl(unit.handle, 1);
	printf(status?"\nps4000SigGenSoftwareControl: Status Error 0x%x \n":"", (unsigned int)status);		// If status != 0, show the error

Hitesh

Re: AWG triggering

Post by Hitesh »

Hi vmjb,

Please ensure that you are using the latest ps4000.dll and also try changing the SIGGEN_GATE_HIGH to SIGGEN_RISING.

Best wishes,

vmjb
Newbie
Posts: 0
Joined: Fri Sep 20, 2013 11:23 am

Re: AWG triggering

Post by vmjb »

I am using the version 1.1.0.288 of ps4000.dll that came with PicoScope6 that I downloaded this week. Is this the latest version? I read of a similar problem from someone using LabView http://www.picotech.com/support/post343 ... awg#p34377
I have also tried triggering the AWG from the EXT and from the ScopeTrigger but no sucess.

The section on the ps4000SigGenSoftwareControl function in the programmers guide it states
state, sets the trigger gate high or low when the trigger type is
set to either SIGGEN_GATE_HIGH or SIGGEN_GATE_LOW. Ignored
for other trigger types.
(I did try SIGGEN_RISING before posting)

Hitesh

Re: AWG triggering

Post by Hitesh »

Hi,

I am able to trigger the AWG with the following code using ps4000.dll v1.2.0.54 available from PicoScope 6.7.35:

Code: Select all

if (waveformSize > 0) 
	{
		double delta = ((frequency * waveformSize) / 8192.0) * 4294967296.0 * 5e-8; // delta >= 10
		status = ps4000SetSigGenArbitrary(unit.handle,
						0, 
						4000000, 
						(unsigned long)delta, 
						(unsigned long)delta, 
						0, 
						0, 
						arbitraryWaveform, 
						waveformSize, 
						0,
						0, 
						SINGLE, 
						5, 
						0, 
						SIGGEN_RISING,
						SIGGEN_SOFT_TRIG,
						0);

		printf("Status of Arbitrary Gen: %x \n", (unsigned int)status);

		Sleep(5000);

		status = ps4000SigGenSoftwareControl(unit.handle, 1);
	}
The Sleep call is optional.

Ensure that your waveform is defined as integers in the range 0 to 4095 as well.

Hope this helps.

vmjb
Newbie
Posts: 0
Joined: Fri Sep 20, 2013 11:23 am

Re: AWG triggering

Post by vmjb »

Thanks for your help, I can now trigger the scope from software (although I can't seem to get the manual trigger working in PicoScope6. I somehow had an old version of Picoscope installed. I think I installed Picoscope6 before I had the hardware (last week) and didn't know the model (PS4227) at the time. Strange that it's that easy to dowload an old version?

I am now having trouble triggering the AWG from the the EXT_IN both in PicoScope6 and with my code. I don't think this will be a problem for me because I can use the SCOPE_TRIG but it would be a useful feature to have working any ideas on that?

Many Thanks

Hitesh

Re: AWG triggering

Post by Hitesh »

Hi,

What parameters are you setting for the call to the function, expecially the value for extInThreshold.

Please note that you will need to scale the value against the maximum External input voltage value and the corresponding ADC count value.

Regards,

Post Reply