Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Reading from COM PORT in VB 6.0

Reading from COM PORT in VB 6.0

Scheduled Pinned Locked Moved Visual Basic
helpcomquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    popin
    wrote on last edited by
    #1

    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.

    N 1 Reply Last reply
    0
    • P popin

      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.

      N Offline
      N Offline
      No e
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups