Consulting

Results 1 to 9 of 9

Thread: How to Read Data From COM Port

  1. #1
    VBAX Regular
    Joined
    Apr 2016
    Posts
    11
    Location

    How to Read Data From COM Port

    Hello masters of VBA,

    After spent days search on google for this and failed to understand what exactly what I need to do. I finally decided to post here and ask for some serious help.

    I have a USB GPS Data Logger (HOLUX M-215+) is currently connected to my COM8 port with baud=4800 parity=N data=8 stop=1.
    What I want to do is that while it is connected to my PC, I want to one click in a userform and then the N&W information in GPS is recorded and send to some specific cell in workbook. The usefrom is working now except GPS part.

    I understand there are few diffent versions of codes out there. But, as a beginer of VBA, I dont even know where to put these codes, and how to make VBA reading information via USB GPS. Can someone please walk me through? Your kindness and knowledge is greatly appreciated.



    Thank you very much.
    Ken

  2. #2
    VBAX Regular
    Joined
    Apr 2016
    Posts
    11
    Location
    anyone?

  3. #3
    VBAX Regular
    Joined
    Apr 2016
    Posts
    11
    Location
    I can not delete this post, please delete

  4. #4
    VBAX Expert
    Joined
    Oct 2012
    Posts
    726
    Location
    Why delete?
    This is quite a specific (not realy VBA related) request that very few people would have experience of.
    If the problem is solved post the answer so others can learn.

  5. #5
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Thread moved to Integration forum and Title changed for better response to question
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  6. #6
    VBAX Newbie
    Joined
    May 2016
    Posts
    1
    Location
    Maybe this link will help: www dot granite dot ab dot cs slash access slash serialport dot htm
    ...sorry but it won't let me post a url yet.

  7. #7
    VBAX Regular
    Joined
    Apr 2016
    Posts
    11
    Location
    Just want to quickly update to people who will need this.
    I finally got the code working for me from this site: ..hxxp://dev.emcelettronica.com/serial-port-communication-in-excel-vba

    I alter the code to output to a cell within the sheet and manipulate from there. However, I encountered with another problem. the COM Port# changes every time when USB GPS plug into the computer. I will have to manually change the com port#/ is there anyway the code can read USB come port #? Thanks. I know very few people know this.. I am just testing luck here

  8. #8
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Since the device probably has a unique ID: http://answers.microsoft.com/en-us/w...4-6860f8ce3da0

    Reading all open ports: https://www.petri.com/quickly_find_local_open_ports

    Once you have a list of open ports, Loop thru them and try to read from each. If you first check a hard coded array of the ports known to be used elsewhere, it will speed things up quite a bit.


    Does the device ave a drive letter in Windows Explorer? https://social.msdn.microsoft.com/Fo...-?forum=isvvba

    When you finally get the entire process working, please post all the code here.
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  9. #9
    VBAX Regular
    Joined
    Apr 2016
    Posts
    11
    Location
    Hi Sam, I appreciate you reply to my post. Unfortunately, my background is not from IT area. I understand so little for what you referenced. But thank you anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •