Results 1 to 3 of 3

Thread: XL2k & RS232

  1. #1
    New Lounger
    Join Date
    Jan 2001
    Location
    New Zealand
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XL2k & RS232

    I have a measuring device (a YSI 5100 D.O. meter) that sends data to a serial port. I need to collect that data and insert it in an XL worksheet.

    It sends out a text header followed by data sets, consisting of 4 values, every 15 seconds, for the duration of the test.

    Is there a way of accessing the serial ports from XL?

    Alternatively, the meter does have a simple remote control command language which could tell the meter when to send its data. The question then becomes - how do I send it those commands from XL and read the response?

    All help greatly appreciated.

    Kevin Moloney

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: XL2k & RS232

    Hi Kevin, Kevin here,

    You have several options. You can open the serial port in Excel VBA as you would open a file for sequential access except your "filename" is the OS com port ID:

    Open COM1 For Output As #1


    Write to the #1 "file" (the com port) using the Print #1 or Write #1 statement (I should think you would want the Print variety -- check the help for the differences.

    <pre>Open COM1 For Output As #1
    Print #1, YourVariables, text, whatever
    Close #1
    </pre>


    Second option:

    Use the MSComm control. If you have VB6 you have this control. If you have VB5, try this:

    http://ourworld.compuserve.com/homepages/r...rier/xmcomm.htm

    p.s. If I read this wrong and you want to Read From the serial port just change the Open COM1 for Input as #1.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    New Lounger
    Join Date
    Jan 2001
    Location
    New Zealand
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: XL2k & RS232

    [img]/w3timages/icons/yikes.gif[/img]
    Thanks Kevin, just the pointer I needed.

    Cheers,
    Kevin

Posting Permissions

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