Re: Interfacing Instruments through serial port and parllel port through PERL
by Fastolfe (Vicar) on Jul 31, 2000 at 18:33 UTC
|
I don't know of any Perl modules that allow direct access to the parallel port, though things like Device::SerialPort will give you access to the serial port.
I'm doing something similar, with direct access to devices/sensors connected to my parallel ports, and I ended up having to write something in C to do it (mainly just the simple low-level send-a-byte/read-a-byte calls), and using the system()/open() calls in Perl to interact with it. Though if it can be done in C, it can certainly be built into a module by somebody, but I can't find anything on CPAN. | [reply] |
|
i ll be greatfull if u will send me or discuss with me how ur trying to send data to output port
munishbharara@yahoo.com
| [reply] |
Re: Interfacing Instruments through serial port and parllel port through PERL
by splinky (Hermit) on Jul 31, 2000 at 18:57 UTC
|
My preferred Linux solution is Expect.pm and cu.
The cu step may seem unnecessary, but I like
having it there to manipulate the serial port settings.
That's what it's for, after all.
*Woof* | [reply] [d/l] [select] |
|
That seems like a much more complicated way of doing it. Win32::SerialPort and Device::SerialPort are basically interchangable, and give you full control of the serial port, from baud rate, stop/start bits, parity, to break control, DTR/RTS management, etc. Very easy to use, too.
And, if someone ever ports them to the MacIntosh (and who knows, maybe they have), you'd be platform ready there.
--Chris
e-mail jcwren
| [reply] |
|
| [reply] |
RE: Interfacing instruments... serial, parallel ports, Perl (CPAN mods)
by ybiC (Prior) on Jul 31, 2000 at 18:46 UTC
|
Take a look at http://search.cpan.org - a cursory scan turned up SerialPort.
Wiser Monks than I might offer code examples if you provide some details on what you want to accomplish.
cheers,
ybiC | [reply] |
RE: Interfacing Instruments through serial port and parllel port through PERL
by Corion (Patriarch) on Jul 31, 2000 at 20:48 UTC
|
If you are talking about musical instruments, using the serial and/or parallel port is the wrong way. Most modern (electronic) instruments have MIDI ports, which you should use. MIDI is a protocol which is more or less like a 9600 baud serial connection from what I know. Documentation on the MIDI wire format is scarce, Perl modules for MIDI are even more scarce, but maybe you can find some (Linux or Windows) MIDI driver for some of the older soundcards with a gameport on them ...
On CPAN, there is at least the MIDI module and some other MIDI modules for MIDI file formats and a good guess would be that the MIDI wire format isn't that far from the MIDI file format ...
Reading the documentation to the MIDI module, there seem to be drivers for MIDI devices under Linux as well - /dev/midi0 might be where you want to write your MIDI data ...
If we aren't talking about musical instruments, ignore this :)
| [reply] |
|
MIDI is a control language... yeah it was written to control musical instruments (On byte, Tone Byte, Off Byte, etc...) but it has been adapted to control lots of other stuff too... my favorite being for lighting equipment.
| [reply] |