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!
Use class Win32API.
So you should be able to control all interface lines through
Win32-API-functions.
“Darius Gai” [email protected] schrieb im Newsbeitrag
news:[email protected]…
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
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-parallel-port/
Hope it helps!
Zane.