This is basically weight serial number linking application..
1st COM port - Serial number
2ndCOM port - Weight
When I get valid weight then I store the value and keep monitoring for serial number, if serial number read then I will link and write to database or otherwise if I read weight again then I will update the weight value then monitor for serial number.
This is what my application