This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EVM430-FR6047: Change VFR calibration while running the code

Part Number: EVM430-FR6047

Hello,

I am looking to change the slope and offset of the VFR calibration as required while the code is running. I have found the values but can you suggest me the way to change the IQ16 values.

Regards,

Prudhvi Sagar

  • Hi Prudhvi,

    You can update it as part of the meter constant algorithm object - USS_Algorithms_Flow_Meter_Constant. 

    Please see the way it is updated as part of the GUI interface in ussDCCommandHandlers.c:Handler_calib_linear_constants_id(). I am copying the relevant lines of code here:

    // Store results
    gUssSWConfig.algorithmsConfig->calibObject.flowCalibObject->pMeterConfiguration[rangeNum].iq16minimumVFR = _IQ16(mcValues[0]);
    gUssSWConfig.algorithmsConfig->calibObject.flowCalibObject->pMeterConfiguration[rangeNum].iq16Slope = _IQ16(mcValues[1]);
    gUssSWConfig.algorithmsConfig->calibObject.flowCalibObject->pMeterConfiguration[rangeNum].iq16Offset = _IQ16(mcValues[2]);

    mcValues[] are provided by the GUI. In your case, these will be the updated values as part of your calibration.

    Srinivas

  • Hello Srinivas,

    Thank you for the support. Would there be an issue if I directly access then other than ussDCCommandHandlers.c:Handler_calib_linear_constants_id() and directly use

    gUssSWConfig.algorithmsConfig->calibObject.flowCalibObject->pMeterConfiguration[rangeNum].iq16Slope
    gUssSWConfig.algorithmsConfig->calibObject.flowCalibObject->pMeterConfiguration[rangeNum].iq16Offset

    Regards,

    Prudhvi Sagar

  • Hi Prudhvi,

    You should be able to. That is what is done in the provided library as well. You can see the usage in USS_calibrateVFRFlow(). It uses 

    flowCalibObj->pMeterConfiguration[calibIdx].iq16Slope

    flowCalibObj->pMeterConfiguration[calibIdx].iq16Offset

    where flowCalibObj = config->algorithmsConfig->calibObject.flowCalibObject

    which is basically what you are suggesting. 

    Srinivas

**Attention** This is a public forum