#2871 translation binary

obsolete: 8.4.2
closed-invalid
5
2004-09-14
2004-09-14
Anonymous
No

tcl version 8.4.2
system windows xp

problem:-
setting serial com port to translation binary causes data
to be output to the serial port ending with a LF. The
data should end blank.

This is a problem when using RS485 Modbus protocol for
the commands sent are not recognized by remote
equipment because of this LF.

I can supply oscilloscope traces of a working solution
using Visual Basic and the erroneous output using Tcl.

code:

#send rtu command to config use with asci
set tty [open com2 {WRONLY}]
fconfigure $tty -translation {binary}
fconfigure $tty -buffering {none} -buffersize 8
fconfigure $tty -handshake {none} -mode 9600,n,8,1
fconfigure $tty -blocking 1 -timeout 1000
fconfigure $tty -eofchar {}
set tx_comms [binary format "W1" 0x0105000300003dca]
puts $tty $tx_comms
pause 100
set tty [close $tty]

Discussion

  • Donal K. Fellows

    • labels: --> 24. Channel Commands
    • assigned_to: nobody --> andreas_kupries
    • status: open --> closed-invalid
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    This is by design. Use:
    puts -nonewline $tty $tx_comms

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks