VBA RS232 Class - serial port I/O with modCOMM

  • Re: VBA RS232 Class


    Excellent work:


    If I wanted to read a Modbus address at location 30730 how does this code accept that?
    Can I then take that result and place it into cell A1?


    Ellis

  • Re: VBA RS232 Class


    I'm afraid I don't have any experience with Modbus so I can't offer you any suggestions.
    I've only worked with RS232 devices at work such as multimeters & some of our own serial, USB & Bluetooth products
    Have you tried googling VB6 Modbus. There is a lot of free useful code on VB6 websites.

  • Re: VBA RS232 Class


    Dear Brendan,


    Does your VBA work with USB/232 converter?
    Can we put read data into some Cell? If ok, this would be great for graph the data for futher analysis on time series data read...


    Please support...1000000 thanks!

  • Re: VBA RS232 Class


    Yes it works fine with usb to serial converters. You can put the received data anywhere you like.
    I've used it several times to read serial data and display/graph on a worksheet.
    The version above won't work however with Excel 2010 64bit. I do have a newer version which
    Works with both 32 & 64 bit Excel if anybody wants it.

  • Re: VBA RS232 Class


    thanks foran excellent work. can i have your hard-work newer version please?


    Moreover, i want to read information from truck-scale idicator then put it to an txtbox , how can i do that ?

  • Re: VBA RS232 Class



    Brendan: Thanks for posting the code. I am new at VBA. I do not understand how the module would interface with the spreadsheet, what code would be required to send and receive from cells or textboxes? Thanks, Jesse

  • Re: VBA RS232 Class


    More than once I've tried to find something like this.


    Can you intercept the USB ports as well?

  • Re: VBA RS232 Class


    Can you be more specific as to what exactly is happening when you try to use it. I've used it with winxp, 7 64bit + excel 2003 & 2013 with no issues.
    Make sure that you have the correct comm parameters set. Also check if your application needs a particular flow control setting for the com port you are using. Are you sending the correct command strings to your serial device. Check the serial communications protocol requirements for your device. If your really stuck you can download free serial port monitor software which can show you serial data traffic on any comm port. Also you could try using software such as Realterm to sent and receive to you device to verify that you have valid comm settings & command strings

  • Re: VBA RS232 Class


    Hello, I just found your program, and it's exactly what I've been looking for! everything seems to work nicely with the code I already had, but I was wondering if there was a way to have a sub automatically execute when new serial data arrives. I have a lot of code that needs to be running, and don't want to waste efficiency checking the serial port repeatedly.

  • Re: VBA RS232 Class


    I had a similar requirement myself some time ago and ended up using mscomm. It is possible to get mscomm working in excel if you install the necessary license keys into your registry - if you search the net you can find the correct procedure to do this. Mscomm does not work with usb to serial converters however as far as i know.


    Failing that i think you are stuck with polling the port using ontime or similar i'm afraid.

  • Re: VBA RS232 Class - serial port I/O with modCOMM


    very helpful
    no need to use third party inter-face or hyperterminal any more
    example for downloading stream from Nikon data recorder

  • Re: VBA RS232 Class - serial port I/O with modCOMM


    Survey Instrument Data Collector Download code for Nikon, Topcon, Lecia and Sokkia to excel worksheet.
    Utilizing David M. Hitchner's modComm and Brendan Lambe RS232 Class .


    forum.ozgrid.com/index.php?attachment/62343/


    It can be easily adapted to be used with other serial port output equipment or changed to transfer data to a txt file. Hope it helps

  • Re: VBA RS232 Class - serial port I/O with modCOMM


    and for those asking
    with the workbook above
    code just to down load the text stream from input serial port

  • Re: VBA RS232 Class - serial port I/O with modCOMM


    Hii i have downloaded ur spreadsheet ..and i have enable the macros..there is arduino which is sending "Hello"on com7..how to select the com port??plz help

  • Re: VBA RS232 Class - serial port I/O with modCOMM


    Hello,
    What a nice job, thanks a lot !
    I downloaded the file and succeeds in communicating with several scales. I would now like to communicate with two scales to retrieve the data from both scales in an excel sheet. Is it possible to manage two differents com port with RS232 Class ? and if yes how to do that ?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!