Click or drag to resize

GetSerialNumber

Get the model of the current instrument or the instrument that is simulated.

virtual CString GetSerialNumber() const abstract;
Return Value

Returns the current instrument serial number.

Remarks

The value returned by this function is established by implementation of the InitializeIdentification function. By default, that function parses the *IDN? result to retrieve detailed information about the connected instrument.

Example

The following example demonstrates use of the GetModel function.

C++
// CoAcme4321.cpp
HRESULT Acme4321::Configure()
{
  HRESULT hr = S_OK;

  // This method is NOT supported by instruments with serial numbers that end in "X"
  CString strSerial = GetSerialNumber();
  if (strSerial.Right(1) == _T("X"))
    return err.ModelNotSupported(GetModel());

  hr = InstrPrintCommand();

  return hr;
}

Download a complete CHM version of this documentation here.