ps3000_get_values - overflow flags mismatch

Post general discussions on using our drivers to write your own software here
Post Reply
viktor
User
User
Posts: 2
Joined: Mon Jul 09, 2007 8:14 pm

ps3000_get_values - overflow flags mismatch

Post by viktor » Mon Jul 09, 2007 8:43 pm

Hi,

I am adding ps3223 support to our scope application. The software uses block mode and ps3000_get_values. Single channel A is set and has voltage overflow on it. After ps3000_get_values returns, overflow output parameter is set to 2. This does not match ps3000_get_values specification that defines Bit 0 as an overflow flag for channel A. According to the specification the overflow parameter should be 1. All other channels are also shifted by one bit:
Bit1 -> Channel A
Bit2 -> Channel B
Bit3 -> Channel C
Bit4 -> Channel D
The same problem exists on ps3000_get_times_and_values.

Did anybody face the same issue?


Code:

Code: Select all

   short nHandle;
	long nTime;
	short nReady;
	short nOverflow;
	short aBuffer[1000];
	
	// Applied signal: 1 KHz DC, +-10V.
	nHandle = ps3000_open_unit();
	ps3000_set_channel(nHandle, PS3000_CHANNEL_A, 1, 0, 2);
	ps3000_set_channel(nHandle, PS3000_CHANNEL_B, 0, 0, 2);
	ps3000_set_trigger(nHandle, PS3000_NONE, 0, 0, 0, 0);
	ps3000_run_block(nHandle, 1000, 6, 1, &nTime);
	while ((nReady = ps3000_ready(nHandle)) == 0);
	ps3000_stop(nHandle);
	if (nReady > 0)
	{
		ps3000_get_values(nHandle, aBuffer, NULL, NULL, NULL, &nOverflow, 1000);
		// nOverflow is 2, must be 1 according to PS3000 specification.
	}
	ps3000_close_unit(nHandle);

markB
Site Admin
Site Admin
Posts: 83
Joined: Tue Mar 27, 2007 9:43 am
Location: Cambridgeshire,UK

Post by markB » Thu Jul 19, 2007 10:29 am

You are quite correct. The overflow is being reported wrong. I've reported a bug and the fix should go into upcoming 5.17.x release.

To get you going, I've attached a dll that fixes the problem.
Attachments
ps3000.zip
(241.71 KiB) Downloaded 375 times
Regards

Mark

viktor
User
User
Posts: 2
Joined: Mon Jul 09, 2007 8:14 pm

Post by viktor » Fri Jul 20, 2007 9:16 pm

Mark,

Thank you for the reply and the updated ps3000.dll.

Unfortunately, the attached ps3000.dll (v 3.3.3.0) does not work for me. ps3000_ready in the example above never returns 1. I will wait for the official release.

The workaround with shifting by one bit seems to work fine but requires installation of ps3000.dll to the application target folder. Please keep in mind that some developers may have implemented this workaround as well. If they install ps3000.dll v 3.2.4.0 to System32 folder and another application puts newer fixed ps3000.dll to System32, the first application will not be able to detect overflow properly.

ziko
Advanced User
Advanced User
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Post by ziko » Wed Aug 08, 2007 10:41 am

Hi the newest release of the software is out now, 5.17.1, please try this to see if it resolves your problem.

http://www.picotech.com/software.html

Kind regards

Ziko
Ziko

Technical Specialist

Post Reply