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

Datasheets and User Guides

App Notes

Software & Driver


4.2.1 - ListAll() [U3 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.


Would it be appropriate to make the 128 "magic number" a constant? Based on things I 

read earlier in the manual, specifically section 4.1.1

Personally I prefer to pass the array sizes into the method for added flexibility.

p.s. This is my first read through of the manual so I'll try to comment on things I notice.

Generally speaking we use constants to reflect values passed into functions but the addition of this one would be pretty easy so we will consider adding it into the next driver.