www.vtiinstruments.com
EX1629 Command Set 213
vtex1629_read_teds_URN
FUNCTION PROTOTYPE
ViStatus vtex1629_read_teds_URN (ViSession vi, ViInt32 channel, ViInt32 teds_urnArraySize, ViInt8 _VI_FAR
teds_urn[], ViPInt32 teds_urnActualSize);
FUNCTION PARAMETERS
vi = contains a session handle to the instrument. This handle is obtained by the function and remains valid until the
session is closed.
channel = an input integer value that specifies the channel number for the TEDS device from which the Unique
Registration Number (URN) should be read. Valid input values: 0 to 47.
teds_urnArraySize = an integer indicating the size of the array that holds the URN. Its value should be equal to
VTEX1629_MAX_MLAN_URN_SIZE.
teds_urn[] = an output array that will contain the TEDS URN. Its size should be equal to
VTEX1629_MAX_MLAN_URN_SIZE.
teds_urnActualSize = Output integer indicating the number of bytes actually written to the array that holds the
URN.
DATA ITEM RESET VALUE
Not applicable to this function.
DESCRIPTION
This function reads the Unique Registration Number (URN) from a TEDS device. This is a 64-bit value which
encodes a device family and a unique serial number.
NOTES 1) Details of the MLAN specification can be found at http://www.maxim-
ic.com/products/ibutton/applications/ and other sites.
2) The bytes returned in ‘buffer’ need to be interpreted by the application in accordance with the
MLAN specification.
EXAMPLE
ViSession instrumentHandle;
ViStatus status;
ViInt32 urnActualSize;
ViInt8 urnData[VTEX1629_MAX_MLAN_URN_SIZE];
…
status = vtex1629_read_teds_URN
(instrumentHandle, 15, VTEX1629_MAX_MLAN_URN_SIZE, urnData, &urnActualSize);
If (status >= VI_SUCCESS)
{
<do something with the device’s URN>
} else {
<inform the user the API call failed>
}