Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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;

![]() |
![]() |
![]() |

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