Test and Measurement Forum

How to verify the USB connection state (PS3000)

Post general discussions on using our drivers to write your own software here

How to verify the USB connection state (PS3000)

Postby bane » Thu Apr 02, 2009 8:31 am

Hi,

I have following scenario:
- HW: PS3204

1. Connection Set Up is established via ps3000_open_unit
2. Now the USB connector is disconnected

How to get the information that the scope connection is broken?

Best regards,
Bane
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Postby Robin » Thu Apr 02, 2009 9:50 am

Hi

You could call ps3000_get_unit_info and check the error code returned.

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Postby bane » Thu Apr 02, 2009 10:49 am

Hi Robin,

I have tried this, but I always get ErrorCode = 0. Which is PS3000_OK.

Below used SW versions:

Driver Version = 3.2.4.0
HW Version 5
Kernel Driver Version =1.13

Maybe I need a SW update?!

Regards,
Bane
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Postby Robin » Thu Apr 02, 2009 11:11 am

Hi Bane

I just checked and the ps3000_get_unit_info function returns the unit info stored by the driver. It does not communicate with the device.

Therefore, you need to call a function such as get_data first.

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Postby bane » Thu Apr 02, 2009 12:35 pm

Hi Robin,

I assume you mean ps3000_get_values function?!

If no, please confirm.

I couldn't find the declaration of get_data in the technical reference.

Thanks in advance!

Bane
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Postby Erik » Fri Apr 03, 2009 7:26 am

Hi Bane,

You need to do a run (or get values) to get the connection state of the device.
Erik
PICO STAFF
PICO STAFF
 
Posts: 52
Joined: Mon Oct 23, 2006 8:16 am
Location: Cambridgeshire, UK

Postby bane » Fri Apr 03, 2009 8:05 am

Hi Erik,

Ok. In case the disconnect occurs before invoking the run_block function, the run_block function will return an error.

But, in case the disconnect occurs after calling of run_block function and before the trigger event, we will never leave the while loop as in example below.

ps3000_run_block (...
printf ( "Waiting for trigger..." );
while (!ps3000_ready)
{
Sleep ( 100 );
}

Any idea how to handle this?

Thanks!

Bane
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Postby Erik » Wed Apr 08, 2009 7:19 am

ps3000_ready returns a short with the following values.

Code: Select all
public enum ReadyStatus : short {
  DeviceNotResponding=-1,
  NotReady=0,
  Ready=1
}
Erik
PICO STAFF
PICO STAFF
 
Posts: 52
Joined: Mon Oct 23, 2006 8:16 am
Location: Cambridgeshire, UK

Postby bane » Wed Apr 08, 2009 9:41 am

Hi Erik,

yes I know this.

However for the SW Versions below:

Driver Version = 3.2.4.0
HW Version 5
Kernel Driver Version =1.13

ps3000_ready doesn't return DeviceNotResponding....

Did you try this?
And if yes, please provide me the SW version you have used?

Thanks in advance!

Bane
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Postby Erik » Wed Apr 08, 2009 10:12 am

I used version 3.6.4.6 of ps3000.dll, see attachment.

Rename to ps3000.zip and unzip
Attachments
ps3000.zip.vi
Current ps3000 driver.
(316.55 KiB) Downloaded 144 times
Erik
PICO STAFF
PICO STAFF
 
Posts: 52
Joined: Mon Oct 23, 2006 8:16 am
Location: Cambridgeshire, UK

Postby bane » Wed Apr 08, 2009 11:22 am

Thanks Erik, this works fine.

Could you please send me the link where I can find the latest drivers?

Regards,
Bane
bane
Active User
Active User
 
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

Postby Erik » Wed Apr 08, 2009 12:02 pm

Erik
PICO STAFF
PICO STAFF
 
Posts: 52
Joined: Mon Oct 23, 2006 8:16 am
Location: Cambridgeshire, UK


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests