Interfacing the parallel port

D

Darius Gai

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!
 
C

Chris Lowis

Any help would be appreciated! Thx!

I've had success interfacing with the serial port using the
win32serial library (http://grub.ath.cx/win32serial/). 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
 
M

Michael Bruschkewitz

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

Zane Vohland

Darius said:
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-parallel-port/

Hope it helps!

Zane.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top