Does Ruby have support for serial connections - RS232??

Discussion in 'Ruby' started by Chris Finch, Aug 30, 2006.

  1. Chris Finch

    Chris Finch Guest

    Hi everyone,

    I would love to stick to Ruby with this problem - but is it possible in
    Ruby to interface with a device through a RS232 serial connection?

    I want to connect my Windows XP computer with a medical device through
    RS232 - get data from the device and send it messages.

    Any help greatly appreciated,
    Chris

    --
    Posted via http://www.ruby-forum.com/.
     
    Chris Finch, Aug 30, 2006
    #1
    1. Advertising

  2. On 8/30/06, Chris Finch <> wrote:
    > Hi everyone,
    >
    > I would love to stick to Ruby with this problem - but is it possible in
    > Ruby to interface with a device through a RS232 serial connection?
    >
    > I want to connect my Windows XP computer with a medical device through
    > RS232 - get data from the device and send it messages.
    >
    > Any help greatly appreciated,
    > Chris
    >
    > --
    > Posted via http://www.ruby-forum.com/.
    >
    >


    ruby-serialport might be what you are looking for:

    http://rubyforge.org/projects/ruby-serialport/

    Tom
     
    Thomas Beckett, Aug 30, 2006
    #2
    1. Advertising

  3. Chris Finch

    barabba Guest

    Thomas Beckett wrote:
    > On 8/30/06, Chris Finch <> wrote:
    > > Hi everyone,
    > >
    > > I would love to stick to Ruby with this problem - but is it possible in
    > > Ruby to interface with a device through a RS232 serial connection?
    > >
    > > I want to connect my Windows XP computer with a medical device through
    > > RS232 - get data from the device and send it messages.
    > >
    > > Any help greatly appreciated,
    > > Chris
    > >
    > > --
    > > Posted via http://www.ruby-forum.com/.
    > >
    > >

    >
    > ruby-serialport might be what you are looking for:
    >
    > http://rubyforge.org/projects/ruby-serialport/
    >
    > Tom


    I have tried ruby-serialport for my win32 project without success.

    In the package there is serialport.so that don't works with my ruby
    installation (ruby 1.8.4 (2005-12-24) [i386-mswin32]).

    To compile the file serialport.c in a dll with Visual Studio is not a
    problem, if you rember to use #define mswin in the code. When I tested
    my dll with miniterm.rb I get:
    (eval):1: (eval):1:in `private_class_method': undefined method `create'
    for clas
    s `Class' (NameError)
    from (eval):1
    from
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `re
    quire'
    from miniterm.rb:2


    On miniterm.rb:2 there is only:
    require "serialport"

    I don't know how to fix it, but I have created a simple dll in C++,
    that works only in windows, to open a serial port and get some data on
    it (there are many free serial implementation that target win32 in
    C++). I have used Swig to export a function to get data.
    If you know the module Win32API you don't need to create a dll.
     
    barabba, Aug 31, 2006
    #3
  4. Chris Finch

    Harry Guest

    Harry, Sep 1, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PaullyB

    JMS over a serial port (rs232)

    PaullyB, Feb 22, 2005, in forum: Java
    Replies:
    0
    Views:
    507
    PaullyB
    Feb 22, 2005
  2. Laura Lucas
    Replies:
    4
    Views:
    1,036
    Alf P. Steinbach
    Oct 8, 2004
  3. fidel
    Replies:
    1
    Views:
    702
    red floyd
    Sep 27, 2007
  4. missbirdie

    RS232 Serial port in spartan 3A

    missbirdie, Jun 29, 2008, in forum: VHDL
    Replies:
    0
    Views:
    922
    missbirdie
    Jun 29, 2008
  5. Max Kotasek
    Replies:
    4
    Views:
    1,032
    Max Kotasek
    Apr 9, 2010
Loading...

Share This Page