CLSID_VIO_MASS_AIR_FLOW_RATE

This CLSID returns the mass flow rate of air into the engine.

Name

Mass air flow rate

Access

Read, shareable or exclusive

Range

Type: VT_UI2 (unsigned short fixed point decimal)
Low: 0.00
High: 655.35

Input

None

Output

Type: VT_UI2 (unsigned short fixed point decimal)
Measurement: VIOMEASUREMENT_FLOWRATE
Units: VIOUNITS_GRAMSPERSECOND

Remarks

API device objects expect the following data types and sizes when sending data to and from the mini-drivers:

Mini-driver input

None

Mini-driver output

Type: USHORT *
Size: 2 bytes
Description: Air flow rate in 0.01 grams per second increments

Example

HRESULT hr;
IVIO_Device *pAirFlow;
VIODEVICEMETRICS dmAirFlow;
VARIANT vDeviceData;
USHORT usFlowRate;
float fFloatFlowRate;
//Create an instance of the mass air flow rate device and get its 
//IVIO_Device interface.
hr = CoCreateInstance(CLSID_VIO_MASS_AIR_FLOW_RATE, NULL,
                     CLSCTX_INPROC_SERVER, IID_VIODEVICE,
                     &pAirFlow);
//Get the metrics for the air flow device.
pAirFlow->get_Metrics(&dmAirFlow);
//Ask the device for the current air flow rate.
pAirFlow->GetData(&vDeviceData, 3000);
//Fetch the air flow rate as a fixed-point value from the VARIANT.
usFloatRate = vDeviceData.uiVal;
//Convert the fixed-point value to a float value.
fFloatFlowRate = ((float) usFloatRate) * (10 ^ dmAirFlow.lExponent);
//Release the reference to the interface.
pAirFlow->Release();