How to verify the USB connection state (PS3000)

Post general discussions on using our drivers to write your own software here
Post Reply
bane
User
User
Posts: 9
Joined: Thu Apr 02, 2009 8:22 am

How to verify the USB connection state (PS3000)

Post by bane »

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

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

Hi

You could call ps3000_get_unit_info and check the error code returned.

Robin

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

Post by bane »

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

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

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

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

Post by bane »

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

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

Post by Erik »

Hi Bane,

You need to do a run (or get values) to get the connection state of the device.

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

Post by bane »

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

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

Post by Erik »

ps3000_ready returns a short with the following values.

Code: Select all

public enum ReadyStatus : short {
  DeviceNotResponding=-1,
  NotReady=0,
  Ready=1
}

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

Post by bane »

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

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

Post by Erik »

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 455 times

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

Post by bane »

Thanks Erik, this works fine.

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

Regards,
Bane

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

Post by Erik »


Post Reply