Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl and Serial Ports

Status
Not open for further replies.

starky5

MIS
Sep 27, 2001
9
US
We have a pc hooked to a scale that uses a vb script to continuously send the "send weight" string to the scale and insert that weight into a table on a unix server. We would like to replace these pc's with thin clients and move this script to the unix server with perl. The scales would then be hooked to terminal server with an ip. Can a perl script be written to do this? If so, what modules would be needed?

Thanks again in advance,
Greg
 
The answer is yes. I've done this sort of thing before. Are you connecting to the terminal server with telnet? If so, check out the Net-Telnet module. This module works on Unix as well as Windows so your script could run from both types of machines. If you want, I can provide some code snippets for using the Net-Telnet module.
 
It sounds like you want to "talk" to the serial port. This can be done just like every other file by using the filename of the port.

If the string to be sent is short then a simple print OFH "string\n"; can be used. If its long take a look at the pack function to build the string.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top