wiki:Docs/Prog/Manual/ApplicationLibraries/lib825ev/Weight/MnBdSetWIM

Version 1 (modified by Don Wilson, 5 years ago) ( diff )

--

MnBdSetWIM

Initiate mainboard for high speed buffered weight reading

int MnBdSetWIM(uint16 onDivisions, uint16 offDivisions, uint8 onCount, uint8 offCount, uint16 flag)

Parameters

  • onDivisions - weight division value to starting recording when weight is above this value for at least onCount
  • offDivisions - weight division value to stop recording when weight is below this value for at least offCount
  • onCount - number of consecutive weight values that must be above onDivisions to start weight recording
  • offCount - number of consecutive weight values that must be below offDivisions to stop weight recording
  • flag - special settings bitfield

Return Value

OK - Mainboard responded successfully.

Remarks

This function instructs the main board to prepare for buffered weight recording. When the gross weight division value exceeds the on threshold for consecutive on count the buffering begins. Gross weights are recorded into the buffer. When the gross weight drops below the off threshold for consecutive off count the buffering stops. This allows the application to process high speed.

Example

float onWtThres = 1500.0;
uint16 onThres = (int)(onWtThres / g_cal_param_n[1].interval);

uint8 onCount = 3;

float offWtThres = 1000.0;
uint16 offThres = (uint16)(offWtThres / g_cal_param_n[1].interval);

uint8 offCount = 3;

uint16 flags = 0;

if(MnBdSetWIM(onThres, offThres, onCount, offCount, flags) != OK)
{
    DrawErrorBox("Cannot start MNBD WIM", 15);
}

See Also

Note: See TracWiki for help on using the wiki.