http://qs321.pair.com?node_id=132775


in reply to Re: homemade data acquisition
in thread homemade data acquisition

As cacharbe mentioned, using a serial port is definitely the easiest and most portable solution. However, it is possible to talk to other devices with perl but requires more elbow grease. I worked on a similar project where I used the serial port to collect data (I was collecting directly from a Tektronix scope with RS232 out) but needed to use the parallel port to control some devices. As a result I created a Win32::RawIO module that let me talk to the parallel port. It did require creating a kernel level device driver (yuck!) but it works well. I'm working on cleaning it up for CPAN as time permits (it's only been tested in one app and isn't very robust and the pod is, well, there is no pod...) As a bonus the module comes with peek() and poke() routines that work on physical memory address which could lead to some really interesting obfus and other dark magic :-) Of course, my module only works on Win32 and as soon as someone needs to run the app on linux or something else I'll be writing a new device driver...

The serial port is definitely the best supported and what I would probably use but there are times when it's much nicer to be able to read or write 8 bits at a time or when you don't have a spare serial port.