![]() | GetSimulate |
Indicates if simulation is enabled.
virtual bool GetSimulate() const abstract;
Returns true if simulation is enabled, otherwise false.
The following example demonstrates use of the GetSimulate function.
// 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; }