Skip to content

ModelInFamily

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

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

strModel

[in] Instrument model.

strFamily

[in] Instrument family.

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

The following example demonstrates use of the ModelInFamily function.

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;
}