Test and Measurement Forum

Two PS4000: how to tell one from the other

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

Two PS4000: how to tell one from the other

Postby Mitch7 » Mon Sep 27, 2010 9:46 pm

I have the following configuration where each PS4000 is paired with another data acquisition device attached to the same hub

Laptop USB Port 1
----> USB Hub
--------> DAQ device A
--------> PS4000 A

Laptop USB Port 2
----> USB Hub
--------> DAQ device B
--------> PS4000 B

If I use ps4000EnumerateUnits I can find the serial number of all the picoscopes. e.g. AS036/011

My question is, how do I relate a picoscope to it's physical location in the tree, so i know which DAQ device it's data should be grouped with?

I do have code that traverses the USB tree and finds the location of the two picoscopes (from a USB perspective), but I can't tell one ps from the other because the standard windows calls to retrieve the serial number of a connected USB device return an empty string.

So I am kinda stuck. I need to know the serial number to open the ps4000, but I can't relate that sn to the physical location.

I am using DeviceIoControl calls to get info about a particular USB port, including for example, manufacturer and model. I also ask for the serial number, but it comes back blank. It must be a different SN than the one returned from the pico enumerate method.

Any ideas? Thanks,

Mitch
Mitch7
Newbie
 
Posts: 0
Joined: Mon Sep 27, 2010 9:12 pm

Re: Two PS4000: how to tell one from the other

Postby Mitch7 » Mon Sep 27, 2010 10:33 pm

Perhaps if you can't think of a solution, could you at least tell me how the enumerateDevices call ultimately communicates with the USB device to get the serial numbers?

Thanks.

Mitch
Mitch7
Newbie
 
Posts: 0
Joined: Mon Sep 27, 2010 9:12 pm

Re: Two PS4000: how to tell one from the other

Postby ziko » Fri Oct 08, 2010 1:50 pm

Hi Mitch7,

I do not fully understand your question, could you explain further?

You can distinguish between two PS4000s by the handle and the ps4000GetUnitInfo function.

Have you tried these?

Kind regards
Ziko

Technical Specialist
ziko
Zen Master
Zen Master
 
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Re: Two PS4000: how to tell one from the other

Postby Mitch7 » Mon Oct 11, 2010 6:33 pm

Hello Ziko,

> You can distinguish between two PS4000s by the
> handle and the ps4000GetUnitInfo function.

I'm familiar with this function, and I know how to open a channel two two instrument and read from both instrument. The problem I have is that each PS4000 is paired with another IO device that is in the same case as the PS4000.

Imagine an instrument where a PS4000, another IO device, and a USB hub are packaged inside a case. Inside the case, the PS4000 and IO device plug into the hub. The hub plugs into a PC. Our software reads the signal from the PS and from the other IO device, and combines them in a way useful to the user.

Now imagine a second instrument plugged into the same. Our software now sees two PS4000s and two IO devices. Our software must read the the PS4000 and IO devices in "pairs". If it reads the PS4000 inside instrument A, then it must read the IO card that is inside instrument A. Similarly for instrument B.

The only way I can think of logically pairing the PS4000 and the IO device is by the fact that they are on the same USB hub. The IO device lets me read its serial number so I can save the info that the IO device is on HUB A. I have no way to tell which hub a PS4000 is connected to.

Any ideas to solve this problem are appreciated.

Mitch
Mitch7
Newbie
 
Posts: 0
Joined: Mon Sep 27, 2010 9:12 pm

Re: Two PS4000: how to tell one from the other

Postby ziko » Tue Oct 19, 2010 9:22 am

Hi,

I think your answer may have been on the helpdesk but just in case it hasn't and for anyone else interested you can use the ps4000OpenUnitEx function.

This function opens a scope device. The maximum number of units that can be opened is determined by the operating system, the kernel driver and the PC's hardware.

PICO_STATUS ps4000OpenUnitEx
(
short * handle,
char * serial
)

handle, pointer to a short that receives the handle number:
-1 : if the unit fails to open,
0 : if no unit is found or
> 0 : if successful (value is handle to the device opened)
The handle number must be used in all subsequent calls to API
functions to identify this scope device.

serial, the serial number of the device to be opened. A nullterminated
string.

Hope this helps
Ziko

Technical Specialist
ziko
Zen Master
Zen Master
 
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Re: Two PS4000: how to tell one from the other

Postby Mitch7 » Tue Oct 19, 2010 1:14 pm

Hi Ziko,

Thanks for your response. I know how to open a device and talk to it. However, the fundamental problem is I do not know which USB hub/port the device is plugged into.

Without info about the PS4000's physical location, I cannot associate the PS4000 with the other DAQ device plugged into the same hub.

Does that help you understand the problem? Yes I did submit a similar question to the help desk, but they haven't come up with a solution either.
Mitch7
Newbie
 
Posts: 0
Joined: Mon Sep 27, 2010 9:12 pm

Re: Two PS4000: how to tell one from the other

Postby ziko » Thu Oct 21, 2010 1:38 pm

Hi there is no way of telling which hub the scope is connected using our drivers.

I don't know if you can do this really, this is more of a USB thing.

Can you not get the id of the other device and associate them this way?

Kind regards
Ziko

Technical Specialist
ziko
Zen Master
Zen Master
 
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Re: Two PS4000: how to tell one from the other

Postby Mitch7 » Thu Oct 21, 2010 5:01 pm

> I don't know if you can do this really, this is
> more of a USB thing.

Exactly. I have code that finds the PS4000 on the USB tree, and I can read the manufacturer and model of the PS4000. However, I can't read anything that is unique to the unit.

> Can you not get the id of the other device
> and associate them this way?

I can get the serial number of the other device (NI USB6009 IO), but that is only half of the information required. I still need to know the serial number of the PS4000 that is attached to the same hub. If PicoTech provided the serial number in the USB info the problem would be solved - but they don't
Mitch7
Newbie
 
Posts: 0
Joined: Mon Sep 27, 2010 9:12 pm

Re: Two PS4000: how to tell one from the other

Postby ziko » Thu Oct 28, 2010 10:10 am

Having spoken with our software engineer unfortunately as you correctly pointed out we do not expose the serial number. This is not something we are thinking of changing in the immediate future.

Kind regards
Ziko

Technical Specialist
ziko
Zen Master
Zen Master
 
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 1 guest