2.1.4.23 DRV_MCMETROLOGY_GetChannelMeasureValue Function
C
float DRV_MCMETROLOGY_GetChannelMeasureValue(uint8_t channel, DRV_MCMETROLOGY_CHANNEL_MEASURE_TYPE type);
Summary
Gets the last value of the selected measurement type on the selected channel.
Description
Gets the last value of the selected measurement. Values are updated at the end of each integration period. For additional information about Measurement types, refer to the DRV_MCMETROLOGY_CHANNEL_MEASURE_TYPE definition.
Parameters
| Parameters | Description |
|---|---|
| channel | Indicate channel index |
| type | Indicate what type of measurement is obtained |
Returns
The value of the selected type.
Example
app_metrologyData.queueFree = uxQueueSpacesAvailable(appEnergyQueueID);
if (app_metrologyData.queueFree)
{
newMetrologyData.energy = DRV_MCMETROLOGY_GetEnergyValue(true);
newMetrologyData.rmsChannel0 = DRV_MCMETROLOGY_GetChannelMeasureValue(0, CHN_MEASURE_RMS);
xQueueSend(appEnergyQueueID, &newMetrologyData, (TickType_t) 0);
}
else
{
SYS_CMD_MESSAGE("ENERGY Queue is FULL!!!\n\r");
}
Remarks
None.
