Click or drag to resize

GetSimulate

Indicates if simulation is enabled.

virtual bool GetSimulate() const abstract;
Return Value

Returns true if simulation is enabled, otherwise false.

Example

The following example demonstrates use of the GetSimulate function.

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

  // Do not communicate with instrument if simulation is on
  if (GetSimulate())
  {
    // Return simulated values
    *Frequency = 1.2E9;
    *Gain = 0.5;
    return S_OK;   
  }

  hr = io.QueryNumber(_T("FREQ?"), Frequency);
  if (SUCCEEDED(hr))
  {
    hr = io.QueryNumber(_T("GAIN?"), Gain);
  }

  return hr;
}
See Also

Download a complete CHM version of this documentation here.