PaulNg has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I'm having a bit of a problem with Telnet and Modbus.
I'm trying to send a packet over to a Modbus slave but Telnet.pm is attaching a CRLF (0d 0a) to the end of my packet and it's confusing my Modbus slave. I am unsure how to prevent the module from sending the last packet! My send code is attached below. I've tried changing binmode but all it does is change whether CR or LF is being sent. Help please. Thanks!
Regards, Paul.
Example sent packet: 01 06 07 D0 00 00 89 47 0A
What I need: 01 06 07 D0 00 00 89 47
$data = join('',@buffor); #M +odbus frame to scalar print "ASCII characters sent: $data\n"; if ($Telnet) { #print "Sending over telnet\n"; $pass=$ob->print($data) or warn "Modbus client : problem with send: $! +\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Telnet.pm Sending CRLF
by moritz (Cardinal) on Feb 22, 2012 at 08:24 UTC | |
by PaulNg (Novice) on Feb 23, 2012 at 06:42 UTC |