CorpusDawg has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Fellow Monks,
I am fairly new to Perl and have been asked to write a program for serial communications. I think that Win32API::CommPort will fit my needs but I'm having a difficult time implementing it. I need help in opening the COM port and defining the settings and I also need to be able to allow the user to set the baud rate, all the other instruments we use have the same settings except for the baud rate. I also need to be able to watch the data that comes across the serial port. If anyone could point me to some reference material or provide some advice both would be greatly appreciated.

Thank you for your time and trouble

CorpusDawg
  • Comment on Serial Communication using Win32::SerialPort

Replies are listed 'Best First'.
Re: Serial Communication using Win32::SerialPort
by welchavw (Pilgrim) on Feb 02, 2004 at 19:43 UTC

    Your question is very general, and lacking a script using this module (yes, I SuperSearch'd), the best I can do is point you to what looks like very complete documentation...http://search.cpan.org/~bbirth/Win32-SerialPort-0.19/lib/Win32API/CommPort.pm.

    If you have specific problems that the docs can't answer, please try to refine your question further. BTW, you may simply be having problems naming the COM port? I know that sometimes "COM1" is required and other times "COM1:" is necessary...but this helpful hint does not mean that I've ever used the module, just ones like it in other languages.

    Good luck,
    welchavw

Re: Serial Communication using Win32::SerialPort
by NetWallah (Canon) on Feb 02, 2004 at 23:13 UTC
    If you need to READ a serial port, I'd suggest using Kiwi Harvester, which forwards data received from the serial port onto a SysLog server.

    For anything more complex, (Man - I'm about to show my antiquity...) you could use a scriptable Serial-port communication program, like Procomm Plus . I'm not sure if current Telnet clients like Putty or Terra Term Pro support the scripting you seem to need - but they are worth investigating, at NoNags.com.

    "When you are faced with a dilemma, might as well make dilemmanade. "

Re: Serial Communication using Win32::SerialPort
by diskcrash (Hermit) on Feb 03, 2004 at 00:03 UTC
    Amen, CorpusDawg and Fellow Monk,

    Yea tho' we walk through the valley of the RS-232 port our serial line analyzer and null modem cable comfort us. Try this node.

    Serial Port and IO Termination

    GL,

    Diskcrash