in reply to How to Format Serial Port Output Format

I've used Perl to retrieve rft (really f****** cold) freezer temperatures and one of the things I needed to do was send hex to the unit through the serial interface. I was able to do this using Perl's 'pack'.
Check out:
http://perldoc.perl.org/functions/pack.html
Maybe that will help.

  • Comment on Re: How to Format Serial Port Output Format

Replies are listed 'Best First'.
Re^2: How to Format Serial Port Output Format
by user2829 (Acolyte) on Dec 09, 2010 at 17:39 UTC
    ok I guess pack function in perl works for me :).. @input=(0x04,0x0e,0x04,0x01,0x03,0x0c,0x00); $ascii = pack("C*", @input); print "the value is $ascii"; $PortObj->write($ascii)|| die "Can't write to $PortName: $^E\n";; Thanks, -USER2829