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
-->
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.
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?
> 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.
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.
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.
> 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
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.