Reading from COM PORT in VB 6.0
-
Hi, This is very urgent. We are to deliver at month end at are struck at a point where, we ahve a weighing machine connected to my computer through a com port (COM1). Now, we are developing an application in vb 6.0 to read the weight that is placed on the weighing machine. The problem is, the application is not fetching the value from the COM PORT and when it is fetching it is a junk data. Can anyone give an idea where to find help or provide with any link or provide with any code? Any help would be awesome... Anirban Deb.
-
Hi, This is very urgent. We are to deliver at month end at are struck at a point where, we ahve a weighing machine connected to my computer through a com port (COM1). Now, we are developing an application in vb 6.0 to read the weight that is placed on the weighing machine. The problem is, the application is not fetching the value from the COM PORT and when it is fetching it is a junk data. Can anyone give an idea where to find help or provide with any link or provide with any code? Any help would be awesome... Anirban Deb.
You should check the comm event, something like the following: mscomm1_OnComm() Select Case MSComm1.CommEvent Case comEvReceive ' Received RThreshold # of chars. g_rcvd = g_rcvd & MSComm1.Input End Select end sub Depending on what your scale is doing you may need to add some code to check for pauses in the code (like check to see how long it has been since g_rcvd has changed) Regarding the "junk data" I am suspecting is is returning ASCII, of HEX binary data and you will need to translate it (Bin 2 hex, use Chr$ function or something like that), not all hex values have good ASCII charactors to represent them, so it looks like junk.... good luck... A signature is only a signature if it is signed, signed