Jump to main content

# 2.1.4.20 DRV_MCMETROLOGY_GetEnergyValue Function

## C

    float DRV_MCMETROLOGY_GetEnergyValue(bool restartEnergy);

## Summary

Gets the active energy value.

## Description

Gets the active energy value. Energy is updated at the end of each integration period.

## Parameters

Parameters | Description
--- | ---
restartEnergy | Flag to indicate if the accumulated energy value should be restarted after calling this routine

## Returns

The active energy value obtained according to the last integration period.

## Example

          /* Send new Energy values to the Energy Task */
          app_metrologyData.queueFree = uxQueueSpacesAvailable(appEnergyQueueID);
          if (app_metrologyData.queueFree)
          {
              newMetrologyData.energy = DRV_MCMETROLOGY_GetEnergyValue(true);
              newMetrologyData.Pt = DRV_MCMETROLOGY_GetMeasureValue(MEASURE_PT);
              xQueueSend(appEnergyQueueID, &newMetrologyData, (TickType_t) 0);
          }
          else
          {
              SYS_CMD_MESSAGE("ENERGY Queue is FULL!!!\n\r");
          }

## Remarks

None.

Rev: E