Computing.Net > Forums > Programming > Perl serial port

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Perl serial port

Reply to Message Icon

Name: Jarrett Jones
Date: January 30, 2002 at 21:16:23 Pacific
Comment:

I am trying to write a program to open the serial port on an intel machine then display the output to the screen. I have a radio receiver device hooked to the #1 serial port which sends basically ASCII characters in the format 1,HE5. I believe the radio thing and the information transmitted is irrelevent. Sounds easy huh? Here is my code for a Windows NT machine:

#!c:\perl\bin\perl -w
open (PORT, ";
print $output1;

When this code is ran from an NT box it displays the expected text, but when I try it on a Win98 box it gets to the open port function than displays nothing. No text is transmitted.

The same code, with the port settings changed to /dev/ttyS0, on a linux box also does not display the expected text. It also stops right after the open function. But if I do a cat /dev/ttyS0 the text being sent through the serial is displayed.

I am sure all of the ports are enabled in the bios. The linux machine and the Win98 machine are actually the same -- dual boot, so the bios issue can't be the problem. I have tried setting the port parameters the same as the working NT box but the other two still don't work.

This has to be something simple...

Thanks in advance



Sponsored Link
Ads by Google

Response Number 1
Name: Jarrett Jones
Date: January 30, 2002 at 21:20:25 Pacific
Reply:

The code should read:

#!c:\perl\perl.exe -w

open (PORT, "'less than symbol'COM1") or die "Cannot read from COM1";

$output1 = 'less than symbol'PORT'greater than symbol';
print $output1;


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Perl serial port

Win NT Serial port interrupt prog. C++ www.computing.net/answers/programming/win-nt-serial-port-interrupt-prog-c/274.html

Assembly Serial Port Access www.computing.net/answers/programming/assembly-serial-port-access/11857.html

Serial Port Program www.computing.net/answers/programming/serial-port-program/2394.html