Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Getting Device Information


  • Please log in to reply
2 replies to this topic

#1 Trader451

Trader451
  • Members
  • 8 posts

Posted 16 February 2014 - 05:21 PM

Hello all,

 

New to LabJack and rusty in C# !

 

I would like to get the following information from my labjack:

 

LOCAL ID
HARDWARE VERSION
SERIAL NUMBER
FIRMWARE VERSION
BOOT LOADER VERSION
PRODUCT ID
LED STATE

 

From various examples I have managed to cobble together this:

 

public double LabJackSerialNumber()

        {
        LJUD.eGet(u3.ljhandle, LJUD.IO.GET_CONFIG, LJUD.CHANNEL.SERIAL_NUMBER, ref dblValue, 0);
        }
 
Not sure where to go from here or if I am going in the right direction. 
 
Would like to see your ideas in C# (probably corrections, LOL)
 
Appreciate your time !


#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 17 February 2014 - 01:49 PM

I assume you open your U3 to get the device handle elsewhere in you code. Your eGet call looks correct, and if you wanted your method to return the serial number you would add this after the eGet call:

 

return dblValue;

 

As for the other information, you can make a call like you did for the serial number though change the eGet call's third parameter for the information you want. Here are C# constants you would pass:

 

LJUD.CHANNEL.LOCALID
LJUD.CHANNEL.HARDWARE_VERSION
LJUD.CHANNEL.SERIAL_NUMBER
LJUD.CHANNEL.FIRMWARE_VERSION
LJUD.CHANNEL.BOOTLOADER_VERSION
LJUD.CHANNEL.PRODUCTID
LJUD.CHANNEL.LED_STATE
 

Note you can see the C# classes, methods and constants in Visual Studios using the Object Browser. General UD driver documentation (which includes pseudocode) can be found here in the User's Guide:

 

http://labjack.com/s...3/users-guide/4



#3 Trader451

Trader451
  • Members
  • 8 posts

Posted 23 February 2014 - 04:21 PM

Appreciate your reply ! Worked very well and my coding is not as bad as I thought !




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users