in reply to *extremely* simple Serial I/O
Win32::SerialPort is about as easy as it is possible to be. Try uing the tie interface. With this, you simply tie a filehandle to the serial port the device is attached to, COM1: COM2: etc., and then just print to it and read (<device>) from it using the standard perl io operators.
The example shown under the heading "Methods used with Tied FileHandles" in the pod, pretty much tells you all you need to know with regard to reading and writing. The only other part to understand is configuring the port to the appropriate baud rate, parity, start & stop bits, handshaking etc. but you would need to do this whatever language or comms library you used. Try typing help MODE for a little information on what can/needs to be configured, though the pod with the module seems pretty comprehesive.
As a simple first pass at getting things configured correctly, you can just use the comand line MODE COM1 BAUD=9600 etc to configure it, and the COPY CON COM1 to send and copy COM1 CON to retrieve responses. Once you get that to work, writing the program using WIn32::SerialPort should be pretty easy.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: *extremely* simple Serial I/O
by wa4otj (Beadle) on Nov 03, 2003 at 17:38 UTC |