Click or drag to resize

ModelInFamily

Indicates if the specified model is a member of the specified family.

bool ModelInFamily(const CString& strModel, const CString& strFamily) const;
Parameters
strModel

[in] Instrument model.

strFamily

[in] Instrument family.

Return Value

Returns true if the specified model is in the specified family.

Example

The following example demonstrates use of the ModelInFamily function.

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

  // There are three families of instruments: "Acme432X", "Acme433X", "Acme434X".

  // Get the current model
  CString strModel = GetModel();

  // The SCPI command is slightly different for the models in the "Acme433X" family
  CString strCmdFmt;
  if (ModelInFamily(strModel, _T("Acme433X")))
  {
    strCmdFmt = _T("FREQ %.15g;GAIN %.15g");
  }
  else
  {
    strCmdFmt = _T("FREQX %.15g;GAINX %.15g");
  }

  hr = io.Printf(strCmdFmt, Frequency, Gain);

  return hr;
}
See Also

Download a complete CHM version of this documentation here.