Click here to get back home

SerialPort write question

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
SerialPort write question Spin 10-28-2004
Get Chitika Premium
Posted by Spin on October 28, 2004, 11:52 am
Please log in for more thread options
I am using Device::Serialport 1.000002 on a RH 7.2 box, listening on
/dev/ttyS1 to a laboratory device.

I'm just getting going with this module and I'm finding the $ob-write()
a little erratic.

What is the nature of the data that is sent to the serial port?

This works fairly consistently (95% +):
$ob->write("x02x30x33x80x90x41x80x00x00x00x00x00x00x00x00x00x00x00x00x00x00xc1x03rn");

but this doesn't work consistently:
$ob->write(&ack_msg($loc));

where ack_msg is:

sub ack_msg {
        my ($ack,$data,@array, $format, $i);
        $data = unpack("a16"x(length($_[0])/16)."a*",$_[0]);
        my($len) = int(16);        # ACK message length constant
        @array = unpack('C*', $data);
        $_ = sprintf "%2.2x", $_ for @array;
        $format = "%s%s%s%sn";
$data =~ tr/
Similar ThreadsPosted
Serialport Read question October 28, 2004, 11:59 am
Tie::YAML doesn't write to tmp file first? December 23, 2007, 9:34 am
How to write into existing Excel Spreadsheets? July 13, 2004, 1:24 pm
Can I write Macros in excel workbook ? October 8, 2004, 7:50 am
I don't want to write an HTML templating module August 30, 2007, 5:27 am
write a new module for suffix trees? April 3, 2008, 5:12 pm
write permissions installing XML-SAX-Expat-0.38 locally June 9, 2007, 10:44 am
Need help with Win32::SerialPort August 13, 2004, 5:43 am
need help with "SerialPort" module April 25, 2006, 11:34 pm
help on win32::serialport June 4, 2007, 5:12 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap