Measurement Computing   Easy to Use | Easy to Integrate | Easy to Support catalog banner

Reading back factory serial number of USB-2404 series devices

Expand / Collapse
 

Reading back factory serial number of USB-2404 series devices


When using the cbw32.dll, a programmer can call the function cbGetConfig() to return the serial number of a MCC DAQ device. When using this function, certain devices return the serial number in Decimal format while others return it in Hexadecimal format. In InstaCal, if you wish to view the device’s serial number you can do so using the board configuration button, which among other things, displays the value in Hexadecimal format. Working between these two bases may be confusing. The following section of code demonstrates how one would read the back the device's serial number and convert it into Hexadecimal format.  

This example pertains to the following devices:

  • USB-2404-10
  • USB-2404-60
  • USB-2404-UI

 

Thefollowing section of code was written in Visual Basic. NET:

InfoType   = 2    'The ConfigItem we are using is a subtype of BOARDINFO.

BoardNum   = 0    'We are hard coding this example to run on whatever Board 0is.

DevNum     = 0    'Remains 0 sincewe want board information.

ConfigItem = 224  'In the cbw headerfile 224 correlates to BIMFGSERIALNUM 


cbConfig   = cbGetConfig(InfoType, BoardNum, DevNum, ConfigItem,ConfigVal)


Console.WriteLine("Here is the Serial Number in Decimal Format:       " + ConfigVal.ToString)

HexValue   = Hex(ConfigVal) 'Hexis a VB.NET built in function that allows us to convert from decimal tohexadecimal


Console.WriteLine("Here is the Serial Number in HexadecimalFormat:   " + HexValue)



Disclaimer:
The attached Code or Example is provided As Is.  It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments.  You assume all risks for use of the Code or Example.





Rate this Article:

Add Your Comments


For comments email [email protected].

Details
Article ID: 50484

Last Modified:9/12/2013 2:26:26 PM

Article has been viewed 13,177 times.

Options