Create a simple C# application for USB detection of labjack | LabJack
 

Create a simple C# application for USB detection of labjack

2 posts / 0 new
Last post
Vamsi Krishna Surya
vamsikrishnasurya's picture
Create a simple C# application for USB detection of labjack

Hi I'm trying to create a simple C# application using the code attached while building the code it shows me the library issue for some reason i am unable to sort it out. My purpose is to create a customised application which shows me which version and model of labjack is connected and Showing the connection status of the labjack when i plugged into my USB. Please help

LabJack Support
LabJack Support's picture
Since you posted in the U3

Since you posted in the U3 forum, I assume you want to use a U3, but your code is using the U12's ListAll function. The U3 uses the UD driver, and the U12 has its own driver. Both drivers have a ListAll function, but with different parameters and specific devices they support.

If you are trying to use the U3 and its UD library/assembly, make sure to add a reference to the LJUDDotNet assembly (component name LabJackUD .NET) in your project, and use the ListAll from its LJUD class. For example, using ListAll to find connected U3s:

int numFound = 0;
int[] serialNumbers = new int[128];
int[] localIDs = new int[128];
double[] addresses = new double[128];
LJUD.ListAll(LJUD.DEVICE.U3, LJUD.CONNECTION.USB, ref numFound, serialNumbers, localIDs, addresses);

Your code already has the correct "using" statement:

using LabJack.LabJackUD;

This "using" is for the U12 .NET assembly, and should be removed if you are not using a U12:

using lj;

Last, make sure you have ran the UD installer which installs the LabJackUD driver and the LJUDDotNet assembly for the U3:

https://labjack.com/support/software/installers/ud

For further help, please clarify which LabJacks you are using, and the errors you are getting with your code.