4.2.1 - ListAll() [U6 Datasheet] | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


4.2.1 - ListAll() [U6 Datasheet]

Returns all the devices found of a given DeviceType and ConnectionType. Searching over Ethernet relies on the DiscoveryUDP function (Section 5.2.3), which might not work on certain network configurations.

ListAllS() is a special version where DeviceType and ConnectionType are strings rather than longs. This is useful for passing string constants in languages that cannot include the header file. The strings should contain the constant name as indicated in the header file (such as “LJ_dtUE9” and ”LJ_ctUSB”). The declaration for the S version of open is the same as below except for (const char *pDeviceType, const char *pConnectionType, …).


LJ_ERROR _stdcall ListAll (  long DeviceType,
                             long ConnectionType,
                             long *pNumFound,
                             long *pSerialNumbers,
                             long *pIDs,
                             double *pAddresses)

Parameter Description:
Returns: LabJack errorcodes or 0 for no error.

  • DeviceType – The type of LabJack to search for. LJ_dtUE9 (9), LJ_dtU3 (3), or LJ_dtU6 (6). For other LabJack devices, see What driver/library should I use with my LabJack?
  • ConnectionType – Enter the constant for the type of connection to use in the search. LJ_ctUSB (1) or LJ_ctETHERNET (2) (UE9 only).
  • pSerialNumbers – Must pass a pointer to a buffer with at least 128 elements.
  • pIDs – Must pass a pointer to a buffer with at least 128 elements.
  • pAddresses – Must pass a pointer to a buffer with at least 128 elements.


  • pNumFound – Returns the number of devices found, and thus the number of valid elements in the return arrays.
  • pSerialNumbers – Array contains serial numbers of any found devices.
  • pIDs – Array contains local IDs of any found devices.
  • pAddresses – Array contains IP addresses of any found devices. The function DoubleToStringAddress() is useful to convert these to string notation.



I don't understand much of C, C#, etc. and can't get this to work. Is there a way to read a U6's serial number while running a VB 2010 application? Read the serial number and compare to a stored variable to make sure certain U6 is connected for example.



ListAll is not the best way to do that.  Rather, see the pseudocode in Section 4.3.2 to read Local ID.  You can do the same thing to read Serial Number.  Actually, you will see this done in the UE9_Simple example from the DotNet_LJUD archive.