Hi

in my experience Ruby serialport library for Windows is in most cases 
not usable. I suppose the problem is Ruby's implementation of threads 
(green threads) under Windows.

For serial communication under windows I now use a RS-232/422/485 
connections over Ethernet (i.e. Ethernet to serial) - so from windows 
(Ruby) perspective I use TCP/IP communication which works fine.

BR Philipp


Jordan Applewhite schrieb:
> Hi ruby friends!
> 
> I'm using the ruby serialport library. The OS is windows.
> 
> I'm sending command strings over serial to an epson projector. The
> projector then interprets and executes the command and returns a string
> based on the results.
> 
> The serial port is receiving my commands when I print them, but the
> program hangs and crashes when I call gets, getc, or readline on the
> serial port.  Example paste here:
> http://rafb.net/p/GF6Ehz14.html
> 
> This isn't a problem for commands like PWR ON and PWR OFF, since I can
> just run those blindly and assume success.  For commands like PWR? or
> LAMP?, though, I need to see the return value.
> 
> The pastebin snippet isn't very comprehensive, but I have tried MANY
> variations of gets, getc, readline, and with several different
> (relevant, not random) record separators.
> 
> Any ideas why it is hanging and not returning a string?  FYI, it does
> return a string when I access the projector from Hyperterminal or
> telnet.
> 
> Thanks a lot!