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

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

--

DLCRepeatMultiIncludeCellWts

Enable or disable inclusion of individual cell weight information in repeat multi event when used with DLC

int DLCRepeatMultiIncludeCellWts(int dlcCard, bool enable);

Parameters

  • dlcCard - card number of DLC card
  • enable - true to set app to receive cell weights, false for no cell weights

Return Value

  • Returns the result - OK success

Remarks

Examples

void IndStartup(void)
{
   MnBdStartup();

   AllocateRepeatMultiCellWtMemory(GetNumScales());

   if(DLCRepeatMultiIncludeCellWts(1, true) != OK)
   {
     DEBUG_MSG("Error set multi repeat cell wts\r\n");
   }

   MnBdSetEvent(MNBD_REQ_REP_MULTI, MnBdEventMultiRcv);

   if(StartRepeatMulti(100) == OK)
    DisplayText(0, 0, "Wt and I/O 10 times per second");
}

void IndShutdown(void)
{
   MnBdClearEnent(MNBD_REQ_REP_MULTI);
   StopRepeatMulti();

   DeallocateRepeatMultiCellWtMemory();
}

MNBD_EVENT(MultiRcv)
{
  if(repeat_multi_record == 0) // Scale weights and I/O status
  {
     // Do typical processing for scale weights
  }
  else if(repeat_multi_record > 0x30 && repeat_multi_record < 0x34)  // Cells weights for scale
  {
     int n = repeat_multi_record - 0x31;
     DEBUG_MSG("Cell wts for scale %d %6.0f %6.0f %6.0f %6.0f\r\n", n + 1,
        REPEAT_MULTI_CELL_WT(n, 0), REPEAT_MULTI_CELL_WT(n, 1), REPEAT_MULTI_CELL_WT(n, 2),  REPEAT_MULTI_CELL_WT(n, 3)); 
   
  } 

  return 0;
}

The above example will output cell weights such as:

Cell wts for scale 1    3665   1335   7289  12839
Cell wts for scale 2   14250  11641     -0      0
Cell wts for scale 3       0      0     -0     -0
Cell wts for scale 1    3665   1335   7288  12838
Cell wts for scale 2   14250  11641      0      0
Cell wts for scale 3       0      0     -0     -0
Cell wts for scale 1    3665   1336   7288  12838
Cell wts for scale 2   14249  11641     -0      0
Cell wts for scale 3       0      0     -0     -0
Cell wts for scale 1    3665   1336   7288  12838
Cell wts for scale 2   14250  11642      0      0
Cell wts for scale 3      -0      0     -0     -0

See Also

Note: See TracWiki for help on using the wiki.