[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Interfacing the parallel port

Darius Gai

7/30/2008 5:25:00 AM

I'm working on a project that requires the outputting of data via the
parallel port. Basically I want to set certain lines high and low with
ruby. However, I can't seem to find any example where ruby is used to
communicate with the parallel port. This project is for a windows
machine. In the past I've successfully managed to communicate with the
port using inpout32.dll and VB6. Inpout32.dll would come in handy again,
but I don't know how to add a dll file to a ruby script.

Any help would be appreciated! Thx!
--
Posted via http://www.ruby-....

3 Answers

Chris Lowis

7/30/2008 8:33:00 AM

0

> Any help would be appreciated! Thx!

I've had success interfacing with the serial port using the
win32serial library (http://grub.ath.cx/wi...). It uses a small
C program together with a ruby wrapper.

require 'Win32Serial'
@port = Win32Serial.new
@port.open("COM1")
@port.config(9600, 8, Win32Serial::NOPARITY,
Win32Serial::ONESTOPBIT)
@port.timeouts(0, 200, 0, 0, 0)
@port.write("test\r")

Perhaps this would give you a basis to build a parallel port
interface ?

Chris






Michael Bruschkewitz

7/30/2008 9:26:00 AM

0

Use class Win32API.
So you should be able to control all interface lines through
Win32-API-functions.

"Darius Gai" <darudude@gmail.com> schrieb im Newsbeitrag
news:a3b7b02052e87bbb19a563399e098e65@ruby-forum.com...
> I'm working on a project that requires the outputting of data via the
> parallel port. Basically I want to set certain lines high and low with
> ruby. However, I can't seem to find any example where ruby is used to
> communicate with the parallel port. This project is for a windows
> machine. In the past I've successfully managed to communicate with the
> port using inpout32.dll and VB6. Inpout32.dll would come in handy again,
> but I don't know how to add a dll file to a ruby script.
>
> Any help would be appreciated! Thx!
> --
> Posted via http://www.ruby-....
>
>


Zane Vohland

10/12/2008 4:22:00 AM

0

Darius Gai wrote:
> I'm working on a project that requires the outputting of data via the
> parallel port. Basically I want to set certain lines high and low with
> ruby. However, I can't seem to find any example where ruby is used to
> communicate with the parallel port. This project is for a windows
> machine. In the past I've successfully managed to communicate with the
> port using inpout32.dll and VB6. Inpout32.dll would come in handy again,
> but I don't know how to add a dll file to a ruby script.
>
> Any help would be appreciated! Thx!

Hi Darius,

Check out this example:

http://zanev.wordpress.com/2007/04/15/introducing-ruby-to-the-para...

Hope it helps!

Zane.
--
Posted via http://www.ruby-....